Browse Source

Merge pull request #30 from brettlangdon/bug/fix.array.semicolon.sqwished

Fix bug: syntax error with list with no ending semicolon
pull/33/head
Brett Langdon 10 years ago
parent
commit
619cc32bcf
3 changed files with 15 additions and 0 deletions
  1. +7
    -0
      forge_test.go
  2. +1
    -0
      parser.go
  3. +7
    -0
      test.cfg

+ 7
- 0
forge_test.go View File

@ -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 {


+ 1
- 0
parser.go View File

@ -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),


+ 7
- 0
test.cfg View File

@ -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 {


Loading…
Cancel
Save