Xanathar hace 11 años
padre
commit
dd47e8084c

+ 152 - 152
src/MoonSharp.Debugger/MainForm.Designer.cs

@@ -59,11 +59,17 @@
 			this.toolStepIN = new System.Windows.Forms.ToolStripButton();
 			this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
 			this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
+			this.btnFollow = new System.Windows.Forms.ToolStripButton();
 			this.statusStrip1 = new System.Windows.Forms.StatusStrip();
 			this.splitContainer1 = new System.Windows.Forms.SplitContainer();
 			this.splitContainer2 = new System.Windows.Forms.SplitContainer();
 			this.tabControl2 = new System.Windows.Forms.TabControl();
 			this.tabPage3 = new System.Windows.Forms.TabPage();
+			this.lvWatches = new MoonSharp.Debugger.DoubleBufferedListView();
+			this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
 			this.toolStrip2 = new System.Windows.Forms.ToolStrip();
 			this.btnAddWatch = new System.Windows.Forms.ToolStripButton();
 			this.btnRemoveWatch = new System.Windows.Forms.ToolStripButton();
@@ -72,6 +78,10 @@
 			this.toolGoToCodeWatches = new System.Windows.Forms.ToolStripButton();
 			this.label3 = new System.Windows.Forms.Label();
 			this.tabPage4 = new System.Windows.Forms.TabPage();
+			this.lvVStack = new MoonSharp.Debugger.DoubleBufferedListView();
+			this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
 			this.toolStrip3 = new System.Windows.Forms.ToolStrip();
 			this.btnViewVStk = new System.Windows.Forms.ToolStripButton();
 			this.toolGoToCodeVStack = new System.Windows.Forms.ToolStripButton();
@@ -79,29 +89,19 @@
 			this.imageList1 = new System.Windows.Forms.ImageList(this.components);
 			this.tabControl1 = new System.Windows.Forms.TabControl();
 			this.tabPage1 = new System.Windows.Forms.TabPage();
+			this.lvCallStack = new MoonSharp.Debugger.DoubleBufferedListView();
+			this.colAddress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.colName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.colReturn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+			this.colBP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
 			this.toolStrip4 = new System.Windows.Forms.ToolStrip();
 			this.toolGoToCodeXStack = new System.Windows.Forms.ToolStripButton();
 			this.tabPage2 = new System.Windows.Forms.TabPage();
 			this.label1 = new System.Windows.Forms.Label();
 			this.splitContainer3 = new System.Windows.Forms.SplitContainer();
+			this.codeView = new MoonSharp.Debugger.SourceCodeDebugControl();
 			this.txtOutput = new System.Windows.Forms.TextBox();
-			this.btnFollow = new System.Windows.Forms.ToolStripButton();
 			this.timerFollow = new System.Windows.Forms.Timer(this.components);
-			this.lvWatches = new MoonSharp.Debugger.DoubleBufferedListView();
-			this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.lvVStack = new MoonSharp.Debugger.DoubleBufferedListView();
-			this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.lvCallStack = new MoonSharp.Debugger.DoubleBufferedListView();
-			this.colAddress = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.colName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.colReturn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.colBP = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-			this.codeView = new MoonSharp.Debugger.SourceCodeDebugControl();
 			this.menuStrip1.SuspendLayout();
 			this.toolStrip1.SuspendLayout();
 			this.splitContainer1.Panel1.SuspendLayout();
@@ -373,6 +373,16 @@
 			this.toolStripButton5.Size = new System.Drawing.Size(23, 22);
 			this.toolStripButton5.Text = "toolStripButton5";
 			// 
+			// btnFollow
+			// 
+			this.btnFollow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+			this.btnFollow.Image = ((System.Drawing.Image)(resources.GetObject("btnFollow.Image")));
+			this.btnFollow.ImageTransparentColor = System.Drawing.Color.Magenta;
+			this.btnFollow.Name = "btnFollow";
+			this.btnFollow.Size = new System.Drawing.Size(46, 22);
+			this.btnFollow.Text = "Follow";
+			this.btnFollow.Click += new System.EventHandler(this.btnFollow_Click);
+			// 
 			// statusStrip1
 			// 
 			this.statusStrip1.Location = new System.Drawing.Point(0, 712);
@@ -442,6 +452,45 @@
 			this.tabPage3.Text = "Watches";
 			this.tabPage3.UseVisualStyleBackColor = true;
 			// 
+			// lvWatches
+			// 
+			this.lvWatches.BackColor = System.Drawing.SystemColors.Window;
+			this.lvWatches.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+			this.lvWatches.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvWatches.FullRowSelect = true;
+			this.lvWatches.GridLines = true;
+			this.lvWatches.Location = new System.Drawing.Point(3, 28);
+			this.lvWatches.Name = "lvWatches";
+			this.lvWatches.Size = new System.Drawing.Size(350, 249);
+			this.lvWatches.TabIndex = 4;
+			this.lvWatches.UseCompatibleStateImageBehavior = false;
+			this.lvWatches.View = System.Windows.Forms.View.Details;
+			this.lvWatches.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvWatches_MouseDoubleClick);
+			// 
+			// columnHeader1
+			// 
+			this.columnHeader1.Text = "Name";
+			this.columnHeader1.Width = 72;
+			// 
+			// columnHeader2
+			// 
+			this.columnHeader2.Text = "Type";
+			this.columnHeader2.Width = 57;
+			// 
+			// columnHeader3
+			// 
+			this.columnHeader3.Text = "Value";
+			this.columnHeader3.Width = 111;
+			// 
+			// columnHeader4
+			// 
+			this.columnHeader4.Text = "Symbol loc.";
+			this.columnHeader4.Width = 72;
+			// 
 			// toolStrip2
 			// 
 			this.toolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -522,6 +571,39 @@
 			this.tabPage4.Text = "V-Stack";
 			this.tabPage4.UseVisualStyleBackColor = true;
 			// 
+			// lvVStack
+			// 
+			this.lvVStack.BackColor = System.Drawing.SystemColors.Window;
+			this.lvVStack.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader5,
+            this.columnHeader6,
+            this.columnHeader7});
+			this.lvVStack.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvVStack.FullRowSelect = true;
+			this.lvVStack.GridLines = true;
+			this.lvVStack.Location = new System.Drawing.Point(3, 28);
+			this.lvVStack.Name = "lvVStack";
+			this.lvVStack.Size = new System.Drawing.Size(350, 249);
+			this.lvVStack.TabIndex = 7;
+			this.lvVStack.UseCompatibleStateImageBehavior = false;
+			this.lvVStack.View = System.Windows.Forms.View.Details;
+			this.lvVStack.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvVStack_MouseDoubleClick);
+			// 
+			// columnHeader5
+			// 
+			this.columnHeader5.Text = "Stack ofs";
+			this.columnHeader5.Width = 72;
+			// 
+			// columnHeader6
+			// 
+			this.columnHeader6.Text = "Type";
+			this.columnHeader6.Width = 94;
+			// 
+			// columnHeader7
+			// 
+			this.columnHeader7.Text = "Value";
+			this.columnHeader7.Width = 157;
+			// 
 			// toolStrip3
 			// 
 			this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -596,6 +678,44 @@
 			this.tabPage1.Text = "Call Stack";
 			this.tabPage1.UseVisualStyleBackColor = true;
 			// 
+			// lvCallStack
+			// 
+			this.lvCallStack.BackColor = System.Drawing.SystemColors.Window;
+			this.lvCallStack.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.colAddress,
+            this.colName,
+            this.colReturn,
+            this.colBP});
+			this.lvCallStack.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvCallStack.FullRowSelect = true;
+			this.lvCallStack.GridLines = true;
+			this.lvCallStack.Location = new System.Drawing.Point(3, 28);
+			this.lvCallStack.Name = "lvCallStack";
+			this.lvCallStack.Size = new System.Drawing.Size(350, 294);
+			this.lvCallStack.TabIndex = 8;
+			this.lvCallStack.UseCompatibleStateImageBehavior = false;
+			this.lvCallStack.View = System.Windows.Forms.View.Details;
+			// 
+			// colAddress
+			// 
+			this.colAddress.Text = "Address";
+			this.colAddress.Width = 72;
+			// 
+			// colName
+			// 
+			this.colName.Text = "Name";
+			this.colName.Width = 106;
+			// 
+			// colReturn
+			// 
+			this.colReturn.Text = "Return";
+			this.colReturn.Width = 72;
+			// 
+			// colBP
+			// 
+			this.colBP.Text = "Base Ptr";
+			this.colBP.Width = 72;
+			// 
 			// toolStrip4
 			// 
 			this.toolStrip4.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -656,6 +776,21 @@
 			this.splitContainer3.SplitterDistance = 446;
 			this.splitContainer3.TabIndex = 0;
 			// 
+			// codeView
+			// 
+			this.codeView.ActiveLine = -1;
+			this.codeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
+			this.codeView.CursorLine = 0;
+			this.codeView.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.codeView.Font = new System.Drawing.Font("Consolas", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+			this.codeView.ForeColor = System.Drawing.Color.Gainsboro;
+			this.codeView.Location = new System.Drawing.Point(0, 0);
+			this.codeView.Margin = new System.Windows.Forms.Padding(4);
+			this.codeView.Name = "codeView";
+			this.codeView.Size = new System.Drawing.Size(726, 446);
+			this.codeView.SourceCode = null;
+			this.codeView.TabIndex = 1;
+			// 
 			// txtOutput
 			// 
 			this.txtOutput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
@@ -668,146 +803,11 @@
 			this.txtOutput.Size = new System.Drawing.Size(726, 213);
 			this.txtOutput.TabIndex = 0;
 			// 
-			// btnFollow
-			// 
-			this.btnFollow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
-			this.btnFollow.Image = ((System.Drawing.Image)(resources.GetObject("btnFollow.Image")));
-			this.btnFollow.ImageTransparentColor = System.Drawing.Color.Magenta;
-			this.btnFollow.Name = "btnFollow";
-			this.btnFollow.Size = new System.Drawing.Size(46, 22);
-			this.btnFollow.Text = "Follow";
-			this.btnFollow.Click += new System.EventHandler(this.btnFollow_Click);
-			// 
 			// timerFollow
 			// 
-			this.timerFollow.Interval = 50;
+			this.timerFollow.Interval = 15;
 			this.timerFollow.Tick += new System.EventHandler(this.timerFollow_Tick);
 			// 
-			// lvWatches
-			// 
-			this.lvWatches.BackColor = System.Drawing.SystemColors.Window;
-			this.lvWatches.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader1,
-            this.columnHeader2,
-            this.columnHeader3,
-            this.columnHeader4});
-			this.lvWatches.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.lvWatches.FullRowSelect = true;
-			this.lvWatches.GridLines = true;
-			this.lvWatches.Location = new System.Drawing.Point(3, 28);
-			this.lvWatches.Name = "lvWatches";
-			this.lvWatches.Size = new System.Drawing.Size(350, 249);
-			this.lvWatches.TabIndex = 4;
-			this.lvWatches.UseCompatibleStateImageBehavior = false;
-			this.lvWatches.View = System.Windows.Forms.View.Details;
-			this.lvWatches.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvWatches_MouseDoubleClick);
-			// 
-			// columnHeader1
-			// 
-			this.columnHeader1.Text = "Name";
-			this.columnHeader1.Width = 72;
-			// 
-			// columnHeader2
-			// 
-			this.columnHeader2.Text = "Type";
-			this.columnHeader2.Width = 57;
-			// 
-			// columnHeader3
-			// 
-			this.columnHeader3.Text = "Value";
-			this.columnHeader3.Width = 111;
-			// 
-			// columnHeader4
-			// 
-			this.columnHeader4.Text = "Symbol loc.";
-			this.columnHeader4.Width = 72;
-			// 
-			// lvVStack
-			// 
-			this.lvVStack.BackColor = System.Drawing.SystemColors.Window;
-			this.lvVStack.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader5,
-            this.columnHeader6,
-            this.columnHeader7});
-			this.lvVStack.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.lvVStack.FullRowSelect = true;
-			this.lvVStack.GridLines = true;
-			this.lvVStack.Location = new System.Drawing.Point(3, 28);
-			this.lvVStack.Name = "lvVStack";
-			this.lvVStack.Size = new System.Drawing.Size(350, 249);
-			this.lvVStack.TabIndex = 7;
-			this.lvVStack.UseCompatibleStateImageBehavior = false;
-			this.lvVStack.View = System.Windows.Forms.View.Details;
-			this.lvVStack.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvVStack_MouseDoubleClick);
-			// 
-			// columnHeader5
-			// 
-			this.columnHeader5.Text = "Stack ofs";
-			this.columnHeader5.Width = 72;
-			// 
-			// columnHeader6
-			// 
-			this.columnHeader6.Text = "Type";
-			this.columnHeader6.Width = 94;
-			// 
-			// columnHeader7
-			// 
-			this.columnHeader7.Text = "Value";
-			this.columnHeader7.Width = 157;
-			// 
-			// lvCallStack
-			// 
-			this.lvCallStack.BackColor = System.Drawing.SystemColors.Window;
-			this.lvCallStack.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.colAddress,
-            this.colName,
-            this.colReturn,
-            this.colBP});
-			this.lvCallStack.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.lvCallStack.FullRowSelect = true;
-			this.lvCallStack.GridLines = true;
-			this.lvCallStack.Location = new System.Drawing.Point(3, 28);
-			this.lvCallStack.Name = "lvCallStack";
-			this.lvCallStack.Size = new System.Drawing.Size(350, 294);
-			this.lvCallStack.TabIndex = 8;
-			this.lvCallStack.UseCompatibleStateImageBehavior = false;
-			this.lvCallStack.View = System.Windows.Forms.View.Details;
-			// 
-			// colAddress
-			// 
-			this.colAddress.Text = "Address";
-			this.colAddress.Width = 72;
-			// 
-			// colName
-			// 
-			this.colName.Text = "Name";
-			this.colName.Width = 106;
-			// 
-			// colReturn
-			// 
-			this.colReturn.Text = "Return";
-			this.colReturn.Width = 72;
-			// 
-			// colBP
-			// 
-			this.colBP.Text = "Base Ptr";
-			this.colBP.Width = 72;
-			// 
-			// codeView
-			// 
-			this.codeView.ActiveLine = -1;
-			this.codeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
-			this.codeView.CursorLine = 0;
-			this.codeView.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.codeView.Font = new System.Drawing.Font("Consolas", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-			this.codeView.ForeColor = System.Drawing.Color.Gainsboro;
-			this.codeView.Location = new System.Drawing.Point(0, 0);
-			this.codeView.Margin = new System.Windows.Forms.Padding(4);
-			this.codeView.Name = "codeView";
-			this.codeView.Size = new System.Drawing.Size(726, 446);
-			this.codeView.SourceCode = null;
-			this.codeView.TabIndex = 1;
-			// 
 			// MainForm
 			// 
 			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

+ 44 - 44
src/MoonSharp.Debugger/MainForm.resx

@@ -156,57 +156,57 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACe
-        DQAAAk1TRnQBSQFMAgEBBAEAATABAQEwAQEBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
+        DQAAAk1TRnQBSQFMAgEBBAEAATgBAQE4AQEBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
         AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AIgADDAEQA1kBvwP2
         Af8D9gH/A1kBvwMqAUADKgFAAyoBQAMqAUADKgFAAyoBQAMqAUADKgFAAyoBQAMqAUADKgFAEAAD9gH/
-        A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/5AAA1kBvwOcAf8DHAH/AxwB/wP2Af8D9gH/A/YB/wP2
-        Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/xAAA/YB/wMcAf8DHAH/AxwB/wMcAf8DHAH/
-        AxwB/wP2Af+QAAP2Af8DHAH/AxwB/wMcAf8D9gH/AxwB/wMcAf8DHAH/AxwB/wMcAf8DHAH/AxwB/wMc
-        Af8DHAH/AxwB/wP2Af8QAAP2Af8DHAH/AxwB/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GwH/AxsB/wMbAf8DGwH/AxsB/wMbAf8DGwH/A/YB/wQAA/YB/wP2Af8D9gH/A/YB/wP2
         Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8IAAP2Af8D9gH/A/YB/wP2Af8D9gH/
         FAAD9gH/A/YB/wP2Af8D9gH/A/YB/wQAA/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/
         A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/

+ 10 - 0
src/MoonSharp.Interpreter/CoreLib/BasicMethods.cs

@@ -75,5 +75,15 @@ namespace MoonSharp.Interpreter.CoreLib
 		}
 
 
+		[MoonSharpMethod]
+		public static DynValue tostring(ScriptExecutionContext executionContext, CallbackArguments args)
+		{
+			DynValue v = args[0];
+			return DynValue.NewString(v.ToPrintString());
+		}
+
+
+
+
 	}
 }

+ 11 - 1
src/MoonSharp.Interpreter/CoreLib/ErrorHandling.cs

@@ -23,10 +23,20 @@ namespace MoonSharp.Interpreter.CoreLib
 			{
 				Args = a,
 				Function = v,
-				Mode = CallMode.PCall
+				Continuation = new CallbackFunction(pcall_continuation),
+				ErrorHandler = new CallbackFunction(pcall_onerror)
 			});
 		}
 
+		public static DynValue pcall_continuation(ScriptExecutionContext executionContext, CallbackArguments args)
+		{
+			return DynValue.NewTupleNested(DynValue.True, args[0]);
+		}
+
+		public static DynValue pcall_onerror(ScriptExecutionContext executionContext, CallbackArguments args)
+		{
+			return DynValue.NewTupleNested(DynValue.True, args[0]);
+		}
 
 
 

+ 4 - 1
src/MoonSharp.Interpreter/CoreLib/Patterns/PatternMatching.cs

@@ -520,7 +520,10 @@ namespace MoonSharp.Interpreter.CoreLib.Patterns
 
 			return aux;
 		}
-
+		public static DynValue Match(string s, string p, int init)
+		{
+			return StrFindAux(s, p, init, false, false);
+		}
 
 
 	}

+ 11 - 0
src/MoonSharp.Interpreter/CoreLib/StringModule.cs

@@ -10,6 +10,17 @@ namespace MoonSharp.Interpreter.CoreLib
 	[MoonSharpModule(Namespace="string")]
 	public class StringModule
 	{
+		[MoonSharpMethod()]
+		public static DynValue match(ScriptExecutionContext executionContext, CallbackArguments args)
+		{
+			DynValue s = args.AsType(0, "match", DataType.String, false);
+			DynValue p = args.AsType(1, "match", DataType.String, false);
+			DynValue i = args.AsType(2, "match", DataType.Number, true);
+
+			return PatternMatching.Match(s.String, p.String, i.IsNilOrNan() ? 1 : (int)i.Number);
+		}
+
+
 		[MoonSharpMethod()]
 		public static DynValue gmatch(ScriptExecutionContext executionContext, CallbackArguments args)
 		{

+ 48 - 0
src/MoonSharp.Interpreter/CoreLib/TableModule.cs

@@ -47,6 +47,54 @@ namespace MoonSharp.Interpreter.CoreLib
 			return v;
 		}
 
+		//table.concat (list [, sep [, i [, j]]])
+		//Given a list where all elements are strings or numbers, returns the string list[i]..sep..list[i+1] (...) sep..list[j]. 
+		//The default value for sep is the empty string, the default for i is 1, and the default for j is #list. If i is greater 
+		//than j, returns the empty string. 
+		[MoonSharpMethod()]
+		public static DynValue concat(ScriptExecutionContext executionContext, CallbackArguments args)
+		{
+			// !INCOMPAT
+
+			// The theory says the method calls __len to get the len in case it's not forced as a param.
+			// But then it uses rawget to access. The only case where we differ if we take the shortcut
+			// of using rawlen is if the first param is passed to force a non-first index and the second 
+			// isn't. Likely an acceptable divergence, at least for now. [Note that this behaviour is
+			// actually undefined in Lua 5.1, and __len is documented only for Lua 5.2]
+
+			DynValue vlist = args.AsType(0, "concat", DataType.Table, false);
+			DynValue vsep = args.AsType(1, "concat", DataType.String, true);
+			DynValue vstart = args.AsType(2, "concat", DataType.Number, true);
+			DynValue vend = args.AsType(3, "concat", DataType.Number, true);
+
+			Table list = vlist.Table;
+			string sep = vsep.IsNil() ? "" : vsep.String;
+			int start = vstart.IsNilOrNan() ? 1 : (int)vstart.Number;
+			int end = vend.IsNilOrNan() ? (int)list.Length : (int)vend.Number;
+
+			if (end < start)
+				return DynValue.NewString(string.Empty);
+
+			StringBuilder sb = new StringBuilder();
+
+			for (int i = start; i <= end; i++)
+			{
+				DynValue v = list[i];
+
+				if (v.Type != DataType.Number && v.Type != DataType.String)
+					throw new ScriptRuntimeException("invalid value (boolean) at index {0} in table for 'concat'", i);
+
+				string s = v.ToPrintString();
+
+				sb.Append(s);
+
+				if (i != start)
+					sb.Append(sep);
+			}
+
+			return DynValue.NewString(sb.ToString());
+		}
+
 	}
 
 

+ 1 - 2
src/MoonSharp.Interpreter/DataTypes/DynValue.cs

@@ -55,7 +55,7 @@ namespace MoonSharp.Interpreter
 		/// </summary>
 		public string String { get; private set; }
 		/// <summary>
-		/// Gets the CLR callback (valid only if the <seealso cref="Type"/> is <seealso cref="DataType.Callback"/>)
+		/// Gets the CLR callback (valid only if the <seealso cref="Type"/> is <seealso cref="DataType.CallbackFunction"/>)
 		/// </summary>
 		public CallbackFunction Callback { get; set; }
 		/// <summary>
@@ -193,7 +193,6 @@ namespace MoonSharp.Interpreter
 				{
 					Args = args,
 					Function = tailFn,
-					Mode = CallMode.Normal 
 				},
 				Type = DataType.TailCallRequest,
 			};

+ 2 - 1
src/MoonSharp.Interpreter/DataTypes/TailCallData.cs

@@ -10,6 +10,7 @@ namespace MoonSharp.Interpreter
 	{
 		public DynValue Function { get; set; }
 		public DynValue[] Args { get; set; }
-		public CallMode Mode { get; set; }
+		public CallbackFunction Continuation { get; set; }
+		public CallbackFunction ErrorHandler { get; set; }
 	}
 }

+ 2 - 9
src/MoonSharp.Interpreter/Execution/VM/CallStackItem.cs

@@ -5,20 +5,13 @@ using System.Text;
 
 namespace MoonSharp.Interpreter.Execution.VM
 {
-	public enum CallMode
-	{
-		Normal,
-		PCall,
-		Require,
-	}
-
-
 	public class CallStackItem
 	{
 		public int Debug_EntryPoint;
 		public SymbolRef[] Debug_Symbols;
 
-		public CallMode Mode;
+		public CallbackFunction Continuation;
+		public CallbackFunction ErrorHandler;
 
 		public int BasePointer;
 		public int ReturnAddress;

+ 11 - 26
src/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs

@@ -194,13 +194,14 @@ namespace MoonSharp.Interpreter.Execution.VM
 				{
 					CallStackItem csi = PopToBasePointer();
 
-					CallMode mode = csi.Mode;
-					if (mode == CallMode.PCall)
+					if (csi.ErrorHandler != null)
 					{
 						instructionPtr = csi.ReturnAddress;
 						var argscnt = (int)(m_ValueStack.Pop().Number);
 						m_ValueStack.RemoveLast(argscnt + 1);
 
+						// +++ todo: add a *real* call to the error handler
+
 						m_ValueStack.Push(DynValue.NewTuple(DynValue.False, DynValue.NewString(ex.Message)));
 
 						goto repeat_execution;
@@ -476,7 +477,7 @@ namespace MoonSharp.Interpreter.Execution.VM
 
 
 
-		private int Internal_ExecCall(int argsCount, int instructionPtr, CallMode mode = CallMode.Normal)
+		private int Internal_ExecCall(int argsCount, int instructionPtr, CallbackFunction handler = null, CallbackFunction continuation = null)
 		{
 			DynValue fn = m_ValueStack.Peek(argsCount);
 
@@ -498,7 +499,8 @@ namespace MoonSharp.Interpreter.Execution.VM
 					ReturnAddress = instructionPtr,
 					Debug_EntryPoint = fn.Function.ByteCodeLocation,
 					ClosureScope = fn.Function.ClosureContext,
-					Mode = mode,
+					ErrorHandler = handler,
+					Continuation = continuation 
 				});
 				return fn.Function.ByteCodeLocation;
 			}
@@ -519,7 +521,7 @@ namespace MoonSharp.Interpreter.Execution.VM
 						for (int i = argsCount; i >= 0; i--)
 							m_ValueStack.Push(tmp[i]);
 
-						return Internal_ExecCall(argsCount + 1, instructionPtr);
+						return Internal_ExecCall(argsCount + 1, instructionPtr, handler, continuation);
 					}
 				}
 
@@ -556,31 +558,14 @@ namespace MoonSharp.Interpreter.Execution.VM
 				throw new InternalErrorException("RET supports only 0 and 1 ret val scenarios");
 			}
 
-			if (csi.Mode != CallMode.Normal)
-				AdjustRetValueForMode(csi.Mode);
+			if (csi.Continuation != null)
+				m_ValueStack.Push(csi.Continuation.Invoke(new ScriptExecutionContext(this, csi.Continuation),
+					new DynValue[1] { m_ValueStack.Pop() }));
 
 			return retpoint;
 		}
 
-		private void AdjustRetValueForMode(CallMode callMode)
-		{
-			DynValue r = m_ValueStack.Pop();
 
-			switch (callMode)
-			{
-				case CallMode.PCall:
-					m_ValueStack.Push(DynValue.NewTupleNested(DynValue.True, r));
-					break;
-				case CallMode.Require:
-					break;
-				case CallMode.Normal:
-				default:
-					throw new InternalErrorException("Unreachable case .. reached");
-			}
-
-
-			
-		}
 
 		private int Internal_CheckForTailRequests(Instruction i, int instructionPtr)
 		{
@@ -598,7 +583,7 @@ namespace MoonSharp.Interpreter.Execution.VM
 					m_ValueStack.Push(tcd.Args[ii]);
 
 				//instructionPtr -= 1;
-				return Internal_ExecCall(tcd.Args.Length, instructionPtr, tcd.Mode);
+				return Internal_ExecCall(tcd.Args.Length, instructionPtr, tcd.ErrorHandler, tcd.Continuation);
 			}