From ac59a77f21f15968d8e9424644c737b48604a31c Mon Sep 17 00:00:00 2001 From: kpouer Date: Tue, 26 Aug 2003 08:11:28 +0000 Subject: [PATCH] a bugfix on variables --- 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 8d0645d..831f354 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -798,21 +798,21 @@ Token token; * It will be used by fields and formal parameters */ static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { - final Token dollar, token, lbrace,rbrace; + final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; Variable variable; - dollar = jj_consume_token(DOLLAR); + jj_consume_token(DOLLAR); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd); + variable = new Variable(token.image,token.sourceStart,token.sourceEnd); break; case LBRACE: lbrace = jj_consume_token(LBRACE); expr = Expression(); rbrace = jj_consume_token(RBRACE); - variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd); + variable = new Variable(expr,lbrace.sourceStart,rbrace.sourceEnd); break; default: jj_la1[10] = jj_gen; @@ -926,7 +926,7 @@ Token token; final Token token; token = jj_consume_token(DOLLAR); variable = Var(token); - {if (true) return new Variable(variable,token.sourceStart,variable.sourceEnd);} + {if (true) return new Variable(variable,token.sourceEnd,variable.sourceEnd);} throw new Error("Missing return statement in function"); } @@ -939,7 +939,7 @@ Token token; case DOLLAR: token = jj_consume_token(DOLLAR); variable = Var(token); - {if (true) return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} + {if (true) return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} break; case LBRACE: token = jj_consume_token(LBRACE); @@ -2400,7 +2400,7 @@ final Token token,token1; break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - expression = new Variable(token.image,token.sourceStart,token.sourceEnd); + expression = new ConstantIdentifier(token.image,token.sourceStart,token.sourceEnd); break; case DOLLAR: expression = Variable(); diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index 9ad3eff..afc5890 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -920,19 +920,19 @@ FieldDeclaration FieldDeclaration() : */ VariableDeclaration VariableDeclaratorNoSuffix() : { - final Token dollar, token, lbrace,rbrace; + final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; Variable variable; } { - dollar = + ( token = - {variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd);} + {variable = new Variable(token.image,token.sourceStart,token.sourceEnd);} | lbrace = expr = Expression() rbrace = - {variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd);} + {variable = new Variable(expr,lbrace.sourceStart,rbrace.sourceEnd);} ) [ assignToken = @@ -1038,7 +1038,7 @@ Variable Variable() : { token = variable = Var(token) { - return new Variable(variable,token.sourceStart,variable.sourceEnd); + return new Variable(variable,token.sourceEnd,variable.sourceEnd); } } @@ -1051,7 +1051,7 @@ Variable Var(final Token dollar) : } { token = variable = Var(token) - {return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} + {return new Variable(variable,dollar.sourceEnd,variable.sourceEnd);} | token = expression = Expression() token2 = { @@ -1865,7 +1865,7 @@ AbstractVariable VariableSuffix(final AbstractVariable prefix) : } | token = - {expression = new Variable(token.image,token.sourceStart,token.sourceEnd);} + {expression = new ConstantIdentifier(token.image,token.sourceStart,token.sourceEnd);} | expression = Variable() ) -- 1.7.1