" isn't delimiter!!

Syntax highlighting, code folding, brace matching, code indenting, and function list

" isn't delimiter!!

Postby epaalx » Fri Oct 29, 2004 3:44 am

I've downloaded latest TCL wordfile however, the highlighting engine is treating '\"' as a string delimiter, where as obviously it isn't (I think in any language).
[It's strange that freeware like Crimson Editor (which is quickly catching up to UE as super-fast WIN editor) can do a much better job..]
Or, perhaps, I can do it... Anyone can tell me how?
User avatar
epaalx
Basic User
Basic User
 
Posts: 13
Joined: Thu Oct 28, 2004 11:00 pm

Re: \" isn't delimiter!!

Postby DJMaze » Sat Oct 30, 2004 12:09 am

sometimes i use \\" or even \\\" and almost every editor dies on them.

somehow they don't recognize if they are in a single or double quoted string

'\\\"' and "\\\""

I just comment a extra quote on the next line like
//' or #'
User avatar
DJMaze
Newbie
 
Posts: 2
Joined: Sun Jun 27, 2004 11:00 pm
Location: Netherlands

Re: \" isn't delimiter!!

Postby Mofi » Sat Oct 30, 2004 4:26 am

It is configurable in UltraEdit, which characters are delimiters. Open the wordfile, go to the language for TCL. The second line starts with /Delimiters =. Delete '\' from that line.

The wordfiles at the download section are not created by IDM. They are created by users.

If '\' is normally a delimiter, but is also used as escape character in strings, Escape Char = \ must be defined in the language definition line. See help of UltraEdit about Syntax Highlighting for details.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: \" isn't delimiter!!

Postby epaalx » Sun Oct 31, 2004 7:32 pm

Mofi, I think you misunderstand the requirement... The double quote is normally a delimiter. However, when prepended with a backslash, it's not a delimiter anymore. That's the problem!
It seems that syntax highlighting implementation is grade-school programming level in UE - it's completely language-context independent.
If I'm incorrect, then please tell me how to make \" a non-delimiter whilst keeping \ and " as delimters.
User avatar
epaalx
Basic User
Basic User
 
Posts: 13
Joined: Thu Oct 28, 2004 11:00 pm

Re: \" isn't delimiter!!

Postby Mofi » Mon Nov 01, 2004 3:58 am

Okay, now I have understood. You have to define '\' as escape character with Escape Char = \ at the language definition line which should then look like

/L20"Tcl/tk" Line Comment = # Escape Char = \ File Extensions = TCL TK

\ and " are still word delimiters, but \" is not a string delimiter anymore. So a string like "string in \"quotes\"" is completely highlighted as string instead of "string in \"quotes\"". But a double click on quotes to select the word marks only quotes without \".
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: \" isn't delimiter!!

Postby epaalx » Mon Nov 01, 2004 4:20 am

Mofi, thank you very much... It does work!
May I ask for something else...
In these TCL instructions,
set referenceId A85
set prefix 819045
both A85 and 819045 are valid TCL scalars.. yet, in UE, only 819045 is highlighted (as a scalar)... How can I change wordfile to make A85 be highlighted as a scalar?
User avatar
epaalx
Basic User
Basic User
 
Posts: 13
Joined: Thu Oct 28, 2004 11:00 pm

Re: \" isn't delimiter!!

Postby Mofi » Mon Nov 01, 2004 5:48 am

Hexadecimal numbers, always a problem of highlighting.

The best solution is to write a 0 before the hexadecimal number (0A85), if the number starts with A-F. Many interpreters even requests this.

The only workaround for highlighting hexadecimal numbers without a preceding 0 is to add all hexadecimal numbers of your file manually to a color section and set the color for this section to the same of the numbers.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: \" isn't delimiter!!

Postby epaalx » Mon Nov 01, 2004 7:56 pm

Mofi, "A85" in the example is not a hex number (at least not in TCL)... it's a valid TCL scalar!
That's why syntax highlighting cannot be done based on syntax-independence. I had a look at method used by UE and standby my conclusion It seems that syntax highlighting implementation is grade-school programming level in UE.
User avatar
epaalx
Basic User
Basic User
 
Posts: 13
Joined: Thu Oct 28, 2004 11:00 pm


Return to Syntax Highlighting