fix: braced property access

This commit is contained in:
wyozi
2020-10-09 21:18:40 +08:00
committed by Jun Yang
parent a6126c3bea
commit 18a807ea2e
4 changed files with 24 additions and 2 deletions
+8
View File
@@ -207,6 +207,14 @@ export class Tokenizer {
const value = this.readQuoted() || this.readRange()
if (value) return value
if (this.peek() === '[') {
this.p++
const prop = this.readQuoted()
if (!prop) return
this.readTo(']')
return new PropertyAccessToken(prop, [], this.p)
}
const variable = this.readWord()
if (!variable.size()) return