cn2im: basic C++ support

This commit is contained in:
Araq 2013-09-10 00:40:06 +02:00
commit db19b18241
8 changed files with 720 additions and 55 deletions

View file

@ -82,6 +82,8 @@ type
pxParLe, pxBracketLe, pxCurlyLe, # this order is important
pxParRi, pxBracketRi, pxCurlyRi, # for macro argument parsing!
pxComma, pxSemiColon, pxColon,
pxAngleRi # '>' but determined to be the end of a
# template's angle bracket
TTokKinds* = set[TTokKind]
type
@ -202,6 +204,7 @@ proc TokKindToStr*(k: TTokKind): string =
of pxColon: result = ":"
of pxCurlyLe: result = "{"
of pxCurlyRi: result = "}"
of pxAngleRi: result = "> [end of template]"
proc `$`(tok: TToken): string =
case tok.xkind