MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / doEval

Method doEval

src/main/java/fieldpython/PI.kt:256–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254 } catch (e: jep.JepException) {
255 e.printStackTrace()
256 val r = errorRegex.find(e.message!!)
257 if (r != null) // e.g syntax errors
258 {
259 val line = r.groupValues[1].toInt()
260 val char = r.groupValues[2].toInt()
261 lineErrors.accept(Pair(line, e.message!!.replace("<", " ").replace(">", " ")))
262 }
263
264 lineErrors.accept(
265 Pair(
266 e.stackTrace[0].lineNumber,
267 e.message!!.replace("<", " ").replace(">", " ")
268 )
269 )
270
271 return@inMainThread Pair(null, false)
272 }
273
274 return@inMainThread Pair(null, true)
275 }
276 }
277
278 private fun target(box: Box): String? {
279 return "box_" + box.properties.get(Box.name) + "|" + box.properties.getOrConstruct(IO.id);
280 }
281
282
283 override fun getBinding(name: String): Any? {
284 // this needs more sauce for sure given __localmap__
285 return pi.getValue(name)
286 }
287
288 override fun executeAll(
289 allText: String,
290 lineErrors: Consumer<Pair<Int, String>>,
291 success: Consumer<String>
292 ) {
293 executeTextFragment(allText, "", success, lineErrors)
294 }
295
296 override fun begin(
297 lineErrors: Consumer<Pair<Int, String>>,
298
299 success: Consumer<String>,
300 initiator: Map<String, Any>,
301 endOthers: Boolean

Callers

nothing calls this directly

Calls 7

PairClass · 0.85
replaceMethod · 0.80
setMethod · 0.65
execMethod · 0.65
acceptMethod · 0.65
inMainThreadMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected