aboutsummaryrefslogtreecommitdiffstats
path: root/liblll/CodeFragment.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-02 20:17:52 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-03 04:19:36 +0800
commit26f3ea8cf7fba8d8222ab1889cfbf89046371d10 (patch)
treec19c2cc8cf9db681ba84f4789fa401d43668b848 /liblll/CodeFragment.h
parent91b20b4bd247ca5163fc562d54ae639eda2532ef (diff)
downloaddexon-solidity-26f3ea8cf7fba8d8222ab1889cfbf89046371d10.tar.gz
dexon-solidity-26f3ea8cf7fba8d8222ab1889cfbf89046371d10.tar.zst
dexon-solidity-26f3ea8cf7fba8d8222ab1889cfbf89046371d10.zip
LLL: change (include) to use a callback
Diffstat (limited to 'liblll/CodeFragment.h')
-rw-r--r--liblll/CodeFragment.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/liblll/CodeFragment.h b/liblll/CodeFragment.h
index 95d21563..e5cac34e 100644
--- a/liblll/CodeFragment.h
+++ b/liblll/CodeFragment.h
@@ -39,10 +39,12 @@ struct CompilerState;
class CodeFragment
{
public:
+ using ReadCallback = std::function<std::string(std::string const&)>;
+
CodeFragment() {}
- CodeFragment(sp::utree const& _t, CompilerState& _s, bool _allowASM = false);
+ CodeFragment(sp::utree const& _t, CompilerState& _s, ReadCallback const& _readFile, bool _allowASM = false);
- static CodeFragment compile(std::string const& _src, CompilerState& _s);
+ static CodeFragment compile(std::string const& _src, CompilerState& _s, ReadCallback const& _readFile);
/// Consolidates data and compiles code.
Assembly& assembly(CompilerState const& _cs) { finalise(_cs); return m_asm; }
@@ -60,6 +62,7 @@ private:
bool m_finalised = false;
Assembly m_asm;
+ ReadCallback m_readFile;
};
static const CodeFragment NullCodeFragment;