aboutsummaryrefslogtreecommitdiff
path: root/src/utils/lombok/javac/java8
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-12-04 23:45:57 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-12-05 00:00:08 +0100
commitab8e14736f8c3a7cb96ae7351d4bb1818131f2b2 (patch)
tree43315dfa6e746a9a59244bf4314fcea535045412 /src/utils/lombok/javac/java8
parenta92117574e10a7949bb0262786698d138056360b (diff)
downloadlombok-ab8e14736f8c3a7cb96ae7351d4bb1818131f2b2.tar.gz
lombok-ab8e14736f8c3a7cb96ae7351d4bb1818131f2b2.tar.bz2
lombok-ab8e14736f8c3a7cb96ae7351d4bb1818131f2b2.zip
[JDK9] fixing delombok’s comment integration in JDK9.
Diffstat (limited to 'src/utils/lombok/javac/java8')
-rw-r--r--src/utils/lombok/javac/java8/CommentCollectingParserFactory.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
index 45f865ad..2fdaddfe 100644
--- a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
+++ b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java
@@ -52,6 +52,16 @@ public class CommentCollectingParserFactory extends ParserFactory {
//Either way this will work out.
}
+ public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap, boolean parseModuleInfo) {
+ ScannerFactory scannerFactory = ScannerFactory.instance(context);
+ Lexer lexer = scannerFactory.newScanner(input, true);
+ Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos);
+ return (JavacParser) x;
+ // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either
+ //javac6's EndPosParser which extends Parser, or javac8's JavacParser which implements Parser.
+ //Either way this will work out.
+ }
+
public static void setInCompiler(JavaCompiler compiler, Context context) {
context.put(CommentCollectingParserFactory.key(), (ParserFactory) null);
Field field;