Committing more fixes for bug #1839622 RSE Path error. This will clean up php files...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Parser.java
index b27c78c..e6c6133 100644 (file)
@@ -2013,7 +2013,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                        throwSyntaxError("'endif' expected.");
                }
                getNextToken();
-               if (token != TokenNameSEMICOLON) {
+               if (token != TokenNameSEMICOLON && token != TokenNameINLINE_HTML) {
                        reportSyntaxError("';' expected after if-statement.");
                        iState.sourceEnd = scanner.getCurrentTokenStartPosition();
                } else {
@@ -2255,7 +2255,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                                throwSyntaxError("'endswitch' expected.");
                        }
                        getNextToken();
-                       if (token != TokenNameSEMICOLON) {
+                       if (token != TokenNameSEMICOLON && token != TokenNameINLINE_HTML) {
                                throwSyntaxError("';' expected after switch-statement.");
                        }
                        getNextToken();
@@ -2283,7 +2283,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                                throwSyntaxError("'endfor' expected.");
                        }
                        getNextToken();
-                       if (token != TokenNameSEMICOLON) {
+                       if (token != TokenNameSEMICOLON && token != TokenNameINLINE_HTML) {
                                throwSyntaxError("';' expected after for-statement.");
                        }
                        getNextToken();
@@ -2301,7 +2301,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                                throwSyntaxError("'endwhile' expected.");
                        }
                        getNextToken();
-                       if (token != TokenNameSEMICOLON) {
+                       if (token != TokenNameSEMICOLON && token != TokenNameINLINE_HTML) {
                                throwSyntaxError("';' expected after while-statement.");
                        }
                        getNextToken();
@@ -2318,7 +2318,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                                throwSyntaxError("'endforeach' expected.");
                        }
                        getNextToken();
-                       if (token != TokenNameSEMICOLON) {
+                       if (token != TokenNameSEMICOLON && token != TokenNameINLINE_HTML) {
                                throwSyntaxError("';' expected after foreach-statement.");
                        }
                        getNextToken();
@@ -3015,7 +3015,15 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                if (token == TokenNameIdentifier) {
                        ref = new SingleTypeReference(scanner.getCurrentIdentifierSource(),
                                        scanner.getCurrentTokenStartPosition());
+                       int pos = scanner.currentPosition;
                        getNextToken();
+                       if (token == TokenNamePAAMAYIM_NEKUDOTAYIM) {
+                               // Not terminated by T_STRING, reduce to dynamic_class_name_reference
+                               scanner.currentPosition = pos;
+                               token = TokenNameIdentifier;
+                               ref = null;
+                               dynamic_class_name_reference();
+                       }
                } else {
                        ref = null;
                        dynamic_class_name_reference();
@@ -4162,7 +4170,7 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                                        if (path == null) {
                                                // SyntaxError: "File: << >> doesn't exist in project."
                                                String[] args = { expression.toStringExpression(),
-                                                               project.getLocation().toString() };
+                                                               project.getFullPath().toString() };
                                                problemReporter.phpIncludeNotExistWarning(args,
                                                                literal.sourceStart, literal.sourceEnd,
                                                                referenceContext,
@@ -4985,11 +4993,12 @@ public class Parser implements ITerminalSymbols, CompilerModifiers,
                // create a package name similar to java package names
                String projectPath = ProjectPrefUtil.getDocumentRoot(file.getProject())
                                .toString();
-               String filePath = file.getRawLocation().toString();
-               String ext = file.getRawLocation().getFileExtension();
-               int fileExtensionLength = ext == null ? 0 : ext.length() + 1;
-               ImportReference impt;
-               char[][] tokens;
+                String filePath = file.getFullPath().toString();
+                
+                String ext = file.getFileExtension();
+                int fileExtensionLength = ext == null ? 0 : ext.length() + 1;
+                ImportReference impt;
+                char[][] tokens;
                if (filePath.startsWith(projectPath)) {
                        tokens = CharOperation.splitOn('/', filePath.toCharArray(),
                                        projectPath.length() + 1, filePath.length()