Skip to content

Commit 6fa2586

Browse files
committed
support for single quote strings
1 parent bf77575 commit 6fa2586

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

implementation/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern FILE* yyin;
3434
extern bool prediction_task;
3535

3636
std::string usage_str = "ERROR: usage: FastLAS file_name";
37-
std::string version_info = R"ESC(FastLAS version 1.0.1.
37+
std::string version_info = R"ESC(FastLAS version 1.0.4.
3838
3939
For updates and information on FastLAS, please see https://spike-imperial.github.io/FastLAS/.)ESC";
4040

implementation/tokens.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
yylval.string = new std::string(yylval.string->substr(1, yylval.string->length() - 2));
8484
return T_STRING;
8585
}
86+
\'([^\'\\]|\\.)*\' {
87+
yylval.string = new std::string(yytext, yyleng);
88+
yylval.string = new std::string(yylval.string->substr(1, yylval.string->length() - 2));
89+
return T_STRING;
90+
}
8691
. std::cerr << "Unknown token: '" << yytext << "'" << std::endl; exit(1);
8792

8893
%%

0 commit comments

Comments
 (0)