--- cfg_syn_scan.l 2004/12/31 19:16:25 1.24
+++ cfg_syn_scan.l 2006/08/01 20:13:49 1.25
@@ -121,7 +121,7 @@
}
<SS_CO_C><<EOF>> {
cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated C-style block comment");
- return 0;
+ yyterminate();
}
/* C++-style EOL comment */
@@ -152,17 +152,17 @@
(void)sscanf(yytext+1, "%o", &result);
if (result > 0xff) {
cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "escape sequence out of bound");
- return 0;
+ yyterminate();
}
cfg_buf_append(CTX->buf, NULL, 0, (char)result);
}
<SS_DQ>\\x\{[0-9a-fA-F]+\} {
if (!hex_sequence(CTX, yytext+3, yyleng-3-1))
- return 0;
+ yyterminate();
}
<SS_DQ>\\x[0-9a-fA-F]{2} {
if (!hex_sequence(CTX, yytext+2, 2))
- return 0;
+ yyterminate();
}
<SS_DQ>\\n { cfg_buf_append(CTX->buf, NULL, 0, '\n'); }
<SS_DQ>\\r { cfg_buf_append(CTX->buf, NULL, 0, '\r'); }
@@ -178,11 +178,11 @@
cfg_buf_append(CTX->buf, yytext, yyleng, 0);
}
<SS_DQ>(.|\n) {
- cfg_buf_append(CTX->buf, NULL, 0, yytext[1]);
+ cfg_buf_append(CTX->buf, NULL, 0, yytext[0]);
}
<SS_DQ><<EOF>> {
cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated double-quoted string");
- return 0;
+ yyterminate();
}
/* single-quoted word ('...') */
@@ -208,11 +208,11 @@
cfg_buf_append(CTX->buf, yytext, yyleng, 0);
}
<SS_SQ>(.|\n) {
- cfg_buf_append(CTX->buf, NULL, 0, yytext[1]);
+ cfg_buf_append(CTX->buf, NULL, 0, yytext[0]);
}
<SS_SQ><<EOF>> {
cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated single-quoted string");
- return 0;
+ yyterminate();
}
/* flexible-quoted word (q(.)[^\1]\1) */
@@ -252,7 +252,7 @@
}
<SS_FQ><<EOF>> {
cfg_syn_error(CTX, CFG_ERR_SYN, yylloc, "unterminated flexible-quoted string");
- return 0;
+ yyterminate();
}
/* special tokens */
|