Repository: groovy
Updated Branches:
  refs/heads/master 0ac61d6a5 -> f2bdd2d62


Trivial refactoring: use the char stream of lexer instead


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/f2bdd2d6
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/f2bdd2d6
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/f2bdd2d6

Branch: refs/heads/master
Commit: f2bdd2d62307c7c0dece402747fe1c78e0856e81
Parents: 0ac61d6
Author: Daniel Sun <sun...@apache.org>
Authored: Sat Dec 1 01:17:20 2018 +0800
Committer: Daniel Sun <sun...@apache.org>
Committed: Sat Dec 1 01:17:20 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/groovy/parser/antlr4/AstBuilder.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/f2bdd2d6/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
----------------------------------------------------------------------
diff --git 
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
 
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
index 5671afc..ee6b625 100644
--- 
a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
+++ 
b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/AstBuilder.java
@@ -361,14 +361,12 @@ public class AstBuilder extends 
GroovyParserBaseVisitor<Object> implements Groov
         this.sourceUnit = sourceUnit;
         this.moduleNode = new ModuleNode(sourceUnit);
 
-        CharStream charStream = createCharStream(sourceUnit);
-
-        this.lexer = new GroovyLangLexer(charStream);
+        this.lexer = new GroovyLangLexer(createCharStream(sourceUnit));
         this.parser =
                 new GroovyLangParser(
                     new CommonTokenStream(this.lexer));
 
-        this.parser.setErrorHandler(new DescriptiveErrorStrategy(charStream));
+        this.parser.setErrorHandler(new 
DescriptiveErrorStrategy(this.lexer.getInputStream()));
 
         this.tryWithResourcesASTTransformation = new 
TryWithResourcesASTTransformation(this);
         this.groovydocManager = GroovydocManager.getInstance();

Reply via email to