From fb3a363e6eb10a7f603a73ce67c44ac8941e995b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tr=C3=A1vn=C3=AD=C4=8Dek?= <jan.travnicek@fit.cvut.cz> Date: Fri, 8 Apr 2022 22:28:34 +0200 Subject: [PATCH] cli: allow string template argument in cli closes #228 --- alib2cli/src/parser/Parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alib2cli/src/parser/Parser.cpp b/alib2cli/src/parser/Parser.cpp index 51a8c205bf..6c866cdd60 100644 --- a/alib2cli/src/parser/Parser.cpp +++ b/alib2cli/src/parser/Parser.cpp @@ -121,7 +121,10 @@ std::unique_ptr < Arg > Parser::optional_arg ( ) { std::unique_ptr < Arg > Parser::template_arg ( ) { match ( cli::Lexer::TokenType::AT_SIGN ); - return arg ( ); + if ( check ( cli::Lexer::TokenType::STRING ) ) + return std::make_unique < ImmediateArg > ( matchString ( ) ); + else + return arg ( ); } std::unique_ptr < Arg > Parser::optional_variable ( ) { -- GitLab