This website works better with JavaScript.
Home
Explore
Help
Sign In
brettlangdon
/
forge
mirror of
https://github.com/brettlangdon/forge.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Projects
0
Releases
12
Wiki
Activity
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
0b2bf8e484
12d49acb7f
commit
619cc32bcf
3 changed files
with
15 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
forge_test.go
+1
-0
parser.go
+7
-0
test.cfg
+ 7
- 0
forge_test.go
View File
@ -42,6 +42,13 @@ primary {
key
=
"primary sub key value"
;
key
=
"primary sub key value"
;
include
"./test_include.cfg"
;
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
{
secondary
{
+ 1
- 0
parser.go
View File
@ -193,6 +193,7 @@ func (parser *Parser) parseSettingValue() (Value, error) {
}
}
value
=
NewList
(
)
value
=
NewList
(
)
value
.
UpdateValue
(
listVal
)
value
.
UpdateValue
(
listVal
)
readNext
=
false
default
:
default
:
return
value
,
parser
.
syntaxError
(
return
value
,
parser
.
syntaxError
(
fmt
.
Sprintf
(
"expected STRING, INTEGER, FLOAT, BOOLEAN or IDENTIFIER, instead found %s"
,
parser
.
curTok
.
ID
)
,
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";
key
=
"primary sub key value";
include "./test_include.cfg";
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 {
secondary {
Write
Preview
Loading…
Cancel
Save