MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / parse_syntax

Method parse_syntax

src/Chain/libraries/glua/lparsercombinator.cpp:1802–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1800 }
1801
1802 ParseResult ParserContext::parse_syntax(Input &input)
1803 {
1804 _get_parsers_having_first_token_cache.clear();
1805 auto pr = _lua_parser->tryParse(input, 0, false);
1806 bool success = pr.state() == ParserState::SUCCESS && pr.result()->next_input().pos() >= input.source()->size() && get_error().length() < 1;
1807 if (!success)
1808 {
1809 // 如果pr.state是SUCCESS,则用last_error_token,如果pr.state不是SUCCESS,则用last_match_token
1810 std::cout << this->simple_token_error() << std::endl;
1811 pr.set_state(ParserState::FAILURE);
1812 }
1813 else
1814 {
1815 pr.set_result(pr.result()->invoke_parser_post_callback());
1816 }
1817 return pr;
1818 }
1819
1820 ParserFunctor *ParserContext::union_parsers(std::vector<ParserFunctor*> &parsers)
1821 {

Calls 13

simple_token_errorMethod · 0.95
set_resultMethod · 0.80
clearMethod · 0.45
tryParseMethod · 0.45
stateMethod · 0.45
posMethod · 0.45
next_inputMethod · 0.45
resultMethod · 0.45
sizeMethod · 0.45
sourceMethod · 0.45
lengthMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected