From 0b88b4596e6265863e75e7aabcca52734e147fae Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 24 Feb 2023 19:09:53 -0500 Subject: compact implementation; runs on msp430 --- alee.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'alee.cpp') diff --git a/alee.cpp b/alee.cpp index 41610e4..0f270a8 100644 --- a/alee.cpp +++ b/alee.cpp @@ -26,7 +26,7 @@ static bool okay = false; static void readchar(State& state); -static void parseLine(Parser&, State&, std::string_view); +static void parseLine(Parser&, State&, const std::string&); static void parseFile(Parser&, State&, std::istream&); int main(int argc, char *argv[]) @@ -105,9 +105,9 @@ void user_sys(State& state) } } -void parseLine(Parser& parser, State& state, std::string_view line) +void parseLine(Parser& parser, State& state, const std::string& line) { - if (auto r = parser.parse(state, line); r == 0) { + if (auto r = parser.parse(state, line.c_str()); r == 0) { if (okay) std::cout << (state.compiling() ? "compiled" : "ok") << std::endl; } else { @@ -116,6 +116,7 @@ void parseLine(Parser& parser, State& state, std::string_view line) std::cout << "word not found in: " << line << std::endl; break; default: + std::cout << "error: " << r << std::endl; break; } } -- cgit v1.2.3