MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Expr

Function Expr

src/script/parsing.cpp:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31std::span<const char> Expr(std::span<const char>& sp)
32{
33 int level = 0;
34 auto it = sp.begin();
35 while (it != sp.end()) {
36 if (*it == '(' || *it == '{') {
37 ++level;
38 } else if (level && (*it == ')' || *it == '}')) {
39 --level;
40 } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
41 break;
42 }
43 ++it;
44 }
45 std::span<const char> ret = sp.first(it - sp.begin());
46 sp = sp.subspan(it - sp.begin());
47 return ret;
48}
49
50} // namespace script

Callers 7

ParsePubkeyFunction · 0.85
ParseScriptFunction · 0.85
ParseKeyFunction · 0.85
ParseHexStrFunction · 0.85
ParseFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68