DMD 1.021 and 2.004 releases

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Tue Sep 11 05:17:57 PDT 2007


Kirk McDonald wrote:

> Walter Bright wrote:
>> Stewart Gordon wrote:
>> 
>>> Maybe.  But still, nested comments are probably likely to be supported
>>> by more code editors than such an unusual feature as delimited strings.
>> 
>> 
>> Delimited strings are standard practice in Perl. C++0x is getting
>> delimited strings. Code editors that can't handle them are going to
>> become rapidly obsolete.
>> 
>> The more unusual feature is the token delimited strings.
> 
> Which, since there's no nesting going on, are actually very easy to
> match. The Pygments lexer matches them with the following regex:
> 
> q"([a-zA-Z_]\w*)\n.*?\n\1"

It's great to see Pygments handles so many possible syntaxes. Unfortunately
backreferences are not part of regular expressions. I've noticed two kinds
of problems in tools:

a) some can't handle backreferences, but provide support for nested comments
as a special case. So comments are no problem then, but all delimited
strings are.

b) some lexers handles both nested comments and delimited strings, but all
delimiters must be enumerated in the language definition. Even worse, some
highlighters only handle delimited comments, not strings.

Maybe the new features (= one saves on average < 5 characters of typing per
string) are more important than tool support? Maybe all tools should be
rewritten in Python & Pygments?



More information about the Digitalmars-d-announce mailing list