isbpl/multi.isbpl

44 lines
1.3 KiB
Text
Raw Normal View History

2022-05-14 16:11:10 +02:00
"multi.isbpl: Library for creating and controlling other ISBPL contexts." #
"This library is not supported when using a modded ISBPL.java, but it should be usable unless core functions are changed." #
"obtain ISBPL class (we don't know its package, so we use this workaround)" #
def ISBPL JIO context getClass0 getName0 JIO class =ISBPL
def ISBPLStack JIO stack getClass0 getName0 JIO class =ISBPLStack
2022-05-15 19:53:08 +02:00
def File "java.io.File" JIO class =File
2022-05-14 16:11:10 +02:00
"wrapper for jContext" #
def Context construct Context {
jContext # "real context"
;
construct {
def this =this
ISBPL new0 this =jContext
"native include \"#std.isbpl\" include" this eval
this
}
eval {
def this =this
"multi.isbpl:_eval" File new1 swap JIO stack this jContext interpret3
}
makeStack {
pop
ISBPLStack new0
}
evalNewStack {
def this =this
def stack
"multi.isbpl:_eval" File new1 swap ISBPLStack new0 dup =stack this jContext interpret3
stack
}
evalCustom {
def this =this
def stack =stack
def toRun =toRun
2022-05-16 01:53:07 +02:00
"multi.isbpl:_eval" File new1 toRun stack this jContext interpret3
2022-05-14 16:11:10 +02:00
stack
}
2022-05-16 01:40:49 +02:00
copyFunc {
def this =this
2022-05-16 01:43:36 +02:00
swap this jContext level0 add2
2022-05-16 01:40:49 +02:00
}
2022-05-15 19:49:43 +02:00
} =Context