From 2ee7c377fa5d7e453605dc51cef199269d7f46d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=A0torc?= <storcond@fit.cvut.cz> Date: Sun, 2 Apr 2023 13:20:45 +0200 Subject: [PATCH] cli: Disable construction of old parser --- alib2cli/src/parser/Parser.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/alib2cli/src/parser/Parser.h b/alib2cli/src/parser/Parser.h index 403d46454..636cf4f94 100644 --- a/alib2cli/src/parser/Parser.h +++ b/alib2cli/src/parser/Parser.h @@ -47,13 +47,19 @@ class Parser { return std::string("Line ") + ext::to_string(m_current.m_line) + " at position " + ext::to_string(m_current.m_position) + ": "; } -public: Parser(cli::Lexer lexer) : m_lexer(std::move(lexer)) , m_current(m_lexer.nextToken(true)) { } +public: + static std::unique_ptr<cli::CommandList> parse(cli::Lexer&& lexer) + { + // TODO: Remove, with whole class. Used only for backward compatibility testing + return Parser(std::move(lexer)).parse(); + } + void setHint(Lexer::Hint hint) { m_lexer.setHint(hint); -- GitLab