MCPcopy Create free account
hub / github.com/argotorg/solidity / parseAndReturnFirstError

Function parseAndReturnFirstError

test/libyul/ObjectParser.cpp:57–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55{
56
57std::optional<Error> parseAndReturnFirstError(std::string const& _source, bool _allowWarningsAndInfos = true)
58{
59 YulStack yulStack = parseYul(_source, "source", OptimiserSettings::none());
60 if (!yulStack.hasErrorsWarningsOrInfos() || (!yulStack.hasErrors() && _allowWarningsAndInfos))
61 return {};
62
63 BOOST_REQUIRE_EQUAL(yulStack.errors().size(), 1);
64 return *yulStack.errors().front();
65}
66
67bool successParse(std::string const& _source, bool _allowWarningsAndInfos = true)
68{

Callers 2

successParseFunction · 0.70
expectErrorFunction · 0.70

Calls 3

hasErrorsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected