Repository: flex-falcon
Updated Branches:
  refs/heads/develop 41cfde892 -> c180dbe40


pick up some errors we weren't getting before.  A really bad file can error 
when getting the FileScope and those errors can prevent further compilation of 
that file so its errors don't get picked up


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/5151b516
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5151b516
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5151b516

Branch: refs/heads/develop
Commit: 5151b5164bc79d0a9d6334c64b8bed2f401ab7cf
Parents: 41cfde8
Author: Alex Harui <[email protected]>
Authored: Thu Oct 1 21:31:04 2015 -0700
Committer: Alex Harui <[email protected]>
Committed: Sat Oct 3 07:41:10 2015 -0700

----------------------------------------------------------------------
 .../org/apache/flex/compiler/clients/MXMLJSC.java   |  3 ++-
 .../compiler/internal/projects/CompilerProject.java | 16 ++++++++++++++++
 .../compiler/internal/scopes/ASProjectScope.java    |  1 +
 .../flex/compiler/projects/ICompilerProject.java    | 15 +++++++++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5151b516/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java 
b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
index 8677102..a2742cb 100644
--- a/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
+++ b/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
@@ -256,7 +256,7 @@ public class MXMLJSC implements JSCompilerEntryPoint, 
ProblemQueryProvider,
         workspace = new Workspace();
         workspace.setASDocDelegate(new FlexJSASDocDelegate());
         project = new FlexJSProject(workspace);
-        problems = new ProblemQuery();
+        problems = new ProblemQuery(); // this gets replaced in configure().  
Do we need it here?
         JSSharedData.OUTPUT_EXTENSION = backend.getOutputExtension();
         JSSharedData.workspace = workspace;
         asFileHandler = backend.getSourceFileHandlerInstance();
@@ -343,6 +343,7 @@ public class MXMLJSC implements JSCompilerEntryPoint, 
ProblemQueryProvider,
 
             if (continueCompilation)
             {
+                project.setProblems(problems.getProblems());
                 compile();
                 if (problems.hasFilteredProblems())
                 {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5151b516/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
----------------------------------------------------------------------
diff --git 
a/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java 
b/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
index fdc2f63..c237202 100644
--- 
a/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
+++ 
b/compiler/src/org/apache/flex/compiler/internal/projects/CompilerProject.java
@@ -79,6 +79,7 @@ public abstract class CompilerProject implements 
ICompilerProject
     protected Set<Target> targets;
     private final ReadWriteLock unfoundDependenciesLock;
     private final Map<String, Map<ICompilationUnit, Object>> 
unfoundDefinitionDependencies;
+    protected Collection<ICompilerProblem> problems;
     
     /**
      * These are files that compilation units have tried to find and failed. 
At the moment these are
@@ -980,4 +981,19 @@ public abstract class CompilerProject implements 
ICompilerProject
         return null;
     }
 
+    /**
+     * @return collection of compiler problems.
+     */
+    public Collection<ICompilerProblem> getProblems()
+    {
+        return problems;
+    }
+
+    /**
+     * @return collection of compiler problems.
+     */
+    public void setProblems(Collection<ICompilerProblem> problems)
+    {
+        this.problems = problems;
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5151b516/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
----------------------------------------------------------------------
diff --git 
a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java 
b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
index f2195be..d7859a0 100644
--- a/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
+++ b/compiler/src/org/apache/flex/compiler/internal/scopes/ASProjectScope.java
@@ -2053,6 +2053,7 @@ public class ASProjectScope extends ASScopeBase
 
                 final IFileScopeRequestResult fileScopeRequestResult = 
compilationUnit.getFileScopeRequest().get();
                 actualDefinition = 
fileScopeRequestResult.getMainDefinition(qname);
+                Collections.addAll(compilationUnit.getProject().getProblems(), 
fileScopeRequestResult.getProblems());
             }
             catch (InterruptedException e)
             {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5151b516/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
----------------------------------------------------------------------
diff --git 
a/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java 
b/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
index 3cd9349..2610c01 100644
--- a/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
+++ b/compiler/src/org/apache/flex/compiler/projects/ICompilerProject.java
@@ -28,6 +28,7 @@ import 
org.apache.flex.compiler.constants.IASLanguageConstants;
 import org.apache.flex.compiler.definitions.IDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.scopes.IASScope;
 import org.apache.flex.compiler.targets.ISWFTarget;
 import org.apache.flex.compiler.targets.ITargetProgressMonitor;
@@ -207,4 +208,18 @@ public interface ICompilerProject
      * @return null if still ambiguous or else def1 or def2.
      */
     IDefinition doubleCheckAmbiguousDefinition(ASScope scope, String name, 
IDefinition def1, IDefinition def2);
+
+
+    /**
+     * @return All the problems collected so far.  
+     * Add new ones here if you don't have another place to add them.
+     */
+    Collection<ICompilerProblem> getProblems();
+
+    /**
+     * @param problems All the problems collected so far.  
+     * Set this to the main collection so parts of the compiler
+     * can add a problem if they don't have another place to add them.
+     */
+    void setProblems(Collection<ICompilerProblem> problems);
 }

Reply via email to