use of com.sun.tools.javac.main.JavaCompiler in project ceylon-compiler by ceylon.
the class T6400303 method main.
public static void main(String... args) {
javax.tools.JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
JavacTaskImpl task = (JavacTaskImpl) tool.getTask(null, null, null, null, null, null);
JavaCompiler compiler = JavaCompiler.instance(task.getContext());
try {
compiler.resolveIdent("Test$1").complete();
} catch (CompletionFailure ex) {
System.err.println("Got expected completion failure: " + ex.getLocalizedMessage());
return;
}
throw new AssertionError("No error reported");
}
use of com.sun.tools.javac.main.JavaCompiler in project ceylon-compiler by ceylon.
the class LanguageCompiler method instance.
/**
* Get the JavaCompiler instance for this context.
*/
public static JavaCompiler instance(Context context) {
Options options = Options.instance(context);
options.put("-Xprefer", "source");
// make sure it's registered
CeylonLog.instance(context);
CeylonEnter.instance(context);
CeylonClassWriter.instance(context);
JavaCompiler instance = context.get(compilerKey);
if (instance == null)
instance = new LanguageCompiler(context);
return instance;
}
Aggregations