www.digitalmars.com         C & C++   DMDScript  

D - D lexer for CodeWright

reply "Christian Kaiser" <chk online.de> writes:
My first try: Add the following section to LEXER.INI in the CW directory:

[ChromaLexer-D]
ChromaFlags=CHROMA_CF_MAIN,0x02000001,1
ChromaFlags=CHROMA_CF_STRING,0x00000000,1
ChromaFlags=CHROMA_CF_STR_ESC_CHARS,0x005c0000,1
ChromaIdentifiers='_A-Za-z _A-Za-z0-9'
ChromaBraceChars='{}'
ChromaAddComment=0x00001000,0,'//',''
ChromaAddComment=0x00002000,0,'/+','+/'
ChromaAddComment=0x00002000,0,'/*','*/'
ChromaAddWords=CHROMA_WT_KEYWORD abstract alias align asm assert auto bit
body break byte case cast catch cdouble cent cfloat
ChromaAddWords=CHROMA_WT_KEYWORD char class const continue creal dchar debug
default delegate delete deprecated do double else enum export
ChromaAddWords=CHROMA_WT_KEYWORD extern false final finally float for
function goto idouble if ifloat import in inout int interface
ChromaAddWords=CHROMA_WT_KEYWORD invariant ireal long new null out override
private protected public real return short static struct super
ChromaAddWords=CHROMA_WT_KEYWORD switch synchronized this throw true try
typedef ubyte ucent uint ulong union ushort version void volatile
ChromaAddWords=CHROMA_WT_KEYWORD wchar while with
ChromaAddWords=CHROMA_WT_OPERATOR ! 0 !< 0 !<= 0 !<> 0 !<>= 0 != 0 !== 0 !>
0 !>= 0 $ 0 % 0 %= 0 & 0 && 0 &= 0 ( 1
ChromaAddWords=CHROMA_WT_OPERATOR ) 1 * 0 *= 0 + 0 ++ 0 += 0 , 1 - 0 -- 0 -=
0 . 1 .. 1 ... 1 / 0 /= 0 : 0
ChromaAddWords=CHROMA_WT_OPERATOR ; 0 < 0 << 0 <<= 0 <= 0 <> 0 <>= 0 = 0 ==
0 === 0 > 0 >= 0 >> 0 >>= 0 >>> 0 >>>= 0
ChromaAddWords=CHROMA_WT_OPERATOR ? 0 [ 0 ] 0 ^ 0 ^= 0 { 1 | 0 |= 0 || 0 } 1
~ 0 ~= 0
ChromaSetWordRegex=CHROMA_WT_PREPROC,'__[a-z]+','',0xf
ChromaSetWordRegex=CHROMA_WT_STRING,'(`.*`|[rx]?\"((\\\\\")|[^\"])*\"|\\\x[0
-9A-Z][0-9A-Z]([0-9A-Z][0-9A-Z])?)','',0x3

It may neither be complete nor flawless, but for my first tests it works :)

Christian
Oct 05 2003
parent reply Helmut Leitner <leitner hls.via.at> writes:
Christian Kaiser wrote:
 
 My first try: Add the following section to LEXER.INI in the CW directory:
 

added to: <http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport> -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Oct 06 2003
parent reply "Nicolas Repiquet" <deadcow-remove-this free.fr> writes:
Can you add the PSPad Syntax file for D I've done ?

ps: you can grab pspad on http://www.pspad.com/

-- Nicolas Repiquet
Oct 06 2003
parent reply Helmut Leitner <leitner hls.via.at> writes:
Nicolas Repiquet wrote:
 
 Can you add the PSPad Syntax file for D I've done ?
 
 ps: you can grab pspad on http://www.pspad.com/
 
 -- Nicolas Repiquet
 
             Name: D.INI
    D.INI    Type: Konfigurationseinstellungen
(application/x-unknown-content-type-inifile)
         Encoding: x-uuencode

It's a pleasure. BTW you can add or maintain the information at the wiki just by clicking "Edit" on each page. In which directory must the file be installed? Is case significant or is "d.ini" just as good? -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Oct 06 2003
parent "Nicolas Repiquet" <deadcow-remove-this free.fr> writes:
"Helmut Leitner" <leitner hls.via.at> a écrit dans le message news:
3F818D9C.E3DF8CC5 hls.via.at...

 It's a pleasure. BTW you can add or maintain the information at the wiki
 just by clicking "Edit" on each page.

True, sorry.
 In which directory must the file be installed?

In the "syntax" directory.
 Is case significant or is "d.ini" just as good?

Since windows' file system is case insensitive, the both are probably correct. -- Nicolas Repiquet
Oct 07 2003