Added "Task Tags" functionality (TODO,...)
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / parser / Scanner.java
index 10a8ea8..ea1f9c0 100644 (file)
@@ -135,12 +135,7 @@ public class Scanner implements IScanner, ITerminalSymbols {
   public char[][] taskPriorities = null;
   public static final boolean DEBUG = false;
   public static final boolean TRACE = false;
-  public Scanner() {
-    this(false, false);
-  }
-  public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace) {
-    this(tokenizeComments, tokenizeWhiteSpace, false);
-  }
+
   /**
    * Determines if the specified character is permissible as the first
    * character in a PHP identifier
@@ -1587,7 +1582,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
                       endPositionForLineComment = currentPosition - 1;
                     }
                     recordComment(false);
-                    if ((currentCharacter == '\r')
+                    if (this.taskTags != null) checkTaskTag(this.startPosition, this.currentPosition);
+                                       if ((currentCharacter == '\r')
                         || (currentCharacter == '\n')) {
                       checkNonExternalizeString();
                       if (recordLineSeparator) {
@@ -3824,6 +3820,13 @@ public class Scanner implements IScanner, ITerminalSymbols {
             + new String(getCurrentTokenSource()); //$NON-NLS-1$
     }
   }
+  
+  public Scanner() {
+    this(false, false);
+  }
+  public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace) {
+    this(tokenizeComments, tokenizeWhiteSpace, false);
+  }
   public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
       boolean checkNonExternalizedStringLiterals) {
     this(tokenizeComments, tokenizeWhiteSpace,
@@ -3832,11 +3835,13 @@ public class Scanner implements IScanner, ITerminalSymbols {
   public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
       boolean checkNonExternalizedStringLiterals, boolean assertMode) {
     this(tokenizeComments, tokenizeWhiteSpace,
-        checkNonExternalizedStringLiterals, assertMode, false);
+        checkNonExternalizedStringLiterals, assertMode, false, null, null);
   }
   public Scanner(boolean tokenizeComments, boolean tokenizeWhiteSpace,
       boolean checkNonExternalizedStringLiterals, boolean assertMode,
-      boolean tokenizeStrings) {
+      boolean tokenizeStrings,
+      char[][] taskTags,
+         char[][] taskPriorities) {
     this.eofPosition = Integer.MAX_VALUE;
     this.tokenizeComments = tokenizeComments;
     this.tokenizeWhiteSpace = tokenizeWhiteSpace;
@@ -3844,6 +3849,8 @@ public class Scanner implements IScanner, ITerminalSymbols {
     this.checkNonExternalizedStringLiterals = checkNonExternalizedStringLiterals;
     this.assertMode = assertMode;
     this.encapsedStringStack = null;
+    this.taskTags = taskTags;
+       this.taskPriorities = taskPriorities;
   }
   private void checkNonExternalizeString() throws InvalidInputException {
     if (currentLine == null)