in nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/compiler/NCIDLCodeGenerator.scala [388:416]
def parsePlusMinusExpr(plus: TN, minus: TN)(implicit ctx: PRC): SI = (_, stack: S, _) => {
val (x1, x2) = pop2()(stack, ctx)
if plus != null then
stack.push(() => {
val (v1, v2, n) = extract2(x1, x2)
if isStr(v1) && isStr(v2) then Z(s"${asStr(v1)}${asStr(v2)}", n)
else if isInt(v1) && isInt(v2) then Z(asInt(v1) + asInt(v2), n)
else if isInt(v1) && isReal(v2) then Z(asInt(v1) + asReal(v2), n)
else if isReal(v1) && isInt(v2) then Z(asReal(v1) + asInt(v2), n)
else if isReal(v1) && isReal(v2) then Z(asReal(v1) + asReal(v2), n)
else
throw rtBinaryOpError("+", v1, v2)
})
else
assert(minus != null)
stack.push(() => {
val (v1, v2, n) = extract2(x1, x2)
if isInt(v1) && isInt(v2) then Z(asInt(v1) - asInt(v2), n)
else if isInt(v1) && isReal(v2) then Z(asInt(v1) - asReal(v2), n)
else if isReal(v1) && isInt(v2) then Z(asReal(v1) - asInt(v2), n)
else if isReal(v1) && isReal(v2) then Z(asReal(v1) - asReal(v2), n)
else
throw rtBinaryOpError("-", v1, v2)
})
}