X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java index 7e9ede4..5c79a17 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/phpparser/PHPParser.java @@ -363,7 +363,6 @@ public class PHPParser extends PHPKeywords { if (openString) { throwSyntaxError("Open string character \"`\" at end of file.", startRow); } - setMarker("Other string delimiters prefered (found \"`\").", rowCount, PHPParser.INFO); token = TT_STRING_CONSTANT; return; } @@ -1335,10 +1334,15 @@ public class PHPParser extends PHPKeywords { ident.append(ch); if (ch == '$') { + getChar(); + // attention recursive call: + getIdentifier(); token = TT_VARIABLE; + return; } else { token = TT_IDENTIFIER; } + getChar(); while ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_')) { ident.append(ch); @@ -1347,6 +1351,8 @@ public class PHPParser extends PHPKeywords { identifier = ident.toString(); chIndx--; + // determine if this identitfer is a keyword + // @todo improve this in future version Integer i = (Integer) keywordMap.get(identifier.toLowerCase()); if (i != null) { token = i.intValue(); @@ -1791,6 +1797,9 @@ public class PHPParser extends PHPKeywords { getNextToken(); } else if (token == TT_function) { getNextToken(); + if (token == TT_AMPERSAND) { + getNextToken(); + } if (token == TT_IDENTIFIER) { outlineInfo.addVariable(identifier); current.add(new PHPFunctionDeclaration(current, identifier, chIndx - identifier.length()));