Added a new PHP Parser Preference Page (global and on project level)
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / impl / CompilerOptions.java
index 5baf599..c2e2a16 100644 (file)
@@ -27,7 +27,9 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
        /**
         * Option IDs
         */
-       public static final String OPTION_LocalVariableAttribute = "net.sourceforge.phpeclipse.compiler.debug.localVariable"; //$NON-NLS-1$
+    public static final String OPTION_PHPVarDeprecatedWarning = "net.sourceforge.phpeclipse.compiler.problem.phpVarDeprecatedWarning"; //$NON-NLS-1$
+       
+    public static final String OPTION_LocalVariableAttribute = "net.sourceforge.phpeclipse.compiler.debug.localVariable"; //$NON-NLS-1$
        public static final String OPTION_LineNumberAttribute = "net.sourceforge.phpeclipse.compiler.debug.lineNumber"; //$NON-NLS-1$
        public static final String OPTION_SourceFileAttribute = "net.sourceforge.phpeclipse.compiler.debug.sourceFile"; //$NON-NLS-1$
 //     public static final String OPTION_PreserveUnusedLocal = "net.sourceforge.phpeclipse.compiler.codegen.unusedLocal"; //$NON-NLS-1$
@@ -145,7 +147,8 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
        public static final long UnqualifiedFieldAccess = 0x4000000000L;
        public static final long MissingJavadocTags = 0x8000000000L;
        public static final long MissingJavadocComments  = 0x10000000000L;
-
+       
+       public static final long PHPVarDeprecatedWarning  = 0x20000000000L;
        // Default severity level for handlers
        public long errorThreshold = 0;
                
@@ -160,7 +163,8 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
                | IncompatibleNonInheritedInterfaceMethod
                | NoImplicitStringConversion
                | FinallyBlockNotCompleting
-               | AssertUsedAsAnIdentifier;
+               | AssertUsedAsAnIdentifier
+               | PHPVarDeprecatedWarning;
 
        // Debug attributes
        public static final int Source = 1; // SourceFileAttribute
@@ -246,6 +250,8 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
 
        public Map getMap() {
                Map optionsMap = new HashMap(30);
+               optionsMap.put(OPTION_PHPVarDeprecatedWarning, getSeverityString(PHPVarDeprecatedWarning)); 
+               
                optionsMap.put(OPTION_LocalVariableAttribute, (this.produceDebugAttributes & Vars) != 0 ? GENERATE : DO_NOT_GENERATE); 
                optionsMap.put(OPTION_LineNumberAttribute, (this.produceDebugAttributes & Lines) != 0 ? GENERATE : DO_NOT_GENERATE);
                optionsMap.put(OPTION_SourceFileAttribute, (this.produceDebugAttributes & Source) != 0 ? GENERATE : DO_NOT_GENERATE);
@@ -466,6 +472,8 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
                                }
                        }
                }
+               if ((optionValue = optionsMap.get(OPTION_PHPVarDeprecatedWarning)) != null) updateSeverity(PHPVarDeprecatedWarning, optionValue);
+               
                if ((optionValue = optionsMap.get(OPTION_ReportMethodWithConstructorName)) != null) updateSeverity(MethodWithConstructorName, optionValue);
                if ((optionValue = optionsMap.get(OPTION_ReportOverridingPackageDefaultMethod)) != null) updateSeverity(OverriddenPackageDefaultMethod, optionValue);
                if ((optionValue = optionsMap.get(OPTION_ReportDeprecation)) != null) updateSeverity(UsingDeprecatedAPI, optionValue);
@@ -565,6 +573,8 @@ public class CompilerOptions implements ProblemReasons, ProblemSeverities, ICons
        public String toString() {
        
                StringBuffer buf = new StringBuffer("CompilerOptions:"); //$NON-NLS-1$
+               buf.append("\n\t- var is deprecated keyword: ").append(getSeverityString(PHPVarDeprecatedWarning)); //$NON-NLS-1$
+               
                buf.append("\n\t- local variables debug attributes: ").append((this.produceDebugAttributes & Vars) != 0 ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                buf.append("\n\t- line number debug attributes: ").append((this.produceDebugAttributes & Lines) != 0 ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                buf.append("\n\t- source debug attributes: ").append((this.produceDebugAttributes & Source) != 0 ? "ON" : " OFF"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$