Added break and return statements. Fixed inner block parsing
This commit is contained in:
@@ -95,6 +95,12 @@ void parse(std::vector<TokenPtr> &tokens, const char *filename) {
|
||||
block = Ign(Str("{")) >> ~return_statement >> Ign(Str("}"));
|
||||
return_statement = Ign(Str("return")) >> expression;
|
||||
*/
|
||||
Rule rule(TokenType::Equation);
|
||||
rule = Str("break");
|
||||
|
||||
std::cout << "Check: " << rule.impl->new_id << std::endl;
|
||||
|
||||
/*
|
||||
Rule rule = *(expression >> *Ign(Id(TokenType::Semicolon)));
|
||||
expression = term >> *((Str("+") >> term) | (Str("-") >> term));
|
||||
term = factor >> *((Str("*") >> factor) | (Str("/") >> factor));
|
||||
@@ -103,7 +109,7 @@ void parse(std::vector<TokenPtr> &tokens, const char *filename) {
|
||||
negate = Ign(Str("-")) >> factor;
|
||||
|
||||
value = funcall | Id(TokenType::Identifier) | Id(TokenType::Number) | Id(TokenType::Quoted_String) | Id(TokenType::Single_Quoted_String);
|
||||
|
||||
*/
|
||||
/*
|
||||
Rule rule = Str("x") << Id(TokenType::Semicolon);
|
||||
*/
|
||||
|
Reference in New Issue
Block a user