X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/1656cfade4879af0cb003e3847e58264caa5781f..5b42e9400440d86723a27747b2191ab8cd59c2ee:/src/lexer.l diff --git a/src/lexer.l b/src/lexer.l index 68bafd0..14f6990 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -24,6 +24,7 @@ #include #include +#include "tree.h" #include "parse.h" #include "main.h" #include "util.h" @@ -201,6 +202,23 @@ add_gtk_doc_func(void) if(before_comment == C_CODE) add_to_cbuf(yytext); } +^\%(a|all)\{ { + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = ACODE; + clear_cbuf(); + ccode_line = line_no; + } +^\%(at|alltop)\{ { + BEGIN(C_CODE); + parenth_depth = 1; + class_after_c = FALSE; + code_type = ATCODE; + clear_cbuf(); + ccode_line = line_no; + } + ^\%(ht|headertop)\{ { BEGIN(C_CODE); parenth_depth = 1; @@ -364,7 +382,13 @@ class { yylval.id = g_strdup(yytext); return NUMBER; } -:?[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)+ { +[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)+ { + /* this one is for a classname with a namespace */ + yylval.id = g_strdup(yytext); + return TYPETOKEN; + } +:[A-Za-z_][A-Za-z0-9_]*(:[A-Za-z0-9_]*)* { + /* this is for a classname with an empty namespace */ yylval.id = g_strdup(yytext); return TYPETOKEN; }