diff options
Diffstat (limited to 'liblll/CodeFragment.h')
-rw-r--r-- | liblll/CodeFragment.h | 7 |
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; |