aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <[email protected]>2014-03-25 22:05:01 +0800
committerTeddy <[email protected]>2014-03-25 22:05:01 +0800
commit2883565cc927fcc3de2297ed69500b8c59a4f625 (patch)
tree59c653165f619af8c55c463eab9a60aa13ebded0
parent979c69aff285a9a5a0c564d54410c81ed278af92 (diff)
...
-rw-r--r--cibic.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/cibic.l b/cibic.l
index 84b3239..e857046 100644
--- a/cibic.l
+++ b/cibic.l
@@ -11,7 +11,7 @@ int yycolumn = 1;
letter [a-zA-Z_$]
digit [0-9]
string ((\\.|[^\n\"\\])*)
-char ([^'\\]|\\.|\\[0-7]+|\\[xX][0-9a-fA-F]+)
+char ([^\n'\\]|\\.|\\[0-7]+|\\[xX][0-9a-fA-F]+)
%s IN_BLOCK_COMMENT IN_INLINE_COMMENT IN_DIRECTIVE
%option yylineno
@@ -80,7 +80,7 @@ char ([^'\\]|\\.|\\[0-7]+|\\[xX][0-9a-fA-F]+)
return CHAR_CONST;
}
-'{char} {
+'{char}? {
yyerror("missing terminating ' character\n");
exit(1);
}
@@ -90,7 +90,7 @@ char ([^'\\]|\\.|\\[0-7]+|\\[xX][0-9a-fA-F]+)
return STR_CONST;
}
-\"{string} {
+\"{string}? {
yyerror("missing terminating \" character\n");
exit(1);
}