Search in sources :

Example 1 with LambdaExpression

use of com.google.devtools.j2objc.ast.LambdaExpression in project j2objc by google.

the class TreeConverter method convertLambdaExpression.

private static TreeNode convertLambdaExpression(org.eclipse.jdt.core.dom.LambdaExpression node) {
    LambdaExpression newNode = new LambdaExpression();
    convertFunctionalExpression(node, newNode);
    for (Object x : node.parameters()) {
        newNode.addParameter((VariableDeclaration) TreeConverter.convert(x));
    }
    return newNode.setBody(TreeConverter.convert(node.getBody()));
}
Also used : LambdaExpression(com.google.devtools.j2objc.ast.LambdaExpression)

Example 2 with LambdaExpression

use of com.google.devtools.j2objc.ast.LambdaExpression in project j2objc by google.

the class TreeConverter method convertLambda.

private TreeNode convertLambda(JCTree.JCLambda node) {
    LambdaExpression newNode = new LambdaExpression();
    convertFunctionalExpression(node, newNode);
    for (JCVariableDecl param : node.params) {
        newNode.addParameter((VariableDeclaration) convert(param));
    }
    return newNode.setBody(convert(node.getBody()));
}
Also used : LambdaExpression(com.google.devtools.j2objc.ast.LambdaExpression) JCVariableDecl(com.sun.tools.javac.tree.JCTree.JCVariableDecl)

Aggregations

LambdaExpression (com.google.devtools.j2objc.ast.LambdaExpression)2 JCVariableDecl (com.sun.tools.javac.tree.JCTree.JCVariableDecl)1