Check-in Number:
|
2242 | |
Date: |
2002-Jul-05 17:11:20 (local)
2002-Jul-05 15:11:20 (UTC) |
User: | rse |
Branch: | |
Comment: |
fix q(..) construct for q|..| situation, i.e., open and close chars the same |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/cfg/cfg_syn_scan.l 1.2 -> 1.3
--- cfg_syn_scan.l 2002/07/05 14:33:10 1.2
+++ cfg_syn_scan.l 2002/07/05 15:11:20 1.3
@@ -206,19 +206,20 @@
*cpStr++ = *cp++;
}
<SS_FQ>(.|\n) {
- if (yytext[0] == cQuoteOpen)
- nQuoteOpen++;
- else if (yytext[0] == cQuoteClose)
- nQuoteOpen--;
+ if (yytext[0] == cQuoteOpen || yytext[0] == cQuoteClose) {
+ if (cQuoteOpen != cQuoteClose)
+ nQuoteOpen += (yytext[0] == cQuoteOpen ? 1 : -1);
+ else
+ nQuoteOpen = ((nQuoteOpen + 1) % 2);
+ }
if (yytext[0] == cQuoteClose && nQuoteOpen == 0) {
*cpStr = '\0';
yylval->cpString = strdup(caStr);
BEGIN(INITIAL);
return T_STRING;
}
- else {
+ else
*cpStr++ = yytext[0];
- }
}
/* special tokens */
@@ -286,7 +287,6 @@
{ '{', '}' },
{ '{', ']' },
{ '<', '>' },
- { '`', '\'' },
};
int i;
|
|