diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-02-07 19:18:39 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-05-24 12:14:16 -0700 |
commit | 7cedafc5412857404e9a6c3450b100cb8ee4081a (patch) | |
tree | 9ec014407feccbe45190dce5fdb4f77c6203708e /src/util/spanparsing.cpp | |
parent | 90fcac365e1616779b40a69736428435df75fdf2 (diff) |
Add tr() descriptor (derivation only, no signing)
This adds a new descriptor with syntax e.g. tr(KEY,{S1,{{S2,S3},S4})
where KEY is a key expression for the internal key and S_i are
script expression for the leaves. They have to be organized in
nested {A,B} groups, with exactly two elements.
tr() only exists at the top level, and inside the script expressions
only pk() scripts are allowed for now.
Diffstat (limited to 'src/util/spanparsing.cpp')
-rw-r--r-- | src/util/spanparsing.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/spanparsing.cpp b/src/util/spanparsing.cpp index 0f68254f2c..e2e2782bec 100644 --- a/src/util/spanparsing.cpp +++ b/src/util/spanparsing.cpp @@ -34,11 +34,11 @@ Span<const char> Expr(Span<const char>& sp) int level = 0; auto it = sp.begin(); while (it != sp.end()) { - if (*it == '(') { + if (*it == '(' || *it == '{') { ++level; - } else if (level && *it == ')') { + } else if (level && (*it == ')' || *it == '}')) { --level; - } else if (level == 0 && (*it == ')' || *it == ',')) { + } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) { break; } ++it; |