From e8137224293250058137a33c9de5837963826fda Mon Sep 17 00:00:00 2001 From: kpouer Date: Tue, 26 Aug 2003 15:05:09 +0000 Subject: [PATCH] a little bugfix in the variable parsing --- net.sourceforge.phpeclipse/src/test/PHPParser.java | 14 +++++++------- net.sourceforge.phpeclipse/src/test/PHPParser.jj | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 831f354..eac7b50 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -925,12 +925,12 @@ Token token; Variable variable = null; final Token token; token = jj_consume_token(DOLLAR); - variable = Var(token); - {if (true) return new Variable(variable,token.sourceEnd,variable.sourceEnd);} + variable = Var(); + {if (true) return variable;} throw new Error("Missing return statement in function"); } - static final public Variable Var(final Token dollar) throws ParseException { + static final public Variable Var() throws ParseException { Variable variable = null; final Token token,token2; ConstantIdentifier constant; @@ -938,20 +938,20 @@ Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: token = jj_consume_token(DOLLAR); - variable = Var(token); - {if (true) return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} + variable = Var(); + {if (true) return new Variable(variable,variable.sourceStart,variable.sourceEnd);} break; case LBRACE: token = jj_consume_token(LBRACE); expression = Expression(); token2 = jj_consume_token(RBRACE); {if (true) return new Variable(expression, - dollar.sourceStart, + token.sourceStart, token2.sourceEnd);} break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - {if (true) return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} + {if (true) return new Variable(token.image,token.sourceStart,token.sourceEnd);} break; default: jj_la1[13] = jj_gen; diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index afc5890..92e62c8 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -1036,13 +1036,13 @@ Variable Variable() : final Token token; } { - token = variable = Var(token) + token = variable = Var() { - return new Variable(variable,token.sourceEnd,variable.sourceEnd); + return variable; } } -Variable Var(final Token dollar) : +Variable Var() : { Variable variable = null; final Token token,token2; @@ -1050,18 +1050,18 @@ Variable Var(final Token dollar) : Expression expression; } { - token = variable = Var(token) - {return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} + token = variable = Var() + {return new Variable(variable,variable.sourceStart,variable.sourceEnd);} | token = expression = Expression() token2 = { return new Variable(expression, - dollar.sourceStart, + token.sourceStart, token2.sourceEnd); } | token = - {return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} + {return new Variable(token.image,token.sourceStart,token.sourceEnd);} } Expression VariableInitializer() : -- 1.7.1