diff --git a/hcore/deviceManager/deviceSpecl.ll b/hcore/deviceManager/deviceSpecl.ll index 376b7cc..2a20642 100644 --- a/hcore/deviceManager/deviceSpecl.ll +++ b/hcore/deviceManager/deviceSpecl.ll @@ -2,6 +2,8 @@ %option nounput %{ #include +#include +#include #include #include "deviceSpecp.hh" %} @@ -24,7 +26,12 @@ "(" { return LPAREN; } ")" { return RPAREN; } [ \t]*"="[ \t]* { return EQUALS; } // Allow optional whitespace around equals -[^=\|\(\) \t\r\n]+ { deviceSpecplval.str = strdup(yytext); return STRING; } // Exclude = from STRING tokens +([^=\|\(\) \t\r\n]|\\[ \t])+ { + std::string token(yytext); + token.erase(std::remove(token.begin(), token.end(), '\\'), token.end()); + deviceSpecplval.str = strdup(token.c_str()); + return STRING; +} \r?\n { /* ignore newlines */ } [ \t]+ { /* ignore whitespace */ } . { return yytext[0]; }