Require quotes around string values in set
This change makes it more consistent with string key values: these also
have to be quoted. It will also help me reuse the leaf_data parser for
the key values.
Change-Id: I5647403648830614d308073be6fb4f1f5469dcb2
diff --git a/src/grammars.hpp b/src/grammars.hpp
index 9f50634..2574019 100644
--- a/src/grammars.hpp
+++ b/src/grammars.hpp
@@ -254,7 +254,8 @@
auto const leaf_data_uint64_def =
uint64;
auto const leaf_data_string_def =
- *char_;
+ '\'' >> *(char_-'\'') >> '\'' |
+ '\"' >> *(char_-'\"') >> '\"';
// This intermediate rule is neccessary for coercing to std::string.
auto const leaf_data_binary_data_def =
diff --git a/src/utils.cpp b/src/utils.cpp
index cd0858f..d0e8639 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -67,6 +67,8 @@
return "an identity";
case yang::LeafDataTypes::LeafRef:
return "a leafref";
+ case yang::LeafDataTypes::Binary:
+ return "a base64-encoded binary value";
default:
throw std::runtime_error("leafDataTypeToString: unsupported leaf data type");
}