MCPcopy Create free account
hub / github.com/covscript/covscript / kill_expr

Method kill_expr

sources/compiler/parser.cpp:328–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326 }
327
328 void compiler_type::kill_expr(std::deque<token_base *> &tokens)
329 {
330 std::deque<token_base *> oldt, expr;
331 std::swap(tokens, oldt);
332 tokens.clear();
333 for (auto &ptr : oldt) {
334 if (ptr->get_type() == token_types::action || ptr->get_type() == token_types::endline) {
335 if (!expr.empty()) {
336 tree_type<token_base *> tree;
337 gen_tree(tree, expr);
338 tokens.push_back(new token_expr(tree));
339 expr.clear();
340 }
341 tokens.push_back(ptr);
342 }
343 else
344 expr.push_back(ptr);
345 }
346 }
347} // namespace cs

Callers

nothing calls this directly

Calls 4

swapFunction · 0.50
clearMethod · 0.45
get_typeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected