1) Fixed issue #844: Short form of ternary operator (since PHP 5.3).
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / IncludesScanner.java
index 3858ed8..f6ec655 100644 (file)
@@ -38,7 +38,7 @@ public class IncludesScanner implements ITerminalSymbols {
 
        /**
         * Add the information for a given IFile resource
-        * 
+        *
         */
        public void addFile(IFile fileToParse) {
 
@@ -75,8 +75,8 @@ public class IncludesScanner implements ITerminalSymbols {
        /**
         * Get the next token from input
         */
-       private int getNextToken(Scanner scanner) {
-               int token;
+       private TokenName getNextToken(Scanner scanner) {
+               TokenName token;
                try {
                        token = scanner.getNextToken();
                        if (Scanner.DEBUG) {
@@ -90,7 +90,7 @@ public class IncludesScanner implements ITerminalSymbols {
                        return token;
                } catch (InvalidInputException e) {
                }
-               return TokenNameERROR;
+               return TokenName.ERROR;
        }
 
        private void parseIdentifiers(char[] charArray) {
@@ -99,20 +99,20 @@ public class IncludesScanner implements ITerminalSymbols {
                                null, true /* taskCaseSensitive */);
                scanner.setSource(charArray);
                scanner.setPHPMode(false);
-               int token = getNextToken(scanner);
+               TokenName token = getNextToken(scanner);
                try {
-                       while (token != TokenNameEOF) { // && fToken != TokenNameERROR) {
-                               if (token == TokenNameinclude || token == TokenNameinclude_once
-                                               || token == TokenNamerequire
-                                               || token == TokenNamerequire_once) {
-                                       while (token != TokenNameEOF && token != TokenNameERROR
-                                                       && token != TokenNameSEMICOLON
-                                                       && token != TokenNameRPAREN
-                                                       && token != TokenNameLBRACE
-                                                       && token != TokenNameRBRACE) {
+                       while (token != TokenName.EOF) { // && fToken != TokenName.ERROR) {
+                               if (token == TokenName.INCLUDE || token == TokenName.INCLUDE_ONCE
+                                               || token == TokenName.REQUIRE
+                                               || token == TokenName.REQUIRE_ONCE) {
+                                       while (token != TokenName.EOF && token != TokenName.ERROR
+                                                       && token != TokenName.SEMICOLON
+                                                       && token != TokenName.RPAREN
+                                                       && token != TokenName.LBRACE
+                                                       && token != TokenName.RBRACE) {
                                                token = getNextToken(scanner);
-                                               if (token == TokenNameStringDoubleQuote
-                                                               || token == TokenNameStringSingleQuote) {
+                                               if (token == TokenName.STRINGDOUBLEQUOTE
+                                                               || token == TokenName.STRINGSINGLEQUOTE) {
                                                        char[] includeName = scanner
                                                                        .getCurrentStringLiteralSource();
                                                        try {
@@ -165,7 +165,7 @@ public class IncludesScanner implements ITerminalSymbols {
 
        /**
         * Returns a list of includes
-        * 
+        *
         * @return the determined list of includes
         */
        public List getList() {
@@ -180,4 +180,4 @@ public class IncludesScanner implements ITerminalSymbols {
        public Set getSet() {
                return fSet;
        }
-}
\ No newline at end of file
+}