diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | parser/vyos1x_parser.mly | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 8cf37d0..6bb978d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libvyosconfig0 (0.0.8) unstable; urgency=medium + + * Allow configs to end with leaf nodes. + + -- Daniil Baturin <daniil@baturin.org> Sun, 17 Mar 2019 21:31:31 +0100 + libvyosconfig0 (0.0.7) unstable; urgency=medium * Add a function for copying nodes. diff --git a/parser/vyos1x_parser.mly b/parser/vyos1x_parser.mly index 17f4909..707538d 100644 --- a/parser/vyos1x_parser.mly +++ b/parser/vyos1x_parser.mly @@ -45,15 +45,21 @@ value: ; -leaf_node: +leaf_node_body: | comment = comments; - name = IDENTIFIER; value = value; NEWLINE; + name = IDENTIFIER; value = value; { Vytree.make_full {default_data with values=[value]; comment=comment} name []} | comment = comments; - name = IDENTIFIER; NEWLINE (* valueless node *) + name = IDENTIFIER; (* valueless node *) { Vytree.make_full {default_data with comment=comment} name [] } ; +leaf_node: + | n = leaf_node_body; NEWLINE; + { n } + | n = leaf_node_body; EOF; + { n } + node: | comment = comments; name = IDENTIFIER; LEFT_BRACE; children = list(node_content); RIGHT_BRACE; |