summaryrefslogtreecommitdiff
path: root/3rdparty/libconfig/extra/gen
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-10-05 07:01:54 +0200
committerHaru <haru@dotalux.com>2013-10-05 07:01:54 +0200
commit62c5e65d28833c1068d195778c0e3a710acaa104 (patch)
treea8f19710375f669530d5640a14c1e3575dad32a0 /3rdparty/libconfig/extra/gen
parentdedec165eaeb0d291279b1d5b53fac242bcf7b4c (diff)
downloadhercules-62c5e65d28833c1068d195778c0e3a710acaa104.tar.gz
hercules-62c5e65d28833c1068d195778c0e3a710acaa104.tar.bz2
hercules-62c5e65d28833c1068d195778c0e3a710acaa104.tar.xz
hercules-62c5e65d28833c1068d195778c0e3a710acaa104.zip
Added support for trailing commas within libconfig arrays
- A trailing comma in conf/plugins.conf will no longer cause a parse error. This makes it easier to comment out plugins to disable them. - conf/plugins.conf has been updated to reflect this change. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to '3rdparty/libconfig/extra/gen')
-rw-r--r--3rdparty/libconfig/extra/gen/grammar.y13
1 files changed, 11 insertions, 2 deletions
diff --git a/3rdparty/libconfig/extra/gen/grammar.y b/3rdparty/libconfig/extra/gen/grammar.y
index f578897cb..576241c01 100644
--- a/3rdparty/libconfig/extra/gen/grammar.y
+++ b/3rdparty/libconfig/extra/gen/grammar.y
@@ -118,6 +118,11 @@ setting_terminator:
| TOK_COMMA
;
+comma_optional:
+ /* empty */
+ | TOK_COMMA
+ ;
+
setting:
TOK_NAME
{
@@ -359,9 +364,13 @@ value_list_optional:
| value_list
;
-simple_value_list:
+simple_value_list_sub:
simple_value
- | simple_value_list TOK_COMMA simple_value
+ | simple_value_list_sub TOK_COMMA simple_value
+ ;
+
+simple_value_list:
+ simple_value_list_sub comma_optional
;
simple_value_list_optional: