aboutsummaryrefslogtreecommitdiff
path: root/cibic.l
diff options
context:
space:
mode:
Diffstat (limited to 'cibic.l')
-rw-r--r--cibic.l10
1 files changed, 9 insertions, 1 deletions
diff --git a/cibic.l b/cibic.l
index 37de015..666069e 100644
--- a/cibic.l
+++ b/cibic.l
@@ -4,7 +4,7 @@
letter [a-zA-Z_$]
digit [0-9]
-%s IN_BLOCK_COMMENT IN_INLINE_COMMENT
+%s IN_BLOCK_COMMENT IN_INLINE_COMMENT IN_DIRECTIVE
%%
<INITIAL>{
@@ -25,6 +25,14 @@ digit [0-9]
[^\n]+
}
+<INITIAL>{
+"#" BEGIN(IN_INLINE_COMMENT);
+}
+<IN_DIRECTIVE>{
+\n BEGIN(INITIAL);
+[^\n]+
+}
+
"void" { return KW_VOID; }
"char" { return KW_CHAR; }
"int" { return KW_INT; }