fix: correctly understand variables with question marks

Fixes #77
This commit is contained in:
Ryan Kennedy
2018-07-18 10:15:43 +08:00
committed by Jun Yang
parent 6755462056
commit c79700ef1a
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ var number = /-?\d+\.?\d*|\.?\d+/
var bool = /true|false/
// peoperty access
var identifier = /[\w-]+/
var identifier = /[\w-]+[?]?/
var subscript = new RegExp(`\\[(?:${quoted.source}|[\\w-\\.]+)\\]`)
var literal = new RegExp(`(?:${quoted.source}|${bool.source}|${number.source})`)
var variable = new RegExp(`${identifier.source}(?:\\.${identifier.source}|${subscript.source})*`)