Skip to content

Commit c41fa77

Browse files
committed
bug fix: whitespace in strings would terminate string
1 parent 67fc913 commit c41fa77

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/qscript/compiler/tokengen.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ private TokenList separateTokens(string[] script){
133133
return true;
134134
}
135135
}
136+
if (token.length && ['"', '\''].hasElement(token[0])){
137+
token = token ~ c;
138+
if (c == token[0] && token[$-1] != '\\'){
139+
lastToken = token.dup;
140+
return true;
141+
}
142+
return false;
143+
}
136144
if (WHITESPACE.hasElement(c)){
137145
if (token.length > 0){
138146
lastToken = token.dup;

0 commit comments

Comments
 (0)