September 02, 2004
Nick wrote:
> Or maybe I've just misunderstood what a Wysiwyg string is...

I think that's the case:

From http://www.digitalmars.com/d/lex.html#stringliteral:

Wysiwyg quoted strings are enclosed by r" and ". All characters between the r" and " are part of the string except for EndOfLine which is regarded as a single \n character. There are no escape sequences inside r" ":

	r"hello"
	r"c:\root\foo.exe"
	r"ab\n"	  string is 4 characters, 'a', 'b', '\', 'n'
		
> 
> Nick
> 
> In article <ch72d8$agf$1@digitaldaemon.com>, Nick says...
> 
>>In article <ch6j4l$4q0$1@digitaldaemon.com>, Kramer says...
>>
>>>When using "r" for Wysiwyg strings, the text after the first Wysiwyg string is
>>>still highlighted as if it were part of the first string, until the next quote.
>>>
>>>Example: writefln(r"c:\", r"d:\");
>>>^^^^^^^^^
>>>highlighted
>>
>>Short answer: writefln(r"c:\\", r"d:\\");
>>
>>Long answer:
>>The backslash is in many cases considered as a "literal" character, which means
>>that the next character is to be taken literally as part of the string. For
>>example, \" means that the character " is supposed to be part of the string. In
>>your case the resulting string is:
>>c:", r
>>and then the string ends (I guess your example didn't compile?). To use an
>>actual backslash character as part ot the string, use \\
>>
>>Nick

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
September 03, 2004
J C Calvarese wrote:

> Nick wrote:
> 
>> Or maybe I've just misunderstood what a Wysiwyg string is...
> 
> 
> I think that's the case:
> 
>  From http://www.digitalmars.com/d/lex.html#stringliteral:
> 
> Wysiwyg quoted strings are enclosed by r" and ". All characters between the r" and " are part of the string except for EndOfLine which is regarded as a single \n character. There are no escape sequences inside r" ":
> 
>     r"hello"
>     r"c:\root\foo.exe"
>     r"ab\n"      string is 4 characters, 'a', 'b', '\', 'n'
>        

No escape sequences? How would it then be possible to have the string
"JCC" (including the ") in there?
r"My handle is "JCC""
wouldn't work very well, would it?

Lars Ivar Igesund
September 03, 2004
Lars Ivar Igesund wrote:
<snip>
> No escape sequences?

That's the whole point.

> How would it then be possible to have the string
> "JCC" (including the ") in there?
> r"My handle is "JCC""
> wouldn't work very well, would it?

Use the other notation:

`My handle is "JCC"`

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.
September 03, 2004
In article <ch9do4$1ed9$1@digitaldaemon.com>, Stewart Gordon says...
>
>Lars Ivar Igesund wrote:
><snip>
>> No escape sequences?
>
>That's the whole point.
>
>> How would it then be possible to have the string
>> "JCC" (including the ") in there?
>> r"My handle is "JCC""
>> wouldn't work very well, would it?
>
>Use the other notation:
>
>`My handle is "JCC"`

This should work, too:

"My handle is \"JCC\""

(Note the absence of the leading "r".)

>
>Stewart.
>
>-- 
>My e-mail is valid but not my primary mailbox.  Please keep replies on the 'group where everyone may benefit.

jcc7
September 06, 2004
OK, I'll try to fix that. Thanks.

You can either post here (although I don't check every day)
or email me directly.

/regards/jim


On 09/03/2004 12:51 AM, J C Calvarese wrote:
> Nick wrote:
> 
>> Or maybe I've just misunderstood what a Wysiwyg string is...
> 
> 
> I think that's the case:
> 
> From http://www.digitalmars.com/d/lex.html#stringliteral:
> 
> Wysiwyg quoted strings are enclosed by r" and ". All characters between the r" and " are part of the string except for EndOfLine which is regarded as a single \n character. There are no escape sequences inside r" ":
> 
>     r"hello"
>     r"c:\root\foo.exe"
>     r"ab\n"      string is 4 characters, 'a', 'b', '\', 'n'
> 
> 
>>
>> Nick
>>
>> In article <ch72d8$agf$1@digitaldaemon.com>, Nick says...
>>
>>> In article <ch6j4l$4q0$1@digitaldaemon.com>, Kramer says...
>>>
>>>> When using "r" for Wysiwyg strings, the text after the first Wysiwyg
>>>> string is
>>>> still highlighted as if it were part of the first string, until the
>>>> next quote.
>>>>
>>>> Example: writefln(r"c:\", r"d:\");
>>>> ^^^^^^^^^
>>>> highlighted
>>>
>>>
>>> Short answer: writefln(r"c:\\", r"d:\\");
>>>
>>> Long answer:
>>> The backslash is in many cases considered as a "literal" character,
>>> which means
>>> that the next character is to be taken literally as part of the
>>> string. For
>>> example, \" means that the character " is supposed to be part of the
>>> string. In
>>> your case the resulting string is:
>>> c:", r
>>> and then the string ends (I guess your example didn't compile?). To
>>> use an
>>> actual backslash character as part ot the string, use \\
>>>
>>> Nick
> 
> 
September 06, 2004
On 09/02/2004 01:51 PM, Stewart Gordon wrote:
> Does this mean that it highlights as C, C++ or D according to the extension, but uses the Doxygen mode specifically to highlight the comments?

Sort of. In the XML that defines the syntax for each language, there is
a definition for a Doxygen comment. If the language mode encounters one
of those forms in the source, it delegates all syntax highlighting *inside*
the special comment to the Doxygen mode. Normal comments are highlighted by
the source language mode, as are all non-comment lines.

/regards/jim
September 14, 2004
I've fixed the problem with highlighting raw strings, and also added highlighting of the /+ ... +/ comment form (with the caveat that it doesn't yet handle nested comments). I'm trying to find out if it is even possible for Jedit's syntax mode to handle nested comments.

The updated mode has been submitted to the Jedit maintainer, but if anyone wants it before the next release, just drop me an email.

/regards/jim
September 16, 2004
Nested /+ ... +/ are also now correctly highlighted. The updated mode has been submitted to jedit.

Again, if anyone wants it before the next release of JEdit, just drop me an email.

/jim
1 2
Next ›   Last »