Scintilla Lexer for D

Hasan Aljudy hasan.aljudy at gmail.com
Wed Dec 13 12:11:17 PST 2006



jcc7 wrote:
> Waldemar Wrote:
> 
>> Folks FYI,
>>
>> Scintilla now has a lexer for D.  At the moment it is available only via CVS
>> but should appear in the next release.  This will make all scintilla-based
>> editors and IDEs capable of supporting D very easily.
> 
> Sounds great! Thanks for doing this.
> 
> I took a glance at the source (I think I found the right file):
> http://scintilla.cvs.sourceforge.net/scintilla/scintilla/src/LexD.cxx?revision=1.1&view=markup
> 
> It looks like you've even managed to support nested comments. That's fantastic!
> 
> Do you have any idea how often the Scintilla team releases new versions? I can't wait to try this out. ;)
> 
> jcc7

    30 // We use custom qualifiers since it is not clear what D allows.
    31
    32 static bool IsWordStart(int ch) {
    33 	return isascii(ch) && (isalpha(ch) || ch == '_');
    34 }
    35
    36 static bool IsWord(int ch) {
    37 	return isascii(ch) && (isalnum(ch) || ch == '_');
    38 }

I think D allows unicode alphas in identifiers.
See std.uni.isUniAlpha(dchar u);
http://digimars.com/d/phobos/std_uni.html

There's a C version in the dmd front end source. (unialpha.c)



More information about the Digitalmars-d mailing list