Skip to content

Commit fdde06a

Browse files
committed
Merge branch 'topic/update_lkql_doc' into 'master'
Update and enhance the LKQL reference manual See merge request eng/libadalang/langkit-query-language!323
2 parents eaa6b66 + fc340e7 commit fdde06a

File tree

5 files changed

+758
-604
lines changed

5 files changed

+758
-604
lines changed

lkql_jit/language/src/main/java/com/adacore/lkql_jit/nodes/expressions/operators/IsClause.java

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55

66
package com.adacore.lkql_jit.nodes.expressions.operators;
77

8-
import com.adacore.libadalang.Libadalang;
9-
import com.adacore.lkql_jit.exception.LKQLRuntimeException;
108
import com.adacore.lkql_jit.nodes.expressions.Expr;
119
import com.adacore.lkql_jit.nodes.patterns.BasePattern;
12-
import com.adacore.lkql_jit.utils.LKQLTypesHelper;
13-
import com.oracle.truffle.api.dsl.Fallback;
1410
import com.oracle.truffle.api.dsl.NodeChild;
1511
import com.oracle.truffle.api.dsl.Specialization;
1612
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -47,26 +43,14 @@ protected IsClause(SourceSection location, BasePattern pattern) {
4743
// ----- Execution methods -----
4844

4945
/**
50-
* Execute the is clause when the expression is a node.
46+
* Execute the "is" clause on the provided value.
5147
*
52-
* @param frame The frame to execute the pattern in.
53-
* @param node The node to verify.
54-
* @return The result of the pattern execution.
48+
* @param object The value to match against the "is" clause pattern.
49+
* @return A boolean, representing whether the given value has been validated by the pattern.
5550
*/
5651
@Specialization
57-
protected boolean executeNode(VirtualFrame frame, Libadalang.AdaNode node) {
58-
return this.pattern.executeValue(frame, node);
59-
}
60-
61-
/**
62-
* Fallback method if the left operand is not a node.
63-
*
64-
* @param notNode The object that is not a node.
65-
*/
66-
@Fallback
67-
protected void notNode(Object notNode) {
68-
throw LKQLRuntimeException.wrongType(
69-
LKQLTypesHelper.ADA_NODE, LKQLTypesHelper.fromJava(notNode), this.getNodeExpr());
52+
protected boolean executeValue(VirtualFrame frame, Object object) {
53+
return this.pattern.executeValue(frame, object);
7054
}
7155

7256
// ----- Override methods -----
@@ -78,6 +62,4 @@ protected void notNode(Object notNode) {
7862
public String toString(int indentLevel) {
7963
return this.nodeRepresentation(indentLevel);
8064
}
81-
82-
public abstract Expr getNodeExpr();
8365
}

testsuite/tests/interpreter_errors/invalid_is_clause_left_operand/script.lkql

Lines changed: 0 additions & 1 deletion
This file was deleted.

testsuite/tests/interpreter_errors/invalid_is_clause_left_operand/test.out

Lines changed: 0 additions & 3 deletions
This file was deleted.

testsuite/tests/interpreter_errors/invalid_is_clause_left_operand/test.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)