debugging stuff
This commit is contained in:
parent
3a0bc4dfe0
commit
ce12e8d615
@ -5,33 +5,49 @@ ENABLE leaking
|
|||||||
}
|
}
|
||||||
[START]{
|
[START]{
|
||||||
"Test 1:"
|
"Test 1:"
|
||||||
t=15
|
-- t=15
|
||||||
test=2*100
|
-- test=2*100
|
||||||
test2=[1,2,3,4,"HI"]
|
-- test2=[1,2,3,4,"HI"]
|
||||||
"test2 = $test2$"
|
-- test2[5]="HELLO"
|
||||||
"test = $test$"
|
-- "test2 = $test2$"
|
||||||
c=5
|
-- "test = $test$"
|
||||||
::HERE::
|
-- c=5
|
||||||
a,b="sdf",true
|
-- ::HERE::
|
||||||
"a,b,c = $a$ $b$ $c$"
|
-- a,b="sdf",true
|
||||||
food="yum"
|
-- "a,b,c = $a$ $b$ $c$"
|
||||||
test=true
|
-- food="yum"
|
||||||
stop=21
|
-- test=true
|
||||||
"food = $food$"
|
-- stop=21
|
||||||
"test = $test$"
|
-- "food = $food$"
|
||||||
"stop = $stop$"
|
-- "test = $test$"
|
||||||
"Test 2:"
|
-- "stop = $stop$"
|
||||||
testM(2+2,"Test")
|
-- "Test 2:"
|
||||||
count=0
|
-- "test2[1] = $test2[1]$"
|
||||||
::loop::
|
-- testM(2+2,"Test")
|
||||||
if count>10 then GOTO("end")|GOTO("continue")
|
-- testM(2+2,test2[5])
|
||||||
::continue::
|
-- count=0
|
||||||
"Count = $count$"
|
-- ::loop::
|
||||||
count=count+1
|
-- "Count = $count$"
|
||||||
if count>10 then GOTO("end")|GOTO("loop")
|
-- count=count+1
|
||||||
::end::
|
-- if count>10 then GOTO("end")|GOTO("loop")
|
||||||
"Done!"
|
-- ::end::
|
||||||
QUIT()
|
-- "Done!"
|
||||||
|
--JUMP("CallMe")
|
||||||
|
env=CreateENV()
|
||||||
|
food="Hi"
|
||||||
|
SetENV(env)
|
||||||
|
food="Hello"
|
||||||
|
"$food$"
|
||||||
|
env=GetDefualtENV()
|
||||||
|
SetENV(env)
|
||||||
|
"$food$"
|
||||||
|
--test=CallMe("This","is a test!")
|
||||||
|
"$test$"
|
||||||
|
"Did it work!"
|
||||||
|
--QUIT()
|
||||||
|
}
|
||||||
|
[CallMe:function(args1,args2)]{
|
||||||
|
"function was called!"
|
||||||
|
"CALL_TEST: $args1$ $args2$"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- (count==stop and name=="bob") ? GOTO(end) : GOTO(loop)
|
-- (count==stop and name=="bob") ? GOTO(end) : GOTO(loop)
|
||||||
@ -1,12 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Created by SharpDevelop.GetType
|
|
||||||
* User: Ryan
|
* User: Ryan
|
||||||
* Date: 8/17/2017
|
* Date: 8/17/2017
|
||||||
* Time: 11:54 AM
|
* Time: 11:54 AM
|
||||||
*
|
|
||||||
* To change this template use Tools | Options | Coding | Edit Standard Headers.
|
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@ -14,9 +12,9 @@ using System.Reflection;
|
|||||||
using parseManager;
|
using parseManager;
|
||||||
namespace parseManager
|
namespace parseManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// The parseManager is an Advance Config Script
|
||||||
/// Description of ParseManager.
|
/// It allows the user to run code while also definine variables
|
||||||
/// </summary>
|
/// This also has very flexible flow control meaning you can use it for chat logic and such
|
||||||
public class parseManager
|
public class parseManager
|
||||||
{
|
{
|
||||||
standardDefine _invoke = new standardDefine();
|
standardDefine _invoke = new standardDefine();
|
||||||
@ -25,12 +23,14 @@ namespace parseManager
|
|||||||
string _define;
|
string _define;
|
||||||
string _entry = "START";
|
string _entry = "START";
|
||||||
Type _defineType;
|
Type _defineType;
|
||||||
|
standardDefine def = new standardDefine();
|
||||||
MethodInfo _defineMethod;
|
MethodInfo _defineMethod;
|
||||||
object _defineClassObject;
|
object _defineClassObject;
|
||||||
chunk _currentChunk;
|
chunk _currentChunk;
|
||||||
chunk _lastChunk = null;
|
chunk _lastChunk = null;
|
||||||
readonly ENV _mainENV = new ENV();
|
readonly ENV _mainENV = new ENV();
|
||||||
public ENV _defualtENV;
|
public ENV _defualtENV;
|
||||||
|
Stack<ENV> _fStack = new Stack<ENV>();
|
||||||
Dictionary<string, bool> _flags = new Dictionary<string, bool>();
|
Dictionary<string, bool> _flags = new Dictionary<string, bool>();
|
||||||
Dictionary<string, chunk> _chunks = new Dictionary<string, chunk>();
|
Dictionary<string, chunk> _chunks = new Dictionary<string, chunk>();
|
||||||
Dictionary<string, string> _methods = new Dictionary<string, string>();
|
Dictionary<string, string> _methods = new Dictionary<string, string>();
|
||||||
@ -62,6 +62,10 @@ namespace parseManager
|
|||||||
_flags.Add("debugging", false);
|
_flags.Add("debugging", false);
|
||||||
_flags.Add("topdown", true);
|
_flags.Add("topdown", true);
|
||||||
}
|
}
|
||||||
|
public ENV Pop()
|
||||||
|
{
|
||||||
|
return _fStack.Pop();
|
||||||
|
}
|
||||||
public bool GetFlag(string flag)
|
public bool GetFlag(string flag)
|
||||||
{
|
{
|
||||||
bool f;
|
bool f;
|
||||||
@ -145,18 +149,57 @@ namespace parseManager
|
|||||||
{
|
{
|
||||||
_active = false;
|
_active = false;
|
||||||
}
|
}
|
||||||
|
public bool isRegisteredFunction(string method, out chunk o)
|
||||||
|
{
|
||||||
|
if (_chunks.TryGetValue(method, out o)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public object InvokeI(string method, object[] argsV, chunk c)
|
||||||
|
{
|
||||||
|
var ccP = _currentChunk.GetPos();
|
||||||
|
var ccN = _currentChunk.GetName();
|
||||||
|
var argsN = c.GetArgs();
|
||||||
|
var fEnv = new ENV();
|
||||||
|
fEnv.SetParent(_defualtENV);
|
||||||
|
for (int i = 0; i < argsN.Length; i++) {
|
||||||
|
fEnv[argsN[i]] = argsV[i];
|
||||||
|
}
|
||||||
|
var tempEnv = new ENV();
|
||||||
|
tempEnv[0] = ccN;
|
||||||
|
tempEnv[1] = ccP;
|
||||||
|
tempEnv[2] = _defualtENV;
|
||||||
|
_fStack.Push(tempEnv);
|
||||||
|
if (_fStack.Count > 1024) {
|
||||||
|
PushError("Stack Overflow!");
|
||||||
|
}
|
||||||
|
_defualtENV = fEnv;
|
||||||
|
Console.WriteLine(fEnv);
|
||||||
|
def.JUMP(method);
|
||||||
|
return fEnv; // TODO Handle returns
|
||||||
|
}
|
||||||
public object InvokeR(string method, object[] args)
|
public object InvokeR(string method, object[] args)
|
||||||
{
|
{
|
||||||
//try{
|
chunk c;
|
||||||
|
if (isRegisteredFunction(method, out c)) {
|
||||||
|
return InvokeI(method, args, c);
|
||||||
|
}
|
||||||
|
try {
|
||||||
_defineMethod = _defineType.GetMethod(method);
|
_defineMethod = _defineType.GetMethod(method);
|
||||||
return _defineMethod.Invoke(_defineClassObject, args);
|
return _defineMethod.Invoke(_defineClassObject, args);
|
||||||
// } catch {
|
} catch {
|
||||||
// PushError("Invalid method: "+method);
|
PushError("Invalid method: " + method);
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
public int InvokeNR(string method, object[] args)
|
public int InvokeNR(string method, object[] args)
|
||||||
{
|
{
|
||||||
|
chunk c;
|
||||||
|
if (isRegisteredFunction(method, out c)) {
|
||||||
|
InvokeI(method, args, c);
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
_defineMethod = _defineType.GetMethod(method);
|
_defineMethod = _defineType.GetMethod(method);
|
||||||
_defineMethod.Invoke(_defineClassObject, args);
|
_defineMethod.Invoke(_defineClassObject, args);
|
||||||
@ -164,6 +207,7 @@ namespace parseManager
|
|||||||
} catch {
|
} catch {
|
||||||
PushError("Invalid method: " + method);
|
PushError("Invalid method: " + method);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
public void SetBlock(string BLOCK)
|
public void SetBlock(string BLOCK)
|
||||||
@ -180,6 +224,10 @@ namespace parseManager
|
|||||||
{
|
{
|
||||||
return _defualtENV;
|
return _defualtENV;
|
||||||
}
|
}
|
||||||
|
public ENV GetDENV()
|
||||||
|
{
|
||||||
|
return _mainENV;
|
||||||
|
}
|
||||||
public void SetENV()
|
public void SetENV()
|
||||||
{
|
{
|
||||||
_defualtENV = _mainENV;
|
_defualtENV = _mainENV;
|
||||||
@ -319,20 +367,23 @@ namespace parseManager
|
|||||||
tempReturn.SetText("INVOKED METHOD: " + func);
|
tempReturn.SetText("INVOKED METHOD: " + func);
|
||||||
} else if (type == "LINE") {
|
} else if (type == "LINE") {
|
||||||
tempReturn.SetCMDType("line");
|
tempReturn.SetCMDType("line");
|
||||||
var test=parseHeader((string)stuff[0]);
|
var test = parseHeader((string)stuff[0]);
|
||||||
tempReturn.SetText(test.Substring(1,test.Length-2));
|
tempReturn.SetText(test.Substring(1, test.Length - 2));
|
||||||
} else if (type == "FUNC_R") {
|
} else if (type == "FUNC_R") {
|
||||||
var retargs = (string[])stuff[0];
|
var retargs = (string[])stuff[0];
|
||||||
var func = (string)stuff[1];
|
var func = (string)stuff[1];
|
||||||
var args = (string[])stuff[2];
|
var args = (string[])stuff[2];
|
||||||
object data;
|
object data;
|
||||||
|
var env = GetENV();
|
||||||
|
Console.WriteLine("CALLING: " + func);
|
||||||
if (args.Length == 1 && args[0] == "") { // assume no args inserted!
|
if (args.Length == 1 && args[0] == "") { // assume no args inserted!
|
||||||
data = InvokeR(func, new object[]{ });
|
data = InvokeR(func, new object[]{ });
|
||||||
} else {
|
} else {
|
||||||
data = InvokeR(func, ResolveVar(args));
|
data = InvokeR(func, ResolveVar(args));
|
||||||
}
|
}
|
||||||
var env = GetENV();
|
Console.WriteLine("RETURN: "+retargs[0]+"|"+data);
|
||||||
env[retargs[0]] = data;
|
env[retargs[0]] = data;
|
||||||
|
Console.WriteLine(env);
|
||||||
GLOBALS.Add_Var(retargs[0]);
|
GLOBALS.Add_Var(retargs[0]);
|
||||||
tempReturn.SetCMDType("method");
|
tempReturn.SetCMDType("method");
|
||||||
tempReturn.SetText("INVOKED METHOD: " + func);
|
tempReturn.SetText("INVOKED METHOD: " + func);
|
||||||
@ -341,15 +392,41 @@ namespace parseManager
|
|||||||
var vals = (string[])stuff[1];
|
var vals = (string[])stuff[1];
|
||||||
var env = GetENV();
|
var env = GetENV();
|
||||||
var types = ResolveVar(vals);
|
var types = ResolveVar(vals);
|
||||||
for (int i = 0; i < types.Length; i++) {
|
AssignmentHandler(vars, types);
|
||||||
env[vars[i]] = types[i];
|
|
||||||
GLOBALS.Add_Var(vars[i]);
|
|
||||||
}
|
|
||||||
tempReturn.SetCMDType("assignment");
|
tempReturn.SetCMDType("assignment");
|
||||||
tempReturn.SetText(_currentChunk.GetLine());
|
tempReturn.SetText(_currentChunk.GetLine());
|
||||||
}
|
}
|
||||||
return tempReturn;
|
return tempReturn;
|
||||||
}
|
}
|
||||||
|
public void AssignmentHandler(string[] vars, object[] types)
|
||||||
|
{
|
||||||
|
var env = GetENV();
|
||||||
|
for (int i = 0; i < types.Length; i++) {
|
||||||
|
var test = vars[i];
|
||||||
|
if (test.EndsWith("]")) {
|
||||||
|
var dict = Regex.Match(test, @"(.*)\[(.+)\]");
|
||||||
|
var _var = dict.Groups[1].Value;
|
||||||
|
var _val = dict.Groups[2].Value;
|
||||||
|
var val = ResolveVar(new []{ _val });
|
||||||
|
var _e = env[_var];
|
||||||
|
if (!_e.GetType().ToString().Contains("ENV")) {
|
||||||
|
PushError("Attempted to index a object that isn't a table!");
|
||||||
|
} else {
|
||||||
|
var e = (ENV)_e;
|
||||||
|
if (val[0].GetType().ToString().Contains("Double")) {
|
||||||
|
e[int.Parse(val[0].ToString())] = types[i];
|
||||||
|
} else if (val[0].GetType().ToString().Contains("String")) {
|
||||||
|
e[(string)val[0]] = types[i];
|
||||||
|
} else {
|
||||||
|
PushError("Invalid index type: " + val[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
env[vars[i]] = types[i];
|
||||||
|
GLOBALS.Add_Var(vars[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public string parseHeader(string header)
|
public string parseHeader(string header)
|
||||||
{
|
{
|
||||||
var results = Regex.Matches(header, @"(\$.*?\$)");
|
var results = Regex.Matches(header, @"(\$.*?\$)");
|
||||||
@ -388,6 +465,26 @@ namespace parseManager
|
|||||||
env[g] = res[g];
|
env[g] = res[g];
|
||||||
}
|
}
|
||||||
args[i] = env;
|
args[i] = env;
|
||||||
|
debug("TABLE: " + env);
|
||||||
|
} else if (v[i].EndsWith("]")) {
|
||||||
|
var dict = Regex.Match(v[i], @"(.*)\[(.+)\]");
|
||||||
|
var _var = dict.Groups[1].Value;
|
||||||
|
var _val = dict.Groups[2].Value;
|
||||||
|
var val2 = ResolveVar(new []{ _val });
|
||||||
|
var env = GetENV();
|
||||||
|
var _e = env[_var];
|
||||||
|
if (!_e.GetType().ToString().Contains("ENV")) {
|
||||||
|
PushError("Attempted to index a object that isn't a table!");
|
||||||
|
} else {
|
||||||
|
var e = (ENV)_e;
|
||||||
|
if (val2[0].GetType().ToString().Contains("Double")) {
|
||||||
|
args[i] = e[int.Parse(val2[0].ToString())];
|
||||||
|
} else if (val2[0].GetType().ToString().Contains("String")) {
|
||||||
|
args[i] = e[(string)val2[0]];
|
||||||
|
} else {
|
||||||
|
PushError("Invalid index type: " + val2[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (isVar(v[i], out val)) {
|
} else if (isVar(v[i], out val)) {
|
||||||
args[i] = val;
|
args[i] = val;
|
||||||
debug("RETREVING SAVED VAL");
|
debug("RETREVING SAVED VAL");
|
||||||
@ -395,7 +492,7 @@ namespace parseManager
|
|||||||
args[i] = num;
|
args[i] = num;
|
||||||
debug("NUMBER: " + num);
|
debug("NUMBER: " + num);
|
||||||
} else if (v[i][0] == '"' && v[i][v[i].Length - 1] == '"') {
|
} else if (v[i][0] == '"' && v[i][v[i].Length - 1] == '"') {
|
||||||
args[i] = parseHeader(v[i].Substring(1, v[i].Length - 2));
|
args[i] = parseHeader(v[i].Replace("\"", ""));
|
||||||
debug("STRING: " + args[i]);
|
debug("STRING: " + args[i]);
|
||||||
} else if (bool.TryParse(v[i], out boo)) {
|
} else if (bool.TryParse(v[i], out boo)) {
|
||||||
args[i] = boo;
|
args[i] = boo;
|
||||||
@ -410,10 +507,34 @@ namespace parseManager
|
|||||||
}
|
}
|
||||||
public bool isVar(string val, out object v)
|
public bool isVar(string val, out object v)
|
||||||
{
|
{
|
||||||
if (_defualtENV[val] != null) {
|
object va;
|
||||||
v = _defualtENV[val];
|
Console.WriteLine(val);
|
||||||
|
if (_defualtENV.TryGetValue(val, out va)) {
|
||||||
|
v = va;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (val.EndsWith("]")) {
|
||||||
|
var dict = Regex.Match(val, @"(.*)\[(.+)\]");
|
||||||
|
var _var = dict.Groups[1].Value;
|
||||||
|
var _val = dict.Groups[2].Value;
|
||||||
|
var val2 = ResolveVar(new []{ _val });
|
||||||
|
var env = GetENV();
|
||||||
|
var _e = env[_var];
|
||||||
|
if (!_e.GetType().ToString().Contains("ENV")) {
|
||||||
|
PushError("Attempted to index a object that isn't a table!");
|
||||||
|
} else {
|
||||||
|
var e = (ENV)_e;
|
||||||
|
if (val2[0].GetType().ToString().Contains("Double")) {
|
||||||
|
v = e[int.Parse(val2[0].ToString())];
|
||||||
|
return true;
|
||||||
|
} else if (val2[0].GetType().ToString().Contains("String")) {
|
||||||
|
v = e[(string)val2[0]];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
PushError("Invalid index type: " + val2[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
v = null;
|
v = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -427,10 +548,41 @@ namespace parseManager
|
|||||||
string _type;
|
string _type;
|
||||||
string _pureType;
|
string _pureType;
|
||||||
string[] _lines;
|
string[] _lines;
|
||||||
|
string[] args;
|
||||||
|
bool isFunc;
|
||||||
Dictionary<string, int> _labels = new Dictionary<string, int>();
|
Dictionary<string, int> _labels = new Dictionary<string, int>();
|
||||||
List<CMD> _compiledlines = new List<CMD>();
|
List<CMD> _compiledlines = new List<CMD>();
|
||||||
int _pos = 0;
|
int _pos = 0;
|
||||||
chunk _next = null;
|
chunk _next = null;
|
||||||
|
public string[] GetArgs()
|
||||||
|
{
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
public chunk(string name, string cont, string type)
|
||||||
|
{
|
||||||
|
_BLOCK = name;
|
||||||
|
_type = type;
|
||||||
|
if (type.Contains("function")) {
|
||||||
|
isFunc = true;
|
||||||
|
var func = Regex.Match(type, @"\((.+)\)");
|
||||||
|
args = GLOBALS.Split(func.Groups[1].Value);
|
||||||
|
_compiledlines.Add(new CMD("FUNC", new object[] {
|
||||||
|
"TRACEBACK",
|
||||||
|
new string[]{ }
|
||||||
|
})); // Append the traceback method to the chunk
|
||||||
|
}
|
||||||
|
_clean(cont);
|
||||||
|
}
|
||||||
|
public bool isFunction()
|
||||||
|
{
|
||||||
|
return isFunc;
|
||||||
|
}
|
||||||
|
public chunk(string name, string cont)
|
||||||
|
{
|
||||||
|
_BLOCK = name;
|
||||||
|
_type = "CODEBLOCK";
|
||||||
|
_clean(cont);
|
||||||
|
}
|
||||||
void _clean(string cont)
|
void _clean(string cont)
|
||||||
{
|
{
|
||||||
var m = Regex.Match(_type, @"([a-zA-Z0-9_]+)");
|
var m = Regex.Match(_type, @"([a-zA-Z0-9_]+)");
|
||||||
@ -537,18 +689,6 @@ namespace parseManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public chunk(string name, string cont, string type)
|
|
||||||
{
|
|
||||||
_BLOCK = name;
|
|
||||||
_type = type;
|
|
||||||
_clean(cont);
|
|
||||||
}
|
|
||||||
public chunk(string name, string cont)
|
|
||||||
{
|
|
||||||
_BLOCK = name;
|
|
||||||
_type = "CODEBLOCK";
|
|
||||||
_clean(cont);
|
|
||||||
}
|
|
||||||
public string GetName()
|
public string GetName()
|
||||||
{
|
{
|
||||||
return _BLOCK;
|
return _BLOCK;
|
||||||
@ -706,7 +846,14 @@ namespace parseManager
|
|||||||
if (!loop) {
|
if (!loop) {
|
||||||
object t;
|
object t;
|
||||||
if (env.TryGetValue(cmd, out t)) {
|
if (env.TryGetValue(cmd, out t)) {
|
||||||
|
double te;
|
||||||
|
if (t.GetType().ToString().Contains("Double"))
|
||||||
return (double)t;
|
return (double)t;
|
||||||
|
if(t.GetType().ToString().Contains("String"))
|
||||||
|
if (double.TryParse((string)t, out te)) {
|
||||||
|
return te;
|
||||||
|
}
|
||||||
|
return double.NaN;
|
||||||
} else {
|
} else {
|
||||||
t = double.NaN; // It couldn't be done :'(
|
t = double.NaN; // It couldn't be done :'(
|
||||||
}
|
}
|
||||||
@ -719,20 +866,20 @@ namespace parseManager
|
|||||||
ENV _Parent;
|
ENV _Parent;
|
||||||
Dictionary<string, object> _vars = new Dictionary<string, object>();
|
Dictionary<string, object> _vars = new Dictionary<string, object>();
|
||||||
Dictionary<int, object> _varsI = new Dictionary<int, object>();
|
Dictionary<int, object> _varsI = new Dictionary<int, object>();
|
||||||
void SetParent(ENV other)
|
public void SetParent(ENV other)
|
||||||
{
|
{
|
||||||
_Parent = other;
|
_Parent = other;
|
||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
string str = "";
|
string str = "(";
|
||||||
foreach (KeyValuePair<string, object> entry in _vars) {
|
foreach (KeyValuePair<string, object> entry in _vars) {
|
||||||
str+=entry.Key+" = "+entry.Value+",";
|
str += "[\"" + entry.Key + "\"] = " + entry.Value + ", ";
|
||||||
}
|
}
|
||||||
foreach (KeyValuePair<int, object> entry in _varsI) {
|
foreach (KeyValuePair<int, object> entry in _varsI) {
|
||||||
str+="["+entry.Key+"] = "+entry.Value+", ";
|
str += "[" + entry.Key + "] = " + entry.Value + ", ";
|
||||||
}
|
}
|
||||||
return str;
|
return str + ")";
|
||||||
}
|
}
|
||||||
public bool TryGetValue(string ind, out object obj)
|
public bool TryGetValue(string ind, out object obj)
|
||||||
{
|
{
|
||||||
@ -934,6 +1081,15 @@ namespace parseManager
|
|||||||
}
|
}
|
||||||
public class standardDefine
|
public class standardDefine
|
||||||
{
|
{
|
||||||
|
public void TRACEBACK()
|
||||||
|
{
|
||||||
|
var test = GLOBALS.GetPM();
|
||||||
|
ENV env = test.Pop();
|
||||||
|
test.SetBlock((string)env[0]);
|
||||||
|
var c = test.GetCurrentChunk();
|
||||||
|
c.SetPos((int)env[1]);
|
||||||
|
SetENV((ENV)env[3]);
|
||||||
|
}
|
||||||
public void EXIT()
|
public void EXIT()
|
||||||
{
|
{
|
||||||
GLOBALS.GetPM().Deactivate();
|
GLOBALS.GetPM().Deactivate();
|
||||||
@ -942,6 +1098,25 @@ public class standardDefine
|
|||||||
{
|
{
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
public void SetENV(ENV env)
|
||||||
|
{
|
||||||
|
var test = GLOBALS.GetPM();
|
||||||
|
test.SetENV(env);
|
||||||
|
}
|
||||||
|
public ENV GetENV()
|
||||||
|
{
|
||||||
|
var test = GLOBALS.GetPM();
|
||||||
|
return test.GetENV();
|
||||||
|
}
|
||||||
|
public ENV GetDefualtENV()
|
||||||
|
{
|
||||||
|
var test = GLOBALS.GetPM();
|
||||||
|
return test.GetDENV();
|
||||||
|
}
|
||||||
|
public ENV CreateENV()
|
||||||
|
{
|
||||||
|
return new ENV();
|
||||||
|
}
|
||||||
public int GOTO(string label)
|
public int GOTO(string label)
|
||||||
{
|
{
|
||||||
var test = GLOBALS.GetPM();
|
var test = GLOBALS.GetPM();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user