Make lexComment jump back to the previous state (#122)

When a comment appears in an rvalue, the lexer needs to jump back to
lexRValue, not to lexVoid.

Fixes #120.
This commit is contained in:
Thomas Pelletier
2016-12-29 19:51:04 +01:00
committed by GitHub
parent 017119f7a7
commit 439fbba1f8
3 changed files with 40 additions and 9 deletions
+11
View File
@@ -283,6 +283,17 @@ func TestArrayNested(t *testing.T) {
})
}
func TestNestedArrayComment(t *testing.T) {
tree, err := Load(`
someArray = [
# does not work
["entry1"]
]`)
assertTree(t, tree, err, map[string]interface{}{
"someArray": [][]string{{"entry1"}},
})
}
func TestNestedEmptyArrays(t *testing.T) {
tree, err := Load("a = [[[]]]")
assertTree(t, tree, err, map[string]interface{}{