Skip to content
Snippets Groups Projects
Unverified Commit 43f4ec85 authored by Nora Abi Akar's avatar Nora Abi Akar Committed by GitHub
Browse files

Add `on-components` to s-expression locset parser (#1436)

* Add on-components to label_parse.cpp, and to corresponding unit test.
parent 6f8e6f52
No related branches found
No related tags found
No related merge requests found
......@@ -246,6 +246,8 @@ std::unordered_multimap<std::string, evaluator> eval_map {
"'uniform' with 4 arguments: (reg:region, first:int, last:int, seed:int)")},
{"on-branches",make_call<double>(arb::ls::on_branches,
"'on-branches' with 1 argument: (pos:double)")},
{"on-components",make_call<double, arb::region>(arb::ls::on_components,
"'on-components' with 2 arguments: (pos:double, reg:region)")},
{"locset", make_call<std::string>(arb::ls::named,
"'locset' with 1 argument: (name:string)")},
{"restrict", make_call<arb::locset, arb::region>(arb::ls::restrict,
......
......@@ -392,7 +392,7 @@ mlocation_list thingify_(const on_components_& n, const mprovider& p) {
}
std::ostream& operator<<(std::ostream& o, const on_components_& x) {
return o << "(on_components " << x.relpos << " " << x.reg << ")";
return o << "(on-components " << x.relpos << " " << x.reg << ")";
}
// Uniform locset.
......
......@@ -136,6 +136,7 @@ TEST(regloc, round_tripping) {
"(proximal (join (tag 1) (tag 2)))",
"(uniform (tag 1) 0 100 52)",
"(restrict (terminal) (tag 12))",
"(on-components 0.3 (segment 2))",
"(join (terminal) (root))",
"(sum (terminal) (root))",
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment