mirror of
https://github.com/djcb/mu.git
synced 2024-06-26 07:29:17 +02:00
utils/sexp: add a bit more convenience
This commit is contained in:
parent
ee99176fce
commit
2f8850ea86
|
@ -90,12 +90,15 @@ struct Node {
|
||||||
|
|
||||||
if (name.empty() || name[0] != ':')
|
if (name.empty() || name[0] != ':')
|
||||||
throw Error{Error::Code::InvalidArgument,
|
throw Error{Error::Code::InvalidArgument,
|
||||||
"property names must start with ':'"};
|
"property names must start with ':' ('%s')",
|
||||||
|
name.c_str()};
|
||||||
|
|
||||||
add(make_symbol(std::move(name)));
|
add(make_symbol(std::move(name)));
|
||||||
add(std::move(val));
|
add(std::move(val));
|
||||||
}
|
}
|
||||||
|
void add_prop(std::string&& name, const std::string& val) {
|
||||||
|
add_prop(std::move(name), std::string(val));
|
||||||
|
}
|
||||||
|
|
||||||
// deliberately limited stl-like
|
// deliberately limited stl-like
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user