This commit is contained in:
harttle
2018-09-29 16:45:11 +08:00
parent b7445f26d6
commit 5412c5a39f
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ export const integer = /-?\d+/
export const number = /-?\d+\.?\d*|\.?\d+/
export const bool = /true|false/
// peoperty access
// property access
export const identifier = /[\w-]+[?]?/
export const subscript = new RegExp(`\\[(?:${quoted.source}|[\\w-\\.]+)\\]`)
export const literal = new RegExp(`(?:${quoted.source}|${bool.source}|${number.source})`)
+1 -1
View File
@@ -109,7 +109,7 @@ const Scope = {
assert(j !== -1, `unbalanced []: ${str}`)
name = str.slice(i + 1, j)
if (!lexical.isInteger(name)) { // foo[bar] vs. foo[1]
name = this.get(name)
name = String(this.get(name))
}
push()
i = j + 1