Added nop operator to prevent incorrect aliasing

This commit is contained in:
Jonathan Turner
2009-05-29 16:04:31 +00:00
parent 14be974fb0
commit 22654b5754
3 changed files with 48 additions and 11 deletions

View File

@@ -66,7 +66,6 @@ void parse(std::vector<TokenPtr> &tokens) {
//Example: "def add(x,y)"
Rule params;
Rule block(TokenType::Scoped_Block);
Rule rule(TokenType::Function_Def);
@@ -78,12 +77,13 @@ void parse(std::vector<TokenPtr> &tokens) {
block = Ign(Str("{")) << ~return_statement << Ign(Str("}"));
return_statement = Ign(Str("return")) << Id(TokenType::Identifier) << Str("+") << Id(TokenType::Identifier);
/*
Rule rule, rule2;
rule = rule2;
Rule rule;
Rule rule2;
rule = Nop(rule2);
rule2 = Str("Bob");
*/
/*
Rule rule(3);
rule = Ign(Str("Bob")) << Str("Fred");