Skip to content
Snippets Groups Projects
Commit 3043d25b authored by Jan Trávníček's avatar Jan Trávníček Committed by Jan Travnicek
Browse files

fixup load and unload statements

parent 173d3037
No related branches found
No related tags found
1 merge request!117Merge jt
......@@ -9,8 +9,7 @@
 
#include <exception/CommonException.h>
 
#include "CharSequence.h"
#include <readline/StringLineInterface.h>
#include <lexer/CharSequence.h>
 
namespace cli {
 
......
......@@ -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 > ( );
......
......@@ -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 );
......
......@@ -12,6 +12,8 @@
#include <alib/exception>
#include <alib/random>
 
#include <readline/StringLineInterface.h>
#define PIPE_RD 0
#define PIPE_WR 1
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment