This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-206
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-206 by this push:
new 36eee60 WIP.
36eee60 is described below
commit 36eee609ca5ecd83e494ea48342ec19f32fb9659
Author: Aaron Radzinzski <[email protected]>
AuthorDate: Wed Mar 10 23:58:55 2021 -0800
WIP.
---
.../nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
index 4f59ce1..81e30c2 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/compiler/NCDslBaselCompiler.scala
@@ -262,7 +262,11 @@ trait NCDslBaselCompiler {
val usedTok = f1 || f2
def doEq(op: String): Boolean = {
- if (isJLong(v1) && isJLong(v2))
+ if (v1 == null && v2 == null)
+ true
+ else if ((v1 == null && v2 != null) || (v1 != null && v2 == null))
+ false
+ else if (isJLong(v1) && isJLong(v2))
asJLong(v1) == asJLong(v2)
else if (isJDouble(v1) && isJDouble(v2))
asJDouble(v1) == asJDouble(v2)
@@ -272,11 +276,10 @@ trait NCDslBaselCompiler {
asStr(v1) == asStr(v2)
else if (isJList(v1) && isJList(v2))
asJList(v1).equals(asJList(v2))
- else
+ else {
throw rtBinaryOpError(op, v1, v2)
-
- }
-
+ }}
+
if (eq != null)
pushBool(doEq("=="), usedTok)
else {