Scintilla Lexer for D
Waldemar
waldemar at wa-ba.com
Wed Dec 13 15:10:03 PST 2006
== Quote from Hasan Aljudy (hasan.aljudy at gmail.com)'s article
> 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)
There was a lengthy exchange on the subject in the archives. I concluded D lexer
needs its own qualifiers. This will allow to extend beyond ascii. I am curious
what gdc allows. Probably the best is to lift code from the compiler itself if
reasonably contained.
More information about the Digitalmars-d
mailing list