diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-03-17 21:30:56 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-03-17 21:32:19 +0100 |
commit | 9a80a5d3c652746f5e51d38aea1cf49f8a1949e4 (patch) | |
tree | e752fbb67f4c9b70b79ff02c8e4d70101d27e008 | |
parent | 6b7b7ed091900399043d33f5d83ea16b6b4d6a67 (diff) | |
download | libvyosconfig-9a80a5d3c652746f5e51d38aea1cf49f8a1949e4.tar.gz libvyosconfig-9a80a5d3c652746f5e51d38aea1cf49f8a1949e4.zip |
T1305: allow configs to end with a leaf node.
-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; |