Skip to content

Commit

Permalink
Correctly tokenize quotation marks within single token
Browse files Browse the repository at this point in the history
  • Loading branch information
wyozi authored and harttle committed Aug 8, 2019
1 parent af841dc commit 9956c53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/template/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ export default class Value {
tokens.push(str[i++])
} else {
const j = i++
for (; i < str.length && !/[|,:\s]/.test(str[i]); ++i);
let ch
for (; i < str.length && !/[|,:\s]/.test(ch = str[i]); ++i) {
if (ch === '"' || ch === "'") {
for (i += 2; i < str.length && str[i - 1] !== ch; ++i);
}
}
tokens.push(str.slice(j, i))
}
}
Expand Down

0 comments on commit 9956c53

Please sign in to comment.