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:
@@ -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{}{
|
||||
|
||||
Reference in New Issue
Block a user