| 218 | writer |
| 219 | ) { |
| 220 | currentLineNumber = it |
| 221 | } |
| 222 | |
| 223 | val res = doEval(textFragment, lineErrors, success) |
| 224 | |
| 225 | println(" result is $res") |
| 226 | |
| 227 | RemoteEditor.boxFeedback(Optional.of(box), Vec4(0.3, 0.7, 0.3, 0.5)) |
| 228 | |
| 229 | return null |
| 230 | } finally { |
| 231 | Execution.context.get().pop() |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | |
| 236 | private fun doEval( |
| 237 | textFragment: String, |
| 238 | lineErrors: Consumer<Pair<Int, String>>, |
| 239 | success: Consumer<String> |
| 240 | ): Pair<Any?, Boolean> { |
| 241 | |
| 242 | return ThreadSync2.inMainThread { |
| 243 | var errored = false |
| 244 | |
| 245 | // println(" -- PI doeval in thread " + Thread.currentThread() + " " + pi.second) |
| 246 | pi.set("__writer__", writer) |
| 247 | // pi.second.put("_", box) |
| 248 | try { |
| 249 | // pi.exec(textFragment) |
| 250 | pi.set("__fragment__", textFragment) |
| 251 | pi.set("_", box) |
| 252 | pi.exec("__fieldeval__(__fragment__, __localmap__[_])") |
| 253 | // pi.first.exec(textFragment) |
| 254 | } catch (e: jep.JepException) { |
| 255 | e.printStackTrace() |
| 256 | val r = errorRegex.find(e.message!!) |
nothing calls this directly
no test coverage detected