@@ -156,9 +156,9 @@ public static { bool isSpace (dchar c) { return std.ctype.isspace(c)!=0; } bool isSymbol (dchar c) { return 0x21<=c && c<=0x7f && !std.ctype.isalnum(c) && c!='_' && c!='\''; } bool isSSymbol (dchar c) { return !find("()[]{};", c).empty; } - bool isMSymbol (dchar c) { return isSymbol(c) && !isSSymbol(c); } + bool isMSymbol (dchar c) { return isSymbol(c) && !isSSymbol(c) && c!='"' && c!='#'; } bool isLetter (dchar c) { return !isSpace(c) && !isSymbol(c); } } string readQuoted(const LexPosition pos){char[] buf; return readQuoted(pos,buf);} @@ -352,8 +352,16 @@ assert( lex2.empty ); assert( !lex3.empty ); assert_eq( lex3.front.str, "5" ); } + +unittest +{ + auto lex = lexerFromString(`=""`); + assert_eq(lex.front.str, "="); lex.popFront; + assert_eq(lex.front.str, ""); lex.popFront; + assert( lex.empty ); +} /// Forward range for reader character by character, /// keeping track of position information and caring \r\n -> \n conversion.