MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / parseOp

Function parseOp

sample/Terminate.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10};
11
12Op parseOp(char t)
13{
14 using namespace matchit;
15 Id<char> token;
16 return match(t)(
17 pattern | '+' = expr(Op::Add), pattern | '-' = expr(Op::Sub),
18 pattern | '*' = expr(Op::Mul), pattern | '/' = expr(Op::Div),
19 pattern | token = [&]
20 {
21 std::cerr << "Unexpected: " << *token;
22 std::terminate();
23 return Op::Add;
24 });
25}
26
27int32_t main()
28{

Callers 1

mainFunction · 0.85

Calls 2

matchFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected