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


begin 666 D.INI
M.U!34&%D($AI9VA,:6=H=&5R(&1E9FEN:71I;VX 9FEL92!F;W( 1 T*.R!H
M='1P.B\O=W=W+F1I9VET86QM87)S+F-O;2]D+PT*6U-E='1I;F=S70T*3F%M

M/0T*04Y324-O;6UE;G0], T*4&%S0V]M;65N=#TP
M,0T*0T-O;6UE;G0],0T*4W!E8T-O;6UE;G0], T*0F%S0V]M;65N=#TP

M;VUM96YT/3 -"E-H87)P0V]M;65N=#TP
M0V5N=$-O;6UE;G0], T*4VEN9VQ10V]M;65N=#TP



M8G-T<F%C=#T-

M=#T-

M=#T-







M"G=H:6QE/0T*=VET:#T-"EM297-E<G9E9%=O<F1S70T*861D/0T*861D87-S
M/0T*86YD/0T*86YD87-S/0T*8FET/0T*8GET93T-"F-A=#T-"F-A=%]R/0T*



M<F5A;#T-
M;&%S<ST-"D]B:F5C=#T-"F]P0V%L;#T-




-<CT-"GAO<F%S<ST-" ``
`
end
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