diff --git a/forge_test.go b/forge_test.go index 1d8a3a7..143f9cc 100644 --- a/forge_test.go +++ b/forge_test.go @@ -42,6 +42,13 @@ primary { key = "primary sub key value"; include "./test_include.cfg"; } + + sub_section { + # Testing of a special case that had previous caused failures + # Was caused by an array with no ending semicolon, followed directly by another setting + nested_array_no_semi_colon = ["a", "b"] + another = true + } } secondary { diff --git a/parser.go b/parser.go index fbf800f..08609e7 100644 --- a/parser.go +++ b/parser.go @@ -193,6 +193,7 @@ func (parser *Parser) parseSettingValue() (Value, error) { } value = NewList() value.UpdateValue(listVal) + readNext = false default: return value, parser.syntaxError( fmt.Sprintf("expected STRING, INTEGER, FLOAT, BOOLEAN or IDENTIFIER, instead found %s", parser.curTok.ID), diff --git a/test.cfg b/test.cfg index 1c6b94e..94a2e3a 100644 --- a/test.cfg +++ b/test.cfg @@ -31,6 +31,13 @@ primary { key = "primary sub key value"; include "./test_include.cfg"; } + + sub_section { + # Testing of a special case that had previous caused failures + # Was caused by an array with no ending semicolon, followed directly by another setting + nested_array_no_semi_colon = ["a", "b"] + another = true + } } secondary {