diff options
Diffstat (limited to 'src/sexpr/lexer.hpp')
-rw-r--r-- | src/sexpr/lexer.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sexpr/lexer.hpp b/src/sexpr/lexer.hpp index 63be72d..9b198a0 100644 --- a/src/sexpr/lexer.hpp +++ b/src/sexpr/lexer.hpp @@ -22,7 +22,6 @@ #include <vector> -#include "../strings/fwd.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" @@ -59,10 +58,13 @@ namespace sexpr Lexer(ZString filename) : _in(filename), _current(TOK_EOF), _span(), _depth() { adv(); } - // for unit tests - Lexer(ZString fake, io::FD fd) - : _in(fake, fd), _current(TOK_EOF), _span(), _depth() + Lexer(io::read_file_from_string, ZString name, XString str) + : _in(io::from_string, name, str), _current(TOK_EOF), _span(), _depth() { adv(); } + Lexer(io::read_file_from_string, ZString name, LString str) + : _in(io::from_string, name, str), _current(TOK_EOF), _span(), _depth() + { adv(); } + Lexeme peek() { return _current; } void adv() { _current = _adv(); } ZString val_string() { return _string; } |