diff --git a/alib2cli/src/lexer/Lexer.h b/alib2cli/src/lexer/Lexer.h index 7706d343295a16c39b54c42e4b22f1562b7a1056..60733d5e38867f66bfc288a461a1e440bd49ef11 100644 --- a/alib2cli/src/lexer/Lexer.h +++ b/alib2cli/src/lexer/Lexer.h @@ -9,8 +9,7 @@ #include <exception/CommonException.h> -#include "CharSequence.h" -#include <readline/StringLineInterface.h> +#include <lexer/CharSequence.h> namespace cli { diff --git a/alib2cli/src/parser/Parser.cpp b/alib2cli/src/parser/Parser.cpp index 94a1c5c4560a09ac7eda0d0e7a570277267401eb..f7e56a925b5ee6f42ac519d1cccf22bd5f6dbb72 100644 --- a/alib2cli/src/parser/Parser.cpp +++ b/alib2cli/src/parser/Parser.cpp @@ -410,13 +410,19 @@ std::unique_ptr < Command > Parser::command ( ) { return std::make_unique < SetCommand > ( std::move ( param ), std::move ( value ) ); } else if ( check_nonreserved_kw ( "load" ) ) { match_nonreserved_kw ( "load" ); + + setHint ( Lexer::Hint::FILE ); std::string libraryName = getTokenValue ( ); - match ( cli::Lexer::TokenType::INTEGER, cli::Lexer::TokenType::IDENTIFIER, cli::Lexer::TokenType::STRING ); + match ( cli::Lexer::TokenType::FILE, cli::Lexer::TokenType::STRING ); + return std::make_unique < LoadCommand > ( std::move ( libraryName ) ); } else if ( check_nonreserved_kw ( "unload" ) ) { match_nonreserved_kw ( "unload" ); + + setHint ( Lexer::Hint::FILE ); std::string libraryName = getTokenValue ( ); - match ( cli::Lexer::TokenType::INTEGER, cli::Lexer::TokenType::IDENTIFIER, cli::Lexer::TokenType::STRING ); + match ( cli::Lexer::TokenType::FILE, cli::Lexer::TokenType::STRING ); + return std::make_unique < UnloadCommand > ( std::move ( libraryName ) ); } else if ( check ( cli::Lexer::TokenType::EOT ) ) { return std::make_unique < EOTCommand > ( ); diff --git a/alib2cli/test-src/cli/CliTest.cpp b/alib2cli/test-src/cli/CliTest.cpp index 2b7f4441cd218291e2fe711594284abd6ea271cb..1754bd2c4e860a603dbed073ec0af3098f16b8bd 100644 --- a/alib2cli/test-src/cli/CliTest.cpp +++ b/alib2cli/test-src/cli/CliTest.cpp @@ -8,6 +8,7 @@ #include <sys/stat.h> #include <registry/AlgorithmRegistry.hpp> #include <registration/AlgoRegistration.hpp> +#include <readline/StringLineInterface.h> void testLine ( std::string line, cli::Environment & environment ) { cli::Parser ( cli::Lexer ( cli::CharSequence ( cli::StringLineInterface ( line ) ) ) ).parse ( )->run ( environment ); diff --git a/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp b/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp index 35ee0666e3d32f8f9d2760d6d2d39bb436c749db..ed0bc38907ce08d0321824ff6266a406f83f15d6 100644 --- a/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp +++ b/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp @@ -12,6 +12,8 @@ #include <alib/exception> #include <alib/random> +#include <readline/StringLineInterface.h> + #define PIPE_RD 0 #define PIPE_WR 1