diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-08-22 05:17:33 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-08-22 05:17:33 +0000 |
commit | 8829c8548ea26abaf2e7d2f1d85e0b99757f1978 (patch) | |
tree | bf37b198bb698241cdfd94a2212e5245b8afa7b8 | |
parent | b78ea37a6f8d289b9adb2b5bc565716168a00060 (diff) | |
download | build-8829c8548ea26abaf2e7d2f1d85e0b99757f1978.tar.gz build-8829c8548ea26abaf2e7d2f1d85e0b99757f1978.tar.bz2 build-8829c8548ea26abaf2e7d2f1d85e0b99757f1978.tar.xz build-8829c8548ea26abaf2e7d2f1d85e0b99757f1978.zip |
Fixed the lexer to complain about invalid escape sequences in strings.
-rw-r--r-- | src/build.l | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/build.l b/src/build.l index aab7de1..20253bc 100644 --- a/src/build.l +++ b/src/build.l | |||
@@ -94,6 +94,7 @@ std::string strbuf; | |||
94 | <strdq,strsq>\\\\ strbuf += "\\"; | 94 | <strdq,strsq>\\\\ strbuf += "\\"; |
95 | <strdq,strsq>\\\" strbuf += "\""; | 95 | <strdq,strsq>\\\" strbuf += "\""; |
96 | <strdq,strsq>\\\' strbuf += "\'"; | 96 | <strdq,strsq>\\\' strbuf += "\'"; |
97 | <strdq,strsq>\\. bld.error( yylloc, "Invalid escape sequence."); | ||
97 | 98 | ||
98 | <strdq>\" { | 99 | <strdq>\" { |
99 | BEGIN( INITIAL ); | 100 | BEGIN( INITIAL ); |
@@ -110,7 +111,7 @@ std::string strbuf; | |||
110 | . { | 111 | . { |
111 | char buf[] = {"Character x is out of place"}; | 112 | char buf[] = {"Character x is out of place"}; |
112 | buf[10] = yytext[0]; | 113 | buf[10] = yytext[0]; |
113 | bld.error( yylloc, "Character !" ); | 114 | bld.error( yylloc, buf ); |
114 | } | 115 | } |
115 | 116 | ||
116 | %% | 117 | %% |