Some small changes in tests. There's a functionality I wanted to build, but still it doesn't look good ;P.
parent
e15c8be93a
commit
0121614845
|
@ -33,8 +33,6 @@ bool Parser::read_next()
|
|||
current_token = token_stream[position_in_stream];
|
||||
tok_value = current_token.get_value();
|
||||
position_in_stream++;
|
||||
cout << "***Reading token: ..." << endl;
|
||||
cout << "Token value: " << tok_value << "***" << endl << endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -30,13 +30,18 @@ void test_lexer()
|
|||
|
||||
void test_parser()
|
||||
{
|
||||
string text_line = "def i; bulb; i + 3; string banan = \"kartofel\"; banan = \"banan\"; string kaboom(num how_many_times) { def z; }";
|
||||
vector<string> lines;
|
||||
lines.push_back("def i; bulb; i + 3; string banan = \"kartofel\"; banan = \"banan\"; string kaboom(num how_many_times) { def z; }");
|
||||
Lexer lexer;
|
||||
vector<Token> tokens = lexer.parse_line(text_line);
|
||||
Parser parser = Parser(tokens);
|
||||
parser.interpret();
|
||||
cout << parser.report_message;
|
||||
cout << parser.error_message;
|
||||
vector<Token> tokens;
|
||||
for(i=0; i<lines.size(); i++)
|
||||
{
|
||||
tokens = lexer.parse_line(lines[i]);
|
||||
Parser parser = Parser(tokens);
|
||||
parser.interpret();
|
||||
cout << parser.report_message;
|
||||
cout << parser.error_message;
|
||||
}
|
||||
|
||||
}
|
||||
int main()
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<iostream>
|
||||
"Token.h"
|
||||
|
||||
1351425833 source:/home/attero/development/sencha-lang/sencha/main.cpp
|
||||
1351426109 source:/home/attero/development/sencha-lang/sencha/main.cpp
|
||||
<iostream>
|
||||
<string>
|
||||
"Token.h"
|
||||
|
|
Loading…
Reference in New Issue