Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
2ac0fdf6ed | |||
98f81fd35b | |||
6eb84aaef3 | |||
e1c4d442af | |||
2f8aaade55 |
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -3,6 +3,3 @@ test*.isbpl
|
||||||
*.jar
|
*.jar
|
||||||
*.bf.isbpl
|
*.bf.isbpl
|
||||||
rust-interpreter
|
rust-interpreter
|
||||||
.idea
|
|
||||||
*.iml
|
|
||||||
out
|
|
||||||
|
|
|
@ -48,6 +48,13 @@ public class ISBPL {
|
||||||
boolean stopExceptions = false;
|
boolean stopExceptions = false;
|
||||||
HashMap<Throwable, Stack<ISBPLFrame>> stackTraces = new HashMap<>();
|
HashMap<Throwable, Stack<ISBPLFrame>> stackTraces = new HashMap<>();
|
||||||
|
|
||||||
|
public static void clean() {
|
||||||
|
System.out.println("ISBPL CLEAN!!");
|
||||||
|
defaultTypeInt = new ISBPLType("int", -2);
|
||||||
|
defaultTypeString = new ISBPLType("string", -1);
|
||||||
|
ISBPLStreamer.streams.clear();
|
||||||
|
}
|
||||||
|
|
||||||
private final Object syncMakeThread = new Object();
|
private final Object syncMakeThread = new Object();
|
||||||
private ISBPLKeyword getKeyword(String word) {
|
private ISBPLKeyword getKeyword(String word) {
|
||||||
switch (word) {
|
switch (word) {
|
||||||
|
@ -1514,8 +1521,8 @@ public class ISBPL {
|
||||||
}
|
}
|
||||||
|
|
||||||
// These will die as soon as std creates the real types and any types created before these are replaced become invalid.
|
// These will die as soon as std creates the real types and any types created before these are replaced become invalid.
|
||||||
static final ISBPLType defaultTypeInt = new ISBPLType("int", -2);
|
static ISBPLType defaultTypeInt = new ISBPLType("int", -2);
|
||||||
static final ISBPLType defaultTypeString = new ISBPLType("string", -1);
|
static ISBPLType defaultTypeString = new ISBPLType("string", -1);
|
||||||
|
|
||||||
public ISBPLType getType(String name) {
|
public ISBPLType getType(String name) {
|
||||||
for (int i = 0 ; i < types.size() ; i++) {
|
for (int i = 0 ; i < types.size() ; i++) {
|
||||||
|
@ -2485,7 +2492,7 @@ class ISBPLFrame {
|
||||||
public ISBPL context;
|
public ISBPL context;
|
||||||
public ISBPLFrame parent;
|
public ISBPLFrame parent;
|
||||||
public HashMap<String, ISBPLCallable> map = new HashMap<>();
|
public HashMap<String, ISBPLCallable> map = new HashMap<>();
|
||||||
public HashMap<String, ISBPLObject> variables = new HashMap<>();
|
public HashMap<Object, ISBPLObject> variables = new HashMap<>();
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
public ISBPLFrame(String name, ISBPL context) {
|
public ISBPLFrame(String name, ISBPL context) {
|
||||||
|
@ -2518,9 +2525,10 @@ class ISBPLFrame {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void define(String name, ISBPLObject value) {
|
public void define(String name, ISBPLObject value) {
|
||||||
variables.put(name, value);
|
Object var = new Object();
|
||||||
add(name, (stack) -> stack.push(variables.get(name)));
|
variables.put(var, value);
|
||||||
add("=" + name, (stack) -> variables.put(name, stack.pop()));
|
add(name, (stack) -> stack.push(variables.get(var)));
|
||||||
|
add("=" + name, (stack) -> variables.put(var, stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, ISBPLCallable> all() {
|
public HashMap<String, ISBPLCallable> all() {
|
||||||
|
@ -2529,5 +2537,3 @@ class ISBPLFrame {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface
|
|
|
@ -3,6 +3,8 @@ Improved Stack-Based Programming Language
|
||||||
|
|
||||||
Incomplete, not currently compilable, only interpretable.
|
Incomplete, not currently compilable, only interpretable.
|
||||||
|
|
||||||
|
ISBPL is now obsolete. Try [SPL](https://github.com/tudbut/spl) instead.
|
||||||
|
|
||||||
Stuff: [TudbuT/isbpl-random-stuff](https://github.com/TudbuT/isbpl-random-stuff)
|
Stuff: [TudbuT/isbpl-random-stuff](https://github.com/TudbuT/isbpl-random-stuff)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in a new issue