Search in sources :

Example 1 with CompilationContextImpl

use of org.eclipse.xtend.core.macro.CompilationContextImpl in project xtext-xtend by eclipse.

the class CompilationUnitImpl method setCompilationStrategy.

public void setCompilationStrategy(final JvmExecutable executable, final CompilationStrategy compilationStrategy) {
    this.checkCanceled();
    final Procedure1<ITreeAppendable> _function = (ITreeAppendable it) -> {
        final CompilationContextImpl context = new CompilationContextImpl(it, this);
        it.append(this.trimTrailingLinebreak(compilationStrategy.compile(context), executable));
    };
    this.jvmTypesBuilder.setBody(executable, _function);
}
Also used : CompilationContextImpl(org.eclipse.xtend.core.macro.CompilationContextImpl) ITreeAppendable(org.eclipse.xtext.xbase.compiler.output.ITreeAppendable)

Example 2 with CompilationContextImpl

use of org.eclipse.xtend.core.macro.CompilationContextImpl in project xtext-xtend by eclipse.

the class CompilationUnitImpl method setCompilationStrategy.

public void setCompilationStrategy(final JvmField field, final CompilationStrategy compilationStrategy) {
    this.checkCanceled();
    final Procedure1<ITreeAppendable> _function = (ITreeAppendable it) -> {
        final CompilationContextImpl context = new CompilationContextImpl(it, this);
        it.append(compilationStrategy.compile(context));
    };
    this.jvmTypesBuilder.setInitializer(field, _function);
}
Also used : CompilationContextImpl(org.eclipse.xtend.core.macro.CompilationContextImpl) ITreeAppendable(org.eclipse.xtext.xbase.compiler.output.ITreeAppendable)

Aggregations

CompilationContextImpl (org.eclipse.xtend.core.macro.CompilationContextImpl)2 ITreeAppendable (org.eclipse.xtext.xbase.compiler.output.ITreeAppendable)2