aboutsummaryrefslogtreecommitdiffstats
path: root/test/libjulia/Common.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-28 22:00:23 +0800
committerchriseth <chris@ethereum.org>2017-12-05 19:09:55 +0800
commit30d7afc2e3fd27333e463a9127011ec1f7470d3e (patch)
tree8ce2d4115ec56f61770f8dfea3383a437e89c010 /test/libjulia/Common.cpp
parentcba58629d24404ed7553d16bb2ad064f95f9fe37 (diff)
downloaddexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.gz
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.bz2
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.lz
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.xz
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.tar.zst
dexon-solidity-30d7afc2e3fd27333e463a9127011ec1f7470d3e.zip
Simplify disambiguator.
Diffstat (limited to 'test/libjulia/Common.cpp')
-rw-r--r--test/libjulia/Common.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/test/libjulia/Common.cpp b/test/libjulia/Common.cpp
index 30bb22ea..da1538f3 100644
--- a/test/libjulia/Common.cpp
+++ b/test/libjulia/Common.cpp
@@ -55,12 +55,12 @@ pair<shared_ptr<Block>, shared_ptr<assembly::AsmAnalysisInfo>> dev::julia::test:
ErrorList errors;
ErrorReporter errorReporter(errors);
auto scanner = make_shared<Scanner>(CharStream(_source), "");
- auto parserResult = assembly::Parser(errorReporter, true).parse(scanner);
+ auto parserResult = assembly::Parser(errorReporter, _julia).parse(scanner);
if (parserResult)
{
BOOST_REQUIRE(errorReporter.errors().empty());
auto analysisInfo = make_shared<assembly::AsmAnalysisInfo>();
- assembly::AsmAnalyzer analyzer(*analysisInfo, errorReporter, true);
+ assembly::AsmAnalyzer analyzer(*analysisInfo, errorReporter, _julia);
if (analyzer.analyze(*parserResult))
{
BOOST_REQUIRE(errorReporter.errors().empty());
@@ -74,14 +74,13 @@ pair<shared_ptr<Block>, shared_ptr<assembly::AsmAnalysisInfo>> dev::julia::test:
return {};
}
-shared_ptr<assembly::Block> dev::julia::test::disambiguate(string const& _source)
+assembly::Block dev::julia::test::disambiguate(string const& _source, bool _julia)
{
- auto result = parse(_source);
- Disambiguator disambiguator(*result.first, *result.second);
- return disambiguator.run();
+ auto result = parse(_source, _julia);
+ return boost::get<Block>(Disambiguator(*result.second)(*result.first));
}
-string dev::julia::test::format(string const& _source)
+string dev::julia::test::format(string const& _source, bool _julia)
{
return assembly::AsmPrinter(_julia)(*parse(_source, _julia).first);
}