@@ -2,7 +2,9 @@ package no.uio.microobject.ast.stmt
2
2
3
3
import com.sksamuel.hoplite.ConfigLoader
4
4
import no.uio.microobject.ast.*
5
+ import no.uio.microobject.ast.expr.FALSEEXPR
5
6
import no.uio.microobject.ast.expr.LiteralExpr
7
+ import no.uio.microobject.ast.expr.TRUEEXPR
6
8
import no.uio.microobject.runtime.*
7
9
import no.uio.microobject.type.*
8
10
import org.apache.jena.datatypes.xsd.XSDDatatype
@@ -80,12 +82,12 @@ data class AccessStmt(val target : Location, val query: Expression, val params :
80
82
else if (objNameCand.matches(" \\ d+" .toRegex()) || objNameCand.matches(" \\ d+\\ ^\\ ^http://www.w3.org/2001/XMLSchema#integer" .toRegex()))
81
83
newMemory[" content" ] = LiteralExpr (found.split(" ^^" )[0 ], INTTYPE )
82
84
else if (objNameCand.matches(" \\ d+" .toRegex()) || objNameCand.matches(" \\ d+\\ ^\\ ^http://www.w3.org/2001/XMLSchema#int" .toRegex()))
83
- LiteralExpr (found.split(" ^^" )[0 ], INTTYPE )
85
+ newMemory[ " content " ] = LiteralExpr (found.split(" ^^" )[0 ], INTTYPE )
84
86
else if (objNameCand.matches(" \\ d+.\\ d+" .toRegex())) newMemory[" content" ] =
85
87
LiteralExpr (found, DOUBLETYPE )
86
- else if (objNameCand == " true" || objNameCand == " false" ) LiteralExpr (found, BOOLEANTYPE )
87
- else if (objNameCand.matches( " (true|false) " .toRegex()) || objNameCand.matches( " ( true|false) \\ ^ \\ ^http://www.w3.org/2001/XMLSchema#boolean " .toRegex()))
88
- LiteralExpr (found.split( " ^^ " )[ 0 ], BOOLEANTYPE )
88
+ else if (objNameCand.matches( " ( true|false) " .toRegex()) || objNameCand.matches( " (true| false) \\ ^ \\ ^http://www.w3.org/2001/XMLSchema#boolean " .toRegex())) {
89
+ newMemory[ " content " ] = if (objNameCand.split( " ^^ " )[ 0 ] == " true" ) TRUEEXPR else FALSEEXPR
90
+ }
89
91
else throw Exception (" Query returned unknown object/literal: $found " )
90
92
}
91
93
newMemory[" next" ] = list
0 commit comments