Skip to content

Commit

Permalink
Merge branch 'topic/java_api/bare_node_wrapping' into 'master'
Browse files Browse the repository at this point in the history
Adapt LKQL JIT to the new node wrapping procedure

See merge request eng/libadalang/langkit-query-language!187
  • Loading branch information
HugoGGuerrier committed Apr 3, 2024
2 parents bbd52ff + 4e16a8b commit b023da4
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,8 @@ else if (javaValue instanceof Libadalang.Aspect aspect) {
Object[] values = {
aspect.exists,
aspect.inherited,
aspect.node.node.isNull()
? LKQLNull.INSTANCE
: Libadalang.AdaNode.fromEntity(aspect.node),
aspect.value.node.isNull()
? LKQLNull.INSTANCE
: Libadalang.AdaNode.fromEntity(aspect.value)
aspect.node.isNone() ? LKQLNull.INSTANCE : aspect.node,
aspect.value.isNone() ? LKQLNull.INSTANCE : aspect.value
};
return LKQLObject.createUncached(keys, values);
}
Expand All @@ -292,20 +288,15 @@ else if (javaValue instanceof Libadalang.RefResult refResultStruct) {
String[] keys = {"kind", "ref"};
Object[] values = {
toLKQLValue(refResultStruct.kind),
refResultStruct.ref.node.isNull()
? LKQLNull.INSTANCE
: Libadalang.AdaNode.fromEntity(refResultStruct.ref)
refResultStruct.ref.isNone() ? LKQLNull.INSTANCE : refResultStruct.ref
};
return LKQLObject.createUncached(keys, values);
}

// If the source is a parameter-actual structure
else if (javaValue instanceof Libadalang.ParamActual paramActual) {
String[] keys = {"actual", "param"};
Object[] values = {
Libadalang.AdaNode.fromEntity(paramActual.actual),
Libadalang.AdaNode.fromEntity(paramActual.param)
};
Object[] values = {paramActual.actual, paramActual.param};
return LKQLObject.createUncached(keys, values);
}

Expand Down

0 comments on commit b023da4

Please sign in to comment.