diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..cb3c971b --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,28 @@ +name: .NET + +on: + push: + branches: [ librelancer ] + pull_request: + branches: [ librelancer ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + working-directory: ./src + run: dotnet restore + - name: Build + working-directory: ./src + run: dotnet build --no-restore + - name: Test + working-directory: ./src + run: dotnet test --no-build --verbosity normal diff --git a/.gitignore b/.gitignore index c2fc1cd9..2e15013b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ *.suo *.user *.sln.docstates +*.idea +*.vs # Build results diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index de786af8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: csharp -solution: src/moonsharp.sln -sudo: required - -mono: - - 2.10.8 - -script: - - xbuild /p:TargetFrameworkProfile='' /p:Configuration=Release src/moonsharp_ci_net35.sln - - cd src/TestRunners/ConsoleTestRunner/bin/Release - - mono ConsoleTestRunner.exe -# - chmod 777 aotregen.sh -# - chmod 777 aottest.sh -# - sudo ./aotregen.sh -# - sudo ./aottest.sh - diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 00000000..e7c607de --- /dev/null +++ b/AUTHORS @@ -0,0 +1,17 @@ + +# This is the list of MoonSharp's significant contributors. +# +# This does not necessarily list everyone who has contributed code, +# especially since many employees of one corporation may be contributing. +# To see the full list of contributors, see the revision history in +# source control. + +Marco Mastropaolo +wledfor2 +NullShock78 +doritsugita +Pedro Fanha +Benjamin Dobell +Kevin Morgan +Callum McGing +Matěj Štágl diff --git a/LICENSE b/LICENSE index 33d21309..5b1726e3 100755 --- a/LICENSE +++ b/LICENSE @@ -1,16 +1,7 @@ -Copyright (c) 2014-2016, Marco Mastropaolo -All rights reserved. - -Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua) -Copyright (c) 2012 LoDC +BSD 3-Clause License -Visual Studio Code debugger code is based on code from Microsoft vscode-mono-debug project (https://github.com/Microsoft/vscode-mono-debug). -Copyright (c) Microsoft Corporation - released under MIT license. - -Remote Debugger icons are from the Eclipse project (https://www.eclipse.org/). -Copyright of The Eclipse Foundation - -The MoonSharp icon is (c) Isaac, 2014-2015 +Copyright (c) 2014-2022 The MoonSharp Authors, as shown by the AUTHORS file. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -22,7 +13,7 @@ modification, are permitted provided that the following conditions are met: this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of the {organization} nor the names of its +* Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -36,3 +27,8 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua) +Copyright (c) 2012 LoDC + +The MoonSharp icon is (c) Isaac, 2014-2015 diff --git a/README.md b/README.md index 56246141..b9ccb335 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +MoonSharp: Librelancer Branch +* This only contains a subset of the MoonSharp project for .Net Core 3.1 +* See upstream at https://github.com/moonsharp-devs/moonsharp + + MoonSharp [](https://travis-ci.org/xanathar/moonsharp) [](https://www.nuget.org/packages/MoonSharp/) ========= http://www.moonsharp.org diff --git a/bfg.jar b/bfg.jar deleted file mode 100644 index e66f73c1..00000000 Binary files a/bfg.jar and /dev/null differ diff --git a/src/.vs/restore.dg b/src/.vs/restore.dg deleted file mode 100755 index 0a8c8d32..00000000 --- a/src/.vs/restore.dg +++ /dev/null @@ -1,7 +0,0 @@ -#:Z:\git\my\moonsharp\src\MoonSharp.VsCodeDebugger\_Projects\MoonSharp.VsCodeDebugger.netcore\MoonSharp.VsCodeDebugger.netcore.xproj -Z:\git\my\moonsharp\src\MoonSharp.VsCodeDebugger\_Projects\MoonSharp.VsCodeDebugger.netcore\MoonSharp.VsCodeDebugger.netcore.xproj|Z:\git\my\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.xproj -#:Z:\git\my\moonsharp\src\TestRunners\DotNetCoreTestRunner\DotNetCoreTestRunner.xproj -Z:\git\my\moonsharp\src\TestRunners\DotNetCoreTestRunner\DotNetCoreTestRunner.xproj|Z:\git\my\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.xproj -Z:\git\my\moonsharp\src\TestRunners\DotNetCoreTestRunner\DotNetCoreTestRunner.xproj|Z:\git\my\moonsharp\src\MoonSharp.VsCodeDebugger\_Projects\MoonSharp.VsCodeDebugger.netcore\MoonSharp.VsCodeDebugger.netcore.xproj -Z:\git\my\moonsharp\src\MoonSharp.VsCodeDebugger\_Projects\MoonSharp.VsCodeDebugger.netcore\MoonSharp.VsCodeDebugger.netcore.xproj|Z:\git\my\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.xproj -#:Z:\git\my\moonsharp\src\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.netcore\MoonSharp.Interpreter.netcore.xproj diff --git a/src/DevTools/MoonSharp.VmDebugger/DoubleBufferedListView.cs b/src/DevTools/MoonSharp.VmDebugger/DoubleBufferedListView.cs deleted file mode 100644 index 7a95c0ee..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/DoubleBufferedListView.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace MoonSharp.Debugger -{ - class DoubleBufferedListView : System.Windows.Forms.ListView - { - public DoubleBufferedListView() - : base() - { - this.DoubleBuffered = true; - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/Ext_Methods.cs b/src/DevTools/MoonSharp.VmDebugger/Ext_Methods.cs deleted file mode 100644 index b038f2ed..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Ext_Methods.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace MoonSharp.Debugger -{ - static class Ext_Methods - { - public static ListViewItem Add(this ListView lv, params object[] texts) - { - ListViewItem lvi = new ListViewItem(); - lvi.Text = texts[0].ToString(); - - for (int i = 1; i < texts.Length; i++) - { - ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem(); - lvsi.Text = texts[i].ToString(); - lvi.SubItems.Add(lvsi); - } - - lv.Items.Add(lvi); - - return lvi; - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/MainForm.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/MainForm.Designer.cs deleted file mode 100644 index 39223e89..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/MainForm.Designer.cs +++ /dev/null @@ -1,1057 +0,0 @@ -namespace MoonSharp.Debugger -{ - partial class MainForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.scriptCodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.bytecodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.debugToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.stepOverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.stepInToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.toggleBreakpointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); - this.gOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.btnOpenFile = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.toolGO = new System.Windows.Forms.ToolStripButton(); - this.toolStepOver = new System.Windows.Forms.ToolStripButton(); - 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.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); - this.btnFastHack = 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(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.btnViewWatch = new System.Windows.Forms.ToolStripButton(); - 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(); - this.label2 = new System.Windows.Forms.Label(); - 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.tabControl3 = new System.Windows.Forms.TabControl(); - this.tabPage5 = new System.Windows.Forms.TabPage(); - this.txtOutput = new System.Windows.Forms.TextBox(); - this.toolStrip5 = new System.Windows.Forms.ToolStrip(); - this.tabPage6 = new System.Windows.Forms.TabPage(); - this.txtCodeView = new System.Windows.Forms.TextBox(); - this.toolStrip6 = new System.Windows.Forms.ToolStrip(); - this.timerFollow = new System.Windows.Forms.Timer(this.components); - this.btnOpenTest = new System.Windows.Forms.ToolStripButton(); - this.menuStrip1.SuspendLayout(); - this.toolStrip1.SuspendLayout(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.tabControl2.SuspendLayout(); - this.tabPage3.SuspendLayout(); - this.toolStrip2.SuspendLayout(); - this.tabPage4.SuspendLayout(); - this.toolStrip3.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - this.toolStrip4.SuspendLayout(); - this.tabPage2.SuspendLayout(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); - this.tabControl3.SuspendLayout(); - this.tabPage5.SuspendLayout(); - this.tabPage6.SuspendLayout(); - this.SuspendLayout(); - // - // menuStrip1 - // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.viewToolStripMenuItem, - this.debugToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1094, 24); - this.menuStrip1.TabIndex = 0; - this.menuStrip1.Text = "menuStrip1"; - // - // fileToolStripMenuItem - // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.openToolStripMenuItem, - this.connectToolStripMenuItem, - this.toolStripMenuItem1, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "&File"; - // - // openToolStripMenuItem - // - this.openToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.Open_6529; - this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.openToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.openToolStripMenuItem.Text = "&Open..."; - this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); - // - // connectToolStripMenuItem - // - this.connectToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.AddConnection_477; - this.connectToolStripMenuItem.Name = "connectToolStripMenuItem"; - this.connectToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.connectToolStripMenuItem.Text = "Connect..."; - // - // toolStripMenuItem1 - // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 6); - // - // exitToolStripMenuItem - // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(155, 22); - this.exitToolStripMenuItem.Text = "&Exit"; - // - // viewToolStripMenuItem - // - this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.scriptCodeToolStripMenuItem, - this.bytecodeToolStripMenuItem}); - this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; - this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.viewToolStripMenuItem.Text = "&View"; - // - // scriptCodeToolStripMenuItem - // - this.scriptCodeToolStripMenuItem.Name = "scriptCodeToolStripMenuItem"; - this.scriptCodeToolStripMenuItem.Size = new System.Drawing.Size(133, 22); - this.scriptCodeToolStripMenuItem.Text = "Script code"; - // - // bytecodeToolStripMenuItem - // - this.bytecodeToolStripMenuItem.Checked = true; - this.bytecodeToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.bytecodeToolStripMenuItem.Name = "bytecodeToolStripMenuItem"; - this.bytecodeToolStripMenuItem.Size = new System.Drawing.Size(133, 22); - this.bytecodeToolStripMenuItem.Text = "Bytecode"; - // - // debugToolStripMenuItem - // - this.debugToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.stepOverToolStripMenuItem, - this.stepInToolStripMenuItem, - this.toolStripMenuItem2, - this.toggleBreakpointToolStripMenuItem, - this.toolStripMenuItem3, - this.gOToolStripMenuItem}); - this.debugToolStripMenuItem.Name = "debugToolStripMenuItem"; - this.debugToolStripMenuItem.Size = new System.Drawing.Size(54, 20); - this.debugToolStripMenuItem.Text = "&Debug"; - // - // stepOverToolStripMenuItem - // - this.stepOverToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.StepOver_6328; - this.stepOverToolStripMenuItem.Name = "stepOverToolStripMenuItem"; - this.stepOverToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F10; - this.stepOverToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.stepOverToolStripMenuItem.Text = "Step-Over"; - this.stepOverToolStripMenuItem.Click += new System.EventHandler(this.stepOverToolStripMenuItem_Click); - // - // stepInToolStripMenuItem - // - this.stepInToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.StepIn_6326; - this.stepInToolStripMenuItem.Name = "stepInToolStripMenuItem"; - this.stepInToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F11; - this.stepInToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.stepInToolStripMenuItem.Text = "Step-In"; - this.stepInToolStripMenuItem.Click += new System.EventHandler(this.stepInToolStripMenuItem_Click); - // - // toolStripMenuItem2 - // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(187, 6); - // - // toggleBreakpointToolStripMenuItem - // - this.toggleBreakpointToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.BreakpointEnabled_6584_16x; - this.toggleBreakpointToolStripMenuItem.Name = "toggleBreakpointToolStripMenuItem"; - this.toggleBreakpointToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F9; - this.toggleBreakpointToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.toggleBreakpointToolStripMenuItem.Text = "Toggle Breakpoint"; - // - // toolStripMenuItem3 - // - this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(187, 6); - // - // gOToolStripMenuItem - // - this.gOToolStripMenuItem.Image = global::MoonSharp.Debugger.Properties.Resources.startwithoutdebugging_6556; - this.gOToolStripMenuItem.Name = "gOToolStripMenuItem"; - this.gOToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.gOToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.gOToolStripMenuItem.Text = "GO"; - this.gOToolStripMenuItem.Click += new System.EventHandler(this.gOToolStripMenuItem_Click); - // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "&Help"; - // - // aboutToolStripMenuItem - // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22); - this.aboutToolStripMenuItem.Text = "&About"; - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.btnOpenFile, - this.toolStripButton2, - this.toolStripSeparator1, - this.toolStripButton3, - this.toolStripSeparator2, - this.toolGO, - this.toolStepOver, - this.toolStepIN, - this.toolStripSeparator3, - this.toolStripButton5, - this.btnFollow, - this.toolStripSeparator5, - this.btnFastHack, - this.btnOpenTest}); - this.toolStrip1.Location = new System.Drawing.Point(0, 24); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(1094, 25); - this.toolStrip1.TabIndex = 1; - this.toolStrip1.Text = "toolStrip1"; - // - // btnOpenFile - // - this.btnOpenFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.btnOpenFile.Image = global::MoonSharp.Debugger.Properties.Resources.Open_6529; - this.btnOpenFile.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnOpenFile.Name = "btnOpenFile"; - this.btnOpenFile.Size = new System.Drawing.Size(23, 22); - this.btnOpenFile.Text = "Open File"; - this.btnOpenFile.Click += new System.EventHandler(this.btnOpenFile_Click); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::MoonSharp.Debugger.Properties.Resources.AddConnection_477; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "toolStripButton2"; - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton3 - // - this.toolStripButton3.Checked = true; - this.toolStripButton3.CheckState = System.Windows.Forms.CheckState.Checked; - this.toolStripButton3.Image = global::MoonSharp.Debugger.Properties.Resources.DisassemblyWindow_6536; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(76, 22); - this.toolStripButton3.Text = "Bytecode"; - // - // toolStripSeparator2 - // - this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); - // - // toolGO - // - this.toolGO.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolGO.Image = global::MoonSharp.Debugger.Properties.Resources.startwithoutdebugging_6556; - this.toolGO.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolGO.Name = "toolGO"; - this.toolGO.Size = new System.Drawing.Size(23, 22); - this.toolGO.Text = "GO"; - this.toolGO.Click += new System.EventHandler(this.toolGO_Click); - // - // toolStepOver - // - this.toolStepOver.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStepOver.Image = global::MoonSharp.Debugger.Properties.Resources.StepOver_6328; - this.toolStepOver.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStepOver.Name = "toolStepOver"; - this.toolStepOver.Size = new System.Drawing.Size(23, 22); - this.toolStepOver.Text = "Step-Over"; - this.toolStepOver.Click += new System.EventHandler(this.toolStepOver_Click); - // - // toolStepIN - // - this.toolStepIN.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStepIN.Image = global::MoonSharp.Debugger.Properties.Resources.StepIn_6326; - this.toolStepIN.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStepIN.Name = "toolStepIN"; - this.toolStepIN.Size = new System.Drawing.Size(23, 22); - this.toolStepIN.Text = "Step-In"; - this.toolStepIN.Click += new System.EventHandler(this.toolStripButton1_Click); - // - // toolStripSeparator3 - // - this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25); - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton5.Image = global::MoonSharp.Debugger.Properties.Resources.BreakpointEnabled_6584_16x; - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - 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); - // - // toolStripSeparator5 - // - this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25); - // - // btnFastHack - // - this.btnFastHack.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.btnFastHack.Image = ((System.Drawing.Image)(resources.GetObject("btnFastHack.Image"))); - this.btnFastHack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnFastHack.Name = "btnFastHack"; - this.btnFastHack.Size = new System.Drawing.Size(130, 22); - this.btnFastHack.Text = "Open C:\\temp\\test.lua"; - this.btnFastHack.Click += new System.EventHandler(this.btnFastHack_Click); - // - // statusStrip1 - // - this.statusStrip1.Location = new System.Drawing.Point(0, 712); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(1094, 22); - this.statusStrip1.TabIndex = 2; - this.statusStrip1.Text = "statusStrip1"; - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 49); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer3); - this.splitContainer1.Size = new System.Drawing.Size(1094, 663); - this.splitContainer1.SplitterDistance = 364; - this.splitContainer1.TabIndex = 3; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.tabControl2); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.tabControl1); - this.splitContainer2.Size = new System.Drawing.Size(364, 663); - this.splitContainer2.SplitterDistance = 307; - this.splitContainer2.TabIndex = 0; - // - // tabControl2 - // - this.tabControl2.Controls.Add(this.tabPage3); - this.tabControl2.Controls.Add(this.tabPage4); - this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl2.ImageList = this.imageList1; - this.tabControl2.Location = new System.Drawing.Point(0, 0); - this.tabControl2.Name = "tabControl2"; - this.tabControl2.SelectedIndex = 0; - this.tabControl2.Size = new System.Drawing.Size(364, 307); - this.tabControl2.TabIndex = 1; - // - // tabPage3 - // - this.tabPage3.Controls.Add(this.lvWatches); - this.tabPage3.Controls.Add(this.toolStrip2); - this.tabPage3.Controls.Add(this.label3); - this.tabPage3.ImageIndex = 3; - this.tabPage3.Location = new System.Drawing.Point(4, 23); - this.tabPage3.Name = "tabPage3"; - this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(356, 280); - this.tabPage3.TabIndex = 0; - 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[] { - this.btnAddWatch, - this.btnRemoveWatch, - this.toolStripSeparator4, - this.btnViewWatch, - this.toolGoToCodeWatches}); - this.toolStrip2.Location = new System.Drawing.Point(3, 3); - this.toolStrip2.Name = "toolStrip2"; - this.toolStrip2.Size = new System.Drawing.Size(350, 25); - this.toolStrip2.TabIndex = 3; - this.toolStrip2.Text = "toolStrip2"; - // - // btnAddWatch - // - this.btnAddWatch.Image = global::MoonSharp.Debugger.Properties.Resources.AddMark_10580; - this.btnAddWatch.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnAddWatch.Name = "btnAddWatch"; - this.btnAddWatch.Size = new System.Drawing.Size(49, 22); - this.btnAddWatch.Text = "Add"; - this.btnAddWatch.Click += new System.EventHandler(this.btnAddWatch_Click); - // - // btnRemoveWatch - // - this.btnRemoveWatch.Image = global::MoonSharp.Debugger.Properties.Resources.Clearallrequests_8816; - this.btnRemoveWatch.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnRemoveWatch.Name = "btnRemoveWatch"; - this.btnRemoveWatch.Size = new System.Drawing.Size(70, 22); - this.btnRemoveWatch.Text = "Remove"; - this.btnRemoveWatch.Click += new System.EventHandler(this.btnRemoveWatch_Click); - // - // toolStripSeparator4 - // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25); - // - // btnViewWatch - // - this.btnViewWatch.Image = global::MoonSharp.Debugger.Properties.Resources.FindSymbol_6263; - this.btnViewWatch.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnViewWatch.Name = "btnViewWatch"; - this.btnViewWatch.Size = new System.Drawing.Size(52, 22); - this.btnViewWatch.Text = "View"; - this.btnViewWatch.Click += new System.EventHandler(this.btnViewWatch_Click); - // - // toolGoToCodeWatches - // - this.toolGoToCodeWatches.Image = global::MoonSharp.Debugger.Properties.Resources.GoToDeclaration_5576; - this.toolGoToCodeWatches.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolGoToCodeWatches.Name = "toolGoToCodeWatches"; - this.toolGoToCodeWatches.Size = new System.Drawing.Size(87, 22); - this.toolGoToCodeWatches.Text = "Go to Code"; - this.toolGoToCodeWatches.ToolTipText = "Go to Code"; - this.toolGoToCodeWatches.Click += new System.EventHandler(this.toolGoToCodeWatches_Click); - // - // label3 - // - this.label3.Dock = System.Windows.Forms.DockStyle.Fill; - this.label3.Location = new System.Drawing.Point(3, 3); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(350, 274); - this.label3.TabIndex = 2; - this.label3.Text = "Not Implemented Yet"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tabPage4 - // - this.tabPage4.Controls.Add(this.lvVStack); - this.tabPage4.Controls.Add(this.toolStrip3); - this.tabPage4.Controls.Add(this.label2); - this.tabPage4.ImageIndex = 1; - this.tabPage4.Location = new System.Drawing.Point(4, 23); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(356, 280); - this.tabPage4.TabIndex = 1; - 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[] { - this.btnViewVStk, - this.toolGoToCodeVStack}); - this.toolStrip3.Location = new System.Drawing.Point(3, 3); - this.toolStrip3.Name = "toolStrip3"; - this.toolStrip3.Size = new System.Drawing.Size(350, 25); - this.toolStrip3.TabIndex = 6; - this.toolStrip3.Text = "toolStrip3"; - // - // btnViewVStk - // - this.btnViewVStk.Image = global::MoonSharp.Debugger.Properties.Resources.FindSymbol_6263; - this.btnViewVStk.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnViewVStk.Name = "btnViewVStk"; - this.btnViewVStk.Size = new System.Drawing.Size(52, 22); - this.btnViewVStk.Text = "View"; - this.btnViewVStk.Click += new System.EventHandler(this.btnViewVStk_Click); - // - // toolGoToCodeVStack - // - this.toolGoToCodeVStack.Image = global::MoonSharp.Debugger.Properties.Resources.GoToDeclaration_5576; - this.toolGoToCodeVStack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolGoToCodeVStack.Name = "toolGoToCodeVStack"; - this.toolGoToCodeVStack.Size = new System.Drawing.Size(87, 22); - this.toolGoToCodeVStack.Text = "Go to Code"; - this.toolGoToCodeVStack.ToolTipText = "Go to Code"; - this.toolGoToCodeVStack.Click += new System.EventHandler(this.toolGoToCodeVStack_Click); - // - // label2 - // - this.label2.Dock = System.Windows.Forms.DockStyle.Fill; - this.label2.Location = new System.Drawing.Point(3, 3); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(350, 274); - this.label2.TabIndex = 1; - this.label2.Text = "Not Implemented Yet"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // imageList1 - // - this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); - this.imageList1.TransparentColor = System.Drawing.Color.Transparent; - this.imageList1.Images.SetKeyName(0, "CallStackWindow_6561.png"); - this.imageList1.Images.SetKeyName(1, "Centered_11691.png"); - this.imageList1.Images.SetKeyName(2, "CodeCoverageResults_8592.png"); - this.imageList1.Images.SetKeyName(3, "LocalsWindow_6562.png"); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabPage2); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.ImageList = this.imageList1; - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(364, 352); - this.tabControl1.TabIndex = 0; - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.lvCallStack); - this.tabPage1.Controls.Add(this.toolStrip4); - this.tabPage1.ImageIndex = 0; - this.tabPage1.Location = new System.Drawing.Point(4, 23); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(356, 325); - this.tabPage1.TabIndex = 0; - 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[] { - this.toolGoToCodeXStack}); - this.toolStrip4.Location = new System.Drawing.Point(3, 3); - this.toolStrip4.Name = "toolStrip4"; - this.toolStrip4.Size = new System.Drawing.Size(350, 25); - this.toolStrip4.TabIndex = 7; - this.toolStrip4.Text = "toolStrip4"; - // - // toolGoToCodeXStack - // - this.toolGoToCodeXStack.Image = global::MoonSharp.Debugger.Properties.Resources.GoToDeclaration_5576; - this.toolGoToCodeXStack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolGoToCodeXStack.Name = "toolGoToCodeXStack"; - this.toolGoToCodeXStack.Size = new System.Drawing.Size(87, 22); - this.toolGoToCodeXStack.Text = "Go to Code"; - this.toolGoToCodeXStack.ToolTipText = "Go to Code"; - this.toolGoToCodeXStack.Click += new System.EventHandler(this.toolGoToCodeXStack_Click); - // - // tabPage2 - // - this.tabPage2.Controls.Add(this.label1); - this.tabPage2.ImageIndex = 2; - this.tabPage2.Location = new System.Drawing.Point(4, 23); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(356, 325); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = "Coroutines"; - this.tabPage2.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Location = new System.Drawing.Point(3, 3); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(350, 319); - this.label1.TabIndex = 1; - this.label1.Text = "Not Implemented Yet"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // splitContainer3 - // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer3.Panel1 - // - this.splitContainer3.Panel1.Controls.Add(this.codeView); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.tabControl3); - this.splitContainer3.Size = new System.Drawing.Size(726, 663); - 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; - // - // tabControl3 - // - this.tabControl3.Controls.Add(this.tabPage5); - this.tabControl3.Controls.Add(this.tabPage6); - this.tabControl3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl3.Location = new System.Drawing.Point(0, 0); - this.tabControl3.Name = "tabControl3"; - this.tabControl3.SelectedIndex = 0; - this.tabControl3.Size = new System.Drawing.Size(726, 213); - this.tabControl3.TabIndex = 0; - // - // tabPage5 - // - this.tabPage5.Controls.Add(this.txtOutput); - this.tabPage5.Controls.Add(this.toolStrip5); - this.tabPage5.Location = new System.Drawing.Point(4, 22); - this.tabPage5.Name = "tabPage5"; - this.tabPage5.Padding = new System.Windows.Forms.Padding(3); - this.tabPage5.Size = new System.Drawing.Size(718, 187); - this.tabPage5.TabIndex = 0; - this.tabPage5.Text = "Output"; - this.tabPage5.UseVisualStyleBackColor = true; - // - // txtOutput - // - this.txtOutput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.txtOutput.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtOutput.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtOutput.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.txtOutput.Location = new System.Drawing.Point(3, 28); - this.txtOutput.Multiline = true; - this.txtOutput.Name = "txtOutput"; - this.txtOutput.ReadOnly = true; - this.txtOutput.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtOutput.Size = new System.Drawing.Size(712, 156); - this.txtOutput.TabIndex = 3; - // - // toolStrip5 - // - this.toolStrip5.Location = new System.Drawing.Point(3, 3); - this.toolStrip5.Name = "toolStrip5"; - this.toolStrip5.Size = new System.Drawing.Size(712, 25); - this.toolStrip5.TabIndex = 2; - this.toolStrip5.Text = "toolStrip5"; - // - // tabPage6 - // - this.tabPage6.Controls.Add(this.txtCodeView); - this.tabPage6.Controls.Add(this.toolStrip6); - this.tabPage6.Location = new System.Drawing.Point(4, 22); - this.tabPage6.Name = "tabPage6"; - this.tabPage6.Padding = new System.Windows.Forms.Padding(3); - this.tabPage6.Size = new System.Drawing.Size(718, 187); - this.tabPage6.TabIndex = 1; - this.tabPage6.Text = "Code View"; - this.tabPage6.UseVisualStyleBackColor = true; - // - // txtCodeView - // - this.txtCodeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.txtCodeView.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtCodeView.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtCodeView.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); - this.txtCodeView.Location = new System.Drawing.Point(3, 28); - this.txtCodeView.Multiline = true; - this.txtCodeView.Name = "txtCodeView"; - this.txtCodeView.ReadOnly = true; - this.txtCodeView.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtCodeView.Size = new System.Drawing.Size(712, 156); - this.txtCodeView.TabIndex = 3; - // - // toolStrip6 - // - this.toolStrip6.Location = new System.Drawing.Point(3, 3); - this.toolStrip6.Name = "toolStrip6"; - this.toolStrip6.Size = new System.Drawing.Size(712, 25); - this.toolStrip6.TabIndex = 2; - this.toolStrip6.Text = "toolStrip6"; - // - // timerFollow - // - this.timerFollow.Interval = 15; - this.timerFollow.Tick += new System.EventHandler(this.timerFollow_Tick); - // - // btnOpenTest - // - this.btnOpenTest.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; - this.btnOpenTest.Image = ((System.Drawing.Image)(resources.GetObject("btnOpenTest.Image"))); - this.btnOpenTest.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btnOpenTest.Name = "btnOpenTest"; - this.btnOpenTest.Size = new System.Drawing.Size(106, 22); - this.btnOpenTest.Text = "Open Default Test"; - this.btnOpenTest.Click += new System.EventHandler(this.btnOpenTest_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1094, 734); - this.Controls.Add(this.splitContainer1); - this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.toolStrip1); - this.Controls.Add(this.menuStrip1); - this.MainMenuStrip = this.menuStrip1; - this.Name = "MainForm"; - this.Text = "MoonSharp Debugger"; - this.WindowState = System.Windows.Forms.FormWindowState.Maximized; - this.Load += new System.EventHandler(this.MainForm_Load); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.tabControl2.ResumeLayout(false); - this.tabPage3.ResumeLayout(false); - this.tabPage3.PerformLayout(); - this.toolStrip2.ResumeLayout(false); - this.toolStrip2.PerformLayout(); - this.tabPage4.ResumeLayout(false); - this.tabPage4.PerformLayout(); - this.toolStrip3.ResumeLayout(false); - this.toolStrip3.PerformLayout(); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.tabPage1.PerformLayout(); - this.toolStrip4.ResumeLayout(false); - this.toolStrip4.PerformLayout(); - this.tabPage2.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); - this.splitContainer3.ResumeLayout(false); - this.tabControl3.ResumeLayout(false); - this.tabPage5.ResumeLayout(false); - this.tabPage5.PerformLayout(); - this.tabPage6.ResumeLayout(false); - this.tabPage6.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem debugToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem stepOverToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem stepInToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem toggleBreakpointToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; - private System.Windows.Forms.ToolStripMenuItem gOToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem scriptCodeToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem bytecodeToolStripMenuItem; - private System.Windows.Forms.ToolStripButton toolStepIN; - private System.Windows.Forms.TabControl tabControl2; - private System.Windows.Forms.TabPage tabPage3; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TabPage tabPage4; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ImageList imageList1; - private System.Windows.Forms.ToolStripButton btnOpenFile; - private System.Windows.Forms.ToolStripButton toolStripButton2; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripButton toolStripButton3; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; - private System.Windows.Forms.ToolStripButton toolGO; - private System.Windows.Forms.ToolStripButton toolStepOver; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; - private System.Windows.Forms.ToolStripButton toolStripButton5; - private System.Windows.Forms.ToolStripMenuItem connectToolStripMenuItem; - private DoubleBufferedListView lvWatches; - private System.Windows.Forms.ColumnHeader columnHeader1; - private System.Windows.Forms.ColumnHeader columnHeader2; - private System.Windows.Forms.ColumnHeader columnHeader3; - private System.Windows.Forms.ColumnHeader columnHeader4; - private System.Windows.Forms.ToolStrip toolStrip2; - private System.Windows.Forms.ToolStripButton btnAddWatch; - private System.Windows.Forms.ToolStripButton btnRemoveWatch; - private System.Windows.Forms.ToolStripButton btnViewWatch; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; - private System.Windows.Forms.SplitContainer splitContainer3; - private SourceCodeDebugControl codeView; - private DoubleBufferedListView lvVStack; - private System.Windows.Forms.ColumnHeader columnHeader5; - private System.Windows.Forms.ColumnHeader columnHeader6; - private System.Windows.Forms.ColumnHeader columnHeader7; - private System.Windows.Forms.ToolStrip toolStrip3; - private System.Windows.Forms.ToolStripButton btnViewVStk; - private System.Windows.Forms.ToolStripButton toolGoToCodeWatches; - private System.Windows.Forms.ToolStripButton toolGoToCodeVStack; - private DoubleBufferedListView lvCallStack; - private System.Windows.Forms.ColumnHeader colAddress; - private System.Windows.Forms.ColumnHeader colName; - private System.Windows.Forms.ColumnHeader colReturn; - private System.Windows.Forms.ColumnHeader colBP; - private System.Windows.Forms.ToolStrip toolStrip4; - private System.Windows.Forms.ToolStripButton toolGoToCodeXStack; - private System.Windows.Forms.ToolStripButton btnFollow; - private System.Windows.Forms.Timer timerFollow; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator5; - private System.Windows.Forms.ToolStripButton btnFastHack; - private System.Windows.Forms.TabControl tabControl3; - private System.Windows.Forms.TabPage tabPage5; - private System.Windows.Forms.TextBox txtOutput; - private System.Windows.Forms.ToolStrip toolStrip5; - private System.Windows.Forms.TabPage tabPage6; - private System.Windows.Forms.TextBox txtCodeView; - private System.Windows.Forms.ToolStrip toolStrip6; - private System.Windows.Forms.ToolStripButton btnOpenTest; - - - } -} - diff --git a/src/DevTools/MoonSharp.VmDebugger/MainForm.cs b/src/DevTools/MoonSharp.VmDebugger/MainForm.cs deleted file mode 100644 index fae87cab..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/MainForm.cs +++ /dev/null @@ -1,454 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading; -using System.Windows.Forms; -using MoonSharp.Interpreter; -using MoonSharp.Interpreter.CoreLib; -using MoonSharp.Interpreter.Debugging; -using MoonSharp.Interpreter.Execution; -using MoonSharp.Interpreter.Execution.VM; -using MoonSharp.Interpreter.Loaders; - -namespace MoonSharp.Debugger -{ - public partial class MainForm : Form, IDebugger - { - List m_Watches = new List(); - - public MainForm() - { - InitializeComponent(); - } - - private void MainForm_Load(object sender, EventArgs e) - { - m_Ctx = SynchronizationContext.Current; - Script.WarmUp(); - //Script.DefaultOptions.TailCallOptimizationThreshold = 1; - } - - private void openToolStripMenuItem_Click(object sender, EventArgs e) - { - OpenFileDialog ofd = new OpenFileDialog(); - ofd.Title = "Load script"; - ofd.DefaultExt = "lua"; - ofd.Filter = "Lua files (*.lua)|*.lua|All files (*.*)|*.*"; - - if (ofd.ShowDialog() == DialogResult.OK) - { - DebugScript(ofd.FileName); - openToolStripMenuItem.Enabled = false; - } - } - - Script m_Script; - SynchronizationContext m_Ctx; - - private void Console_WriteLine(string fmt, params object[] args) - { - fmt = string.Format(fmt, args); - - m_Ctx.Post(str => - { - txtOutput.Text = txtOutput.Text + fmt.ToString().Replace("\n", "\r\n") + "\r\n"; - txtOutput.SelectionStart = txtOutput.Text.Length - 1; - txtOutput.SelectionLength = 0; - txtOutput.ScrollToCaret(); - }, fmt); - } - - - private void DebugScript(string filename) - { - m_Script = new Script(CoreModules.Basic | CoreModules.Table | CoreModules.TableIterators | CoreModules.Metatables); - // m_Script.Options.UseLuaErrorLocations = true; - m_Script.Options.DebugPrint = s => { Console_WriteLine("{0}", s); }; - - // ((ScriptLoaderBase)m_Script.Options.ScriptLoader).ModulePaths = ScriptLoaderBase.UnpackStringPaths("Modules/?;Modules/?.lua"); - - DynValue fn; - - try - { - fn = m_Script.LoadFile(filename, null, filename.Replace(':', '|')); - } - catch (Exception ex) - { - txtOutput.Text = ""; - Console_WriteLine("{0}", ex.Message); - return; - } - - m_Script.AttachDebugger(this); - - Thread m_Debugger = new Thread(() => DebugMain(fn)); - m_Debugger.Name = "MoonSharp Execution Thread"; - m_Debugger.IsBackground = true; - m_Debugger.Start(); - } - - - - public void SetSourceCode(SourceCode sourceCode) - { - } - - void IDebugger.SetByteCode(string[] byteCode) - { - string[] source = byteCode.Select((s, i) => string.Format("{0:X8} {1}", i, s)).ToArray(); - - m_Ctx.Send(o => - { - codeView.SourceCode = source; - }, null); - } - - DebuggerAction m_NextAction; - AutoResetEvent m_WaitLock = new AutoResetEvent(false); - AutoResetEvent m_WaitBack = new AutoResetEvent(false); - - DebuggerAction IDebugger.GetAction(int ip, SourceRef sourceCodeRef) - { - m_Ctx.Post(o => - { - codeView.ActiveLine = ip; - RefreshCodeView(sourceCodeRef); - }, null); - - m_WaitLock.WaitOne(); - - DebuggerAction action = m_NextAction; - m_NextAction = null; - - m_WaitBack.Set(); - - return action; - } - - SourceRef m_PrevRef = null; - - private void RefreshCodeView(SourceRef sourceCodeRef) - { - if (sourceCodeRef == m_PrevRef) - return; - - m_PrevRef = sourceCodeRef; - - if (sourceCodeRef == null) - { - txtCodeView.Text = "!! NULL !!"; - } - else - { - SourceCode sc = m_Script.GetSourceCode(sourceCodeRef.SourceIdx); - //txtCodeView.Text = sc.Lines[sourceCodeRef.FromLine + 1] + "\n" + - // sourceCodeRef.ToString(); - txtCodeView.Text = sc.GetCodeSnippet(sourceCodeRef) + "\r\n\r\n" + sourceCodeRef.ToString(); - } - } - - void DebugAction(DebuggerAction action) - { - bool savedState = timerFollow.Enabled; - timerFollow.Enabled = false; - - m_NextAction = action; - m_WaitLock.Set(); - - if (!m_WaitBack.WaitOne(1000)) - { - MessageBox.Show(this, "Operation timed out", "Timeout"); - } - else - { - timerFollow.Enabled = savedState; - } - } - - - void DebugMain(DynValue fn) - { - try - { - fn.Function.Call(); - } - catch (ScriptRuntimeException ex) - { - timerFollow.Enabled = false; - Console_WriteLine("Guest raised unhandled CLR exception: {0} -@{3:X8} {2}\n{1}\n", ex.GetType(), ex.ToString(), ex.DecoratedMessage, ex.InstructionPtr); - } - catch (Exception ex) - { - timerFollow.Enabled = false; - Console_WriteLine("Guest raised unhandled CLR exception: {0} \n{1}\n", ex.GetType(), ex.ToString()); - } - } - - private void StepIN() - { - DebugAction(new DebuggerAction() { Action = DebuggerAction.ActionType.ByteCodeStepIn }); - } - - private void StepOVER() - { - DebugAction(new DebuggerAction() { Action = DebuggerAction.ActionType.ByteCodeStepOver }); - } - - private void GO() - { - DebugAction(new DebuggerAction() { Action = DebuggerAction.ActionType.Run }); - } - - - void IDebugger.Update(WatchType watchType, IEnumerable items) - { - if (watchType == WatchType.CallStack) - m_Ctx.Post(UpdateCallStack, items); - if (watchType == WatchType.Watches) - m_Ctx.Post(UpdateWatches, items); - if (watchType == WatchType.VStack) - m_Ctx.Post(UpdateVStack, items); - } - void UpdateVStack(object o) - { - IEnumerable items = (IEnumerable)o; - - lvVStack.BeginUpdate(); - lvVStack.Items.Clear(); - - foreach (var item in items) - { - lvVStack.Add( - item.Address.ToString("X4"), - (item.Value != null) ? item.Value.Type.ToString() : "(undefined)", - (item.Value != null) ? item.Value.ToString() : "(undefined)" - ).Tag = item.Value; - } - - lvVStack.EndUpdate(); - - } - - - void UpdateWatches(object o) - { - IEnumerable items = (IEnumerable)o; - - lvWatches.BeginUpdate(); - lvWatches.Items.Clear(); - - foreach (var item in items) - { - lvWatches.Add( - item.Name ?? "(???)", - (item.Value != null) ? item.Value.Type.ToLuaTypeString() : "(undefined)", - (item.Value != null) ? item.Value.ToString() : "(undefined)", - (item.LValue != null) ? item.LValue.ToString() : "(undefined)" - ).Tag = item.Value; - } - - lvWatches.EndUpdate(); - - } - - void UpdateCallStack(object o) - { - IEnumerable items = (IEnumerable)o; - - lvCallStack.BeginUpdate(); - lvCallStack.Items.Clear(); - foreach (var item in items) - { - lvCallStack.Add( - item.Address.ToString("X8"), - item.Name ?? ((item.RetAddress < 0) ? "" : "?unknown??>"), - item.RetAddress.ToString("X8"), - item.BasePtr.ToString("X8") - ).Tag = item.Address; - } - - lvCallStack.Add("---", "", "---", "---"); - - lvCallStack.EndUpdate(); - } - - - - - List IDebugger.GetWatchItems() - { - return m_Watches; - } - - private void btnAddWatch_Click(object sender, EventArgs e) - { - string text = WatchInputDialog.GetNewWatchName(); - - if (!string.IsNullOrEmpty(text)) - { - string[] codeToAdd = text.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); - - m_Watches.AddRange(codeToAdd.Select(code => m_Script.CreateDynamicExpression(code))); - DebugAction(new DebuggerAction() { Action = DebuggerAction.ActionType.Refresh }); - } - } - - private void btnRemoveWatch_Click(object sender, EventArgs e) - { - HashSet itemsToRemove = new HashSet(lvWatches.SelectedItems.OfType().Select(lvi => lvi.Text)); - - int i = m_Watches.RemoveAll(w => itemsToRemove.Contains(w.ExpressionCode)); - - if (i != 0) - DebugAction(new DebuggerAction() { Action = DebuggerAction.ActionType.Refresh }); - } - private void stepInToolStripMenuItem_Click(object sender, EventArgs e) - { - StepIN(); - } - - private void btnOpenFile_Click(object sender, EventArgs e) - { - openToolStripMenuItem.PerformClick(); - } - - private void stepOverToolStripMenuItem_Click(object sender, EventArgs e) - { - StepOVER(); - } - - private void toolGO_Click(object sender, EventArgs e) - { - GO(); - } - - private void gOToolStripMenuItem_Click(object sender, EventArgs e) - { - GO(); - } - private void toolStripButton1_Click(object sender, EventArgs e) - { - StepIN(); - } - - private void toolStepOver_Click(object sender, EventArgs e) - { - StepOVER(); - } - - private void btnViewVStk_Click(object sender, EventArgs e) - { - ValueBrowser.StartBrowse(lvVStack.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault()); - } - - private void lvVStack_MouseDoubleClick(object sender, MouseEventArgs e) - { - ValueBrowser.StartBrowse(lvVStack.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault()); - } - - private void btnViewWatch_Click(object sender, EventArgs e) - { - ValueBrowser.StartBrowse(lvWatches.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault()); - } - - - private void lvWatches_MouseDoubleClick(object sender, MouseEventArgs e) - { - ValueBrowser.StartBrowse(lvWatches.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault()); - } - - private void toolGoToCodeVStack_Click(object sender, EventArgs e) - { - var v = lvVStack.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault(); - - if (v != null && v.Type == DataType.Function) - GotoBytecode(v.Function.EntryPointByteCodeLocation); - } - - private void toolGoToCodeWatches_Click(object sender, EventArgs e) - { - var v = lvWatches.SelectedItems.OfType().Select(lvi => lvi.Tag).Cast().FirstOrDefault(); - - if (v != null && v.Type == DataType.Function) - GotoBytecode(v.Function.EntryPointByteCodeLocation); - } - private void toolGoToCodeXStack_Click(object sender, EventArgs e) - { - var v = lvCallStack.SelectedItems.OfType().Select(lvi => lvi.Tag).OfType().FirstOrDefault(); - - if (v != 0) - GotoBytecode(v); - } - - private void GotoBytecode(int code) - { - codeView.CursorLine = code; - } - - private void timerFollow_Tick(object sender, EventArgs e) - { - toolStepIN.PerformClick(); - } - - private void btnFollow_Click(object sender, EventArgs e) - { - timerFollow.Start(); - } - - private void btnFastHack_Click(object sender, EventArgs e) - { - DebugScript(@"C:\temp\test.lua"); - } - - - - - void IDebugger.SetSourceCode(SourceCode sourceCode) - { - - } - - bool IDebugger.IsPauseRequested() - { - return false; - } - - - public void SignalExecutionEnded() - { - } - - - public void RefreshBreakpoints(IEnumerable refs) - { - } - - - public bool SignalRuntimeException(ScriptRuntimeException ex) - { - Console_WriteLine("Error: {0}", ex.DecoratedMessage); - return true; - } - - private void btnOpenTest_Click(object sender, EventArgs e) - { - - } - - public void SetDebugService(DebugService debugService) - { - } - - public DebuggerCaps GetDebuggerCaps() - { - return DebuggerCaps.CanDebugByteCode; - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/MainForm.resx b/src/DevTools/MoonSharp.VmDebugger/MainForm.resx deleted file mode 100644 index 210145a5..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/MainForm.resx +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 132, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== - - - - 237, 17 - - - 463, 17 - - - 568, 17 - - - 353, 17 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACe - DQAAAk1TRnQBSQFMAgEBBAEAAXABAQFwAQEBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA - AwABIAMAAQEBAAEgBgABIP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8AIgADDAEQA1kBvwP2 - Af8D9gH/A1kBvwMqAUADKgFAAyoBQAMqAUADKgFAAyoBQAMqAUADKgFAAyoBQAMqAUADKgFAEAAD9gH/ - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/5AAA1kBvwOcAf8DFAH/AxQB/wP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/xAAA/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wP2Af+QAAP2Af8DFAH/AxQB/wMUAf8D9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMU - Af8DFAH/AxQB/wP2Af8QAAP2Af8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/FAAD9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8cAAP2Af8D9gH/A/YB/wP2Af8D9gH/CAADIQEwAyEBMAQA - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/AxQB/wMUAf8DFAH/A/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/EAAD9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/xQA - A/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/HAAD9gH/AxQB/wMUAf8DFAH/A/YB/wQA - AyEBMANiAe8DYgHvAyEBMAP2Af8DFAH/AxQB/wMUAf8D9gH/A/YB/wMUAf8D9gH/A/YB/wP2Af8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wgAA/YB/wP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/DAAD9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wP2Af8cAAP2Af8DFAH/A/YB/wP2Af8D9gH/AyEBMANiAe8DhgH/AzYB/wNiAe8D9gH/A/YB/wP2 - Af8DFAH/A/YB/wP2Af8DFAH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8IAAP2Af8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - A/YB/wwAA/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8UAAP2Af8DFAH/ - A/YB/wQAAyEBMAM6AWADYgHvA4YB/wMUAf8DNgH/A2IB7wMhATAD9gH/AxQB/wP2Af8D9gH/AxQB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/CAAD9gH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wP2Af8UAAP2Af8DFAH/AxQB/wMU - Af8DFAH/AxQB/wMUAf8DFAH/A/YB/xQAA/YB/wMUAf8D9gH/AyEBMANiAe8DYgHvAzoBYANiAe8DhgH/ - AzYB/wNiAe8DIQEwA/YB/wMUAf8D9gH/A/YB/wMUAf8D9gH/A/YB/wP2Af8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wgAA/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/FAAD9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wP2Af8UAAP2 - Af8DFAH/A/YB/wNiAe8DhgH/AzYB/wNiAe8DOgFgA2IB7wP2Af8DYgHvAyEBMAP2Af8DFAH/A/YB/wP2 - Af8DFAH/AxQB/wMUAf8D9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wP2 - Af8MAAP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8YAAP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wgAA/YB/wMUAf8D9gH/A4YB/wMUAf8DFAH/ - AzYB/wNiAe8DYgHvA4YB/wM2Af8DYgHvA/YB/wMUAf8D9gH/A/YB/wMUAf8DFAH/AxQB/wP2Af8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wwAA/YB/wMUAf8DFAH/AxQB/wMU - Af8DFAH/AxQB/wMUAf8DFAH/A/YB/xgAA/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wMUAf8DFAH/ - AxQB/wMUAf8D9gH/CAAD9gH/AxQB/wP2Af8DhgH/AxQB/wMUAf8DFAH/AzYB/wPrAf8DhgH/AxQB/wM2 - Af8D9gH/AxQB/wP2Af8DWQG/A5wB/wMUAf8DFAH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2 - Af8D9gH/A/YB/wP2Af8D9gH/DAAD9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/ - GAAD9gH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/AxQB/wMUAf8DFAH/AxQB/wP2Af8IAAP2Af8DFAH/ - A/YB/wNiAe8DhgH/AxQB/wMUAf8DNgH/A2IB7wNiAe8DhgH/AzYB/wP2Af8DFAH/A/YB/wMMARAD9gH/ - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8MAAP2 - Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8QAAP2Af8D9gH/A/YB/wP2Af8D9gH/ - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/CAAD9gH/AxQB/wP2Af8DIQEwA2IB7wOG - Af8DNgH/A2IB7wMhATADIQEwA2IB7wNcAd8D9gH/AxQB/wP2Af8EAAP2Af8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/ - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/wP2Af8EAAP2Af8DFAH/AxQB/wMU - Af8DFAH/AxQB/wP2Af8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/CAAD9gH/AxQB/wP2Af8D9gH/ - A/YB/wNiAe8DYgHvAyEBMAgAA/YB/wP2Af8D9gH/AxQB/wP2Af8EAAP2Af8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/A/YB/wP2Af8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wP2Af8EAAP2Af8DFAH/AxQB/wMU - Af8DFAH/AxQB/wP2Af8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/CAAD9gH/AxQB/wMUAf8DFAH/ - A/YB/wMhATADIQEwDAAD9gH/AxQB/wMUAf8DFAH/A/YB/wQAA/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8D9gH/A/YB/wMUAf8DFAH/AxQB/wMUAf8DFAH/ - AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/AxQB/wMUAf8DFAH/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/ - A/YB/wP2Af8D9gH/A/YB/wP2Af8D9gH/A/YB/4AAAUIBTQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEB - BgABARYAA/+DAAHwAQ8E/wIAAfABDwT/AgAB8AEPAYABPwGDASACAAHwAQ8BgAE/AYIDAAHAAQMBgAE/ - AYADAAHAAQMBgAEPAYgDAAHAAQMB4AEPAYADAAHAAQMB4AEPAYADAAHgAQcB4AEBAYADAAHgAQcB4AEB - AYADAAHgAQcB4AEBAYADAAHgAQcBgAEBAYABAAGAAwABgAEBAYABYAGAAwABgAEBAYAB4AGAAwABgAEB - AYMB4AGAAwAE/ws= - - - - 673, 17 - - - 463, 17 - - - 568, 17 - - - 673, 17 - - - 999, 17 - - - 999, 17 - - - 1104, 17 - - - 1104, 17 - - - 778, 17 - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/MoonSharp.VmDebugger.csproj b/src/DevTools/MoonSharp.VmDebugger/MoonSharp.VmDebugger.csproj deleted file mode 100644 index fb709571..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/MoonSharp.VmDebugger.csproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - Debug - AnyCPU - {F4F82CCE-2E13-441B-939C-63CF2343B1C9} - WinExe - Properties - MoonSharp.Debugger - MoonSharp.VmDebugger - v3.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - - - true - bin\Dev\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Dev\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - true - bin\Devp4\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Devp4\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - - - - - - - - - - - - Component - - - - Form - - - MainForm.cs - - - - - UserControl - - - SourceCodeDebugControl.cs - - - Form - - - ValueBrowser.cs - - - Form - - - WatchInputDialog.cs - - - MainForm.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - SourceCodeDebugControl.cs - - - ValueBrowser.cs - - - WatchInputDialog.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - Always - - - Always - - - - - {4ad350e6-e296-43ef-9fea-cb70358467e4} - MoonSharp.Interpreter.Tests.net35-client - - - {91ea9b9d-fe03-4273-bdaf-8ad42ede1e59} - MoonSharp.Interpreter.net35-client - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/Program.cs b/src/DevTools/MoonSharp.VmDebugger/Program.cs deleted file mode 100644 index 8ce4efce..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace MoonSharp.Debugger -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/Properties/AssemblyInfo.cs b/src/DevTools/MoonSharp.VmDebugger/Properties/AssemblyInfo.cs deleted file mode 100644 index bca4376d..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MoonSharp.Debugger")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MoonSharp.Debugger")] -[assembly: AssemblyCopyright("Copyright © 2014-2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("43c6203a-fd70-44f6-bdd9-30588e7c9733")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.Designer.cs deleted file mode 100644 index 307264ab..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.Designer.cs +++ /dev/null @@ -1,243 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MoonSharp.Debugger.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MoonSharp.Debugger.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap AddConnection_477 { - get { - object obj = ResourceManager.GetObject("AddConnection_477", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap AddMark_10580 { - get { - object obj = ResourceManager.GetObject("AddMark_10580", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Breakall_6323 { - get { - object obj = ResourceManager.GetObject("Breakall_6323", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap BreakpointEnabled_6584_16x { - get { - object obj = ResourceManager.GetObject("BreakpointEnabled_6584_16x", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Clearallrequests_8816 { - get { - object obj = ResourceManager.GetObject("Clearallrequests_8816", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap DisassemblyWindow_6536 { - get { - object obj = ResourceManager.GetObject("DisassemblyWindow_6536", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap FindSymbol_6263 { - get { - object obj = ResourceManager.GetObject("FindSymbol_6263", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap GoToDeclaration_5576 { - get { - object obj = ResourceManager.GetObject("GoToDeclaration_5576", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Help_6522 { - get { - object obj = ResourceManager.GetObject("Help_6522", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap NavigateBackwards_6270 { - get { - object obj = ResourceManager.GetObject("NavigateBackwards_6270", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap NavigateForward_6271 { - get { - object obj = ResourceManager.GetObject("NavigateForward_6271", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Open_6529 { - get { - object obj = ResourceManager.GetObject("Open_6529", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Restart_6322 { - get { - object obj = ResourceManager.GetObject("Restart_6322", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap RPCThread_10388 { - get { - object obj = ResourceManager.GetObject("RPCThread_10388", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap startwithoutdebugging_6556 { - get { - object obj = ResourceManager.GetObject("startwithoutdebugging_6556", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap StepIn_6326 { - get { - object obj = ResourceManager.GetObject("StepIn_6326", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Stepout_6327 { - get { - object obj = ResourceManager.GetObject("Stepout_6327", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap StepOver_6328 { - get { - object obj = ResourceManager.GetObject("StepOver_6328", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.resx b/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.resx deleted file mode 100644 index ad9d9d28..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Properties/Resources.resx +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\FindSymbol_6263.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\StepIn_6326.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Stepout_6327.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Restart_6322.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\StepOver_6328.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\NavigateForward_6271.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Open_6529.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\DisassemblyWindow_6536.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\AddMark_10580.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\RPCThread_10388.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\AddConnection_477.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\NavigateBackwards_6270.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\startwithoutdebugging_6556.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Help_6522.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\BreakpointEnabled_6584_16x.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Clearallrequests_8816.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Breakall_6323.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - - ..\Resources\GoToDeclaration_5576.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.Designer.cs deleted file mode 100644 index e681535f..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace MoonSharp.Debugger.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.settings b/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/AddConnection_477.png b/src/DevTools/MoonSharp.VmDebugger/Resources/AddConnection_477.png deleted file mode 100644 index 3157b1ac..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/AddConnection_477.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/AddMark_10580.png b/src/DevTools/MoonSharp.VmDebugger/Resources/AddMark_10580.png deleted file mode 100644 index 8c41031c..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/AddMark_10580.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Breakall_6323.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Breakall_6323.png deleted file mode 100644 index 0fac7df8..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Breakall_6323.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/BreakpointEnabled_6584_16x.png b/src/DevTools/MoonSharp.VmDebugger/Resources/BreakpointEnabled_6584_16x.png deleted file mode 100644 index ecbaa45c..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/BreakpointEnabled_6584_16x.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Clearallrequests_8816.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Clearallrequests_8816.png deleted file mode 100644 index 4b6d6d4d..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Clearallrequests_8816.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/DisassemblyWindow_6536.png b/src/DevTools/MoonSharp.VmDebugger/Resources/DisassemblyWindow_6536.png deleted file mode 100644 index 0c26ff1e..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/DisassemblyWindow_6536.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/FindSymbol_6263.png b/src/DevTools/MoonSharp.VmDebugger/Resources/FindSymbol_6263.png deleted file mode 100644 index 89c98f79..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/FindSymbol_6263.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/GoToDeclaration_5576.png b/src/DevTools/MoonSharp.VmDebugger/Resources/GoToDeclaration_5576.png deleted file mode 100644 index fb5bcd2b..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/GoToDeclaration_5576.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Help_6522.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Help_6522.png deleted file mode 100644 index a9596992..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Help_6522.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateBackwards_6270.png b/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateBackwards_6270.png deleted file mode 100644 index bf879318..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateBackwards_6270.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateForward_6271.png b/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateForward_6271.png deleted file mode 100644 index 52ceb0df..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/NavigateForward_6271.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Open_6529.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Open_6529.png deleted file mode 100644 index 74822865..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Open_6529.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/RPCThread_10388.png b/src/DevTools/MoonSharp.VmDebugger/Resources/RPCThread_10388.png deleted file mode 100644 index 651ed08c..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/RPCThread_10388.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Restart_6322.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Restart_6322.png deleted file mode 100644 index d5a06ce7..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Restart_6322.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/StepIn_6326.png b/src/DevTools/MoonSharp.VmDebugger/Resources/StepIn_6326.png deleted file mode 100644 index 87fdcf9d..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/StepIn_6326.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/StepOver_6328.png b/src/DevTools/MoonSharp.VmDebugger/Resources/StepOver_6328.png deleted file mode 100644 index 7ff64259..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/StepOver_6328.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/Stepout_6327.png b/src/DevTools/MoonSharp.VmDebugger/Resources/Stepout_6327.png deleted file mode 100644 index 8ef5a65a..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/Stepout_6327.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/Resources/startwithoutdebugging_6556.png b/src/DevTools/MoonSharp.VmDebugger/Resources/startwithoutdebugging_6556.png deleted file mode 100644 index ed280eba..00000000 Binary files a/src/DevTools/MoonSharp.VmDebugger/Resources/startwithoutdebugging_6556.png and /dev/null differ diff --git a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.Designer.cs deleted file mode 100644 index 6d86e256..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.Designer.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace MoonSharp.Debugger -{ - partial class SourceCodeDebugControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.vertScroll = new System.Windows.Forms.VScrollBar(); - this.horizScroll = new System.Windows.Forms.HScrollBar(); - this.SuspendLayout(); - // - // vertScroll - // - this.vertScroll.Dock = System.Windows.Forms.DockStyle.Right; - this.vertScroll.Location = new System.Drawing.Point(939, 0); - this.vertScroll.Name = "vertScroll"; - this.vertScroll.Size = new System.Drawing.Size(17, 656); - this.vertScroll.TabIndex = 0; - this.vertScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vertScroll_Scroll); - this.vertScroll.ValueChanged += new System.EventHandler(this.vertScroll_ValueChanged); - // - // horizScroll - // - this.horizScroll.Dock = System.Windows.Forms.DockStyle.Bottom; - this.horizScroll.Location = new System.Drawing.Point(0, 639); - this.horizScroll.Name = "horizScroll"; - this.horizScroll.Size = new System.Drawing.Size(939, 17); - this.horizScroll.TabIndex = 1; - this.horizScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.horizScroll_Scroll); - this.horizScroll.ValueChanged += new System.EventHandler(this.horizScroll_ValueChanged); - // - // SourceCodeDebugControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.Controls.Add(this.horizScroll); - this.Controls.Add(this.vertScroll); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Consolas", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ForeColor = System.Drawing.Color.Gainsboro; - this.Margin = new System.Windows.Forms.Padding(4); - this.Name = "SourceCodeDebugControl"; - this.Size = new System.Drawing.Size(956, 656); - this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.SourceCodeDebugControl_MouseClick); - this.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.SourceCodeDebugControl_PreviewKeyDown); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.VScrollBar vertScroll; - private System.Windows.Forms.HScrollBar horizScroll; - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.cs b/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.cs deleted file mode 100644 index 987e2c3e..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.cs +++ /dev/null @@ -1,208 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace MoonSharp.Debugger -{ - public partial class SourceCodeDebugControl : UserControl - { - private string[] m_SourceCode; - private bool[] m_BreakPoints; - int m_Line = 0; - int m_XOffs = 0; - int m_ActiveLine = -1; - int m_CursorLine = 0; - Brush m_CursorBrush = new SolidBrush(Color.FromArgb(64, Color.White)); - - public int ActiveLine - { - get { return m_ActiveLine; } - set - { - m_CursorLine = m_ActiveLine = value; - ScrollToIncludeLine(m_ActiveLine); - Invalidate(); - } - } - - private void ScrollToIncludeLine(int line) - { - if (line == m_Line) - return; - - if (line < m_Line) - m_Line = line; - - if (line > m_Line + (this.GetHeight() / this.Font.Height)) - m_Line = line; - } - - private int GetHeight() - { - return this.Height - horizScroll.Height; - } - - public int CursorLine - { - get { return m_CursorLine; } - set { m_CursorLine = value; ScrollToIncludeLine(m_CursorLine); Invalidate(); } - } - - public SourceCodeDebugControl() - { - InitializeComponent(); - } - - public string[] SourceCode - { - get { return m_SourceCode; } - set - { - if (value == null) - { - m_SourceCode = null; - m_BreakPoints = null; - } - else - { - m_SourceCode = value.Select(s => s.Replace("\t", " ")).ToArray(); - m_BreakPoints = new bool[m_SourceCode.Length]; - } - - OnSourceCodeChanged(); - } - } - - private void OnSourceCodeChanged() - { - m_Line = 0; - - if (vertScroll != null) - { - vertScroll.Value = 0; - vertScroll.Maximum = (m_SourceCode != null) ? m_SourceCode.Length : 10; - horizScroll.Maximum = 300; - horizScroll.Value = 0; - m_CursorLine = 0; - m_ActiveLine = -1; - } - - Invalidate(); - } - - protected override bool DoubleBuffered - { - get { return true; } - set { base.DoubleBuffered = true; } - } - - protected override void OnPaintBackground(PaintEventArgs e) - { - } - - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaintBackground(e); - - if (m_SourceCode == null) - return; - - int H = this.Font.Height; - int W = (int)e.Graphics.MeasureString("X", this.Font).Width; - int Y = 0; - - for (int i = m_Line; i < m_SourceCode.Length && H < this.GetHeight(); i++, Y += H) - { - if (m_ActiveLine == i) - { - e.Graphics.FillRectangle(Brushes.DarkCyan, 0, Y, Width, H); - } - - if (m_BreakPoints[i]) - { - e.Graphics.FillEllipse(Brushes.Red, 5, Y + 5, 10, 10); - e.Graphics.DrawEllipse(Pens.DarkRed, 5, Y + 5, 10, 10); -// e.Graphics.FillRectangle(Brushes.DarkRed, 0, Y, Width, H); - } - - if (i == m_CursorLine) - e.Graphics.FillRectangle(m_CursorBrush, -1, Y, Width + 1, H); - - if (m_ActiveLine == i) - { - e.Graphics.FillRectangle(Brushes.Aqua, 3, Y + 8, 14, 6); - e.Graphics.DrawRectangle(Pens.DarkBlue, 3, Y + 8, 14, 6); - } - - string str = m_SourceCode[i]; - - if (m_XOffs != 0) - { - if (m_XOffs >= str.Length) - continue; - else - str = str.Substring(m_XOffs); - } - - e.Graphics.DrawString(str, this.Font, Brushes.Gainsboro, 20, Y); - } - } - - private void vertScroll_Scroll(object sender, ScrollEventArgs e) - { - m_Line = Math.Min(m_SourceCode.Length - 1, Math.Max(0, e.NewValue)); - Invalidate(); - } - - private void vertScroll_ValueChanged(object sender, EventArgs e) - { - m_Line = Math.Min(m_SourceCode.Length - 1, Math.Max(0, vertScroll.Value)); - Invalidate(); - } - - private void horizScroll_Scroll(object sender, ScrollEventArgs e) - { - m_XOffs = horizScroll.Value; - Invalidate(); - } - - private void horizScroll_ValueChanged(object sender, EventArgs e) - { - m_XOffs = horizScroll.Value; - Invalidate(); - } - - public void SetBreakpoint(int i, bool val) - { - m_BreakPoints[i] = val; - } - - private void SourceCodeDebugControl_MouseClick(object sender, MouseEventArgs e) - { - int Y = e.Y / this.Font.Height; - - Y += m_Line; - - m_CursorLine = Y; - - Invalidate(); - } - - - private void SourceCodeDebugControl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) - { - if (e.KeyCode == Keys.Up) - m_CursorLine = Math.Max(0, m_CursorLine - 1); - if (e.KeyCode == Keys.Down) - m_CursorLine = Math.Min(m_SourceCode.Length - 1, m_CursorLine + 1); - if (e.KeyCode == Keys.F9) - m_BreakPoints[m_CursorLine] = !m_BreakPoints[m_CursorLine]; - - } - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.resx b/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.resx deleted file mode 100644 index 7080a7d1..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/SourceCodeDebugControl.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.Designer.cs deleted file mode 100644 index b3ff83d6..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.Designer.cs +++ /dev/null @@ -1,329 +0,0 @@ -namespace MoonSharp.Debugger -{ - partial class ValueBrowser - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.toolBack = new System.Windows.Forms.ToolStripButton(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.toolDigData = new System.Windows.Forms.ToolStripButton(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.lvProps = new System.Windows.Forms.ListView(); - this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.lvTableData = new System.Windows.Forms.ListView(); - this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.txtString = new System.Windows.Forms.TextBox(); - this.lblData = new System.Windows.Forms.Label(); - this.lvMetaTable = new System.Windows.Forms.ListView(); - this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.label4 = new System.Windows.Forms.Label(); - this.toolStrip1.SuspendLayout(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.SuspendLayout(); - // - // toolStrip1 - // - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolBack, - this.toolStripSeparator1, - this.toolDigData}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(963, 25); - this.toolStrip1.TabIndex = 0; - this.toolStrip1.Text = "toolStrip1"; - // - // toolBack - // - this.toolBack.Enabled = false; - this.toolBack.Image = global::MoonSharp.Debugger.Properties.Resources.NavigateBackwards_6270; - this.toolBack.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolBack.Name = "toolBack"; - this.toolBack.Size = new System.Drawing.Size(52, 22); - this.toolBack.Text = "Back"; - this.toolBack.Click += new System.EventHandler(this.toolBack_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); - // - // toolDigData - // - this.toolDigData.Image = global::MoonSharp.Debugger.Properties.Resources.FindSymbol_6263; - this.toolDigData.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolDigData.Name = "toolDigData"; - this.toolDigData.Size = new System.Drawing.Size(79, 22); - this.toolDigData.Text = "View Data"; - this.toolDigData.Click += new System.EventHandler(this.toolDigData_Click); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 25); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.lvProps); - this.splitContainer1.Panel1.Controls.Add(this.label2); - this.splitContainer1.Panel1.Controls.Add(this.label1); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); - this.splitContainer1.Size = new System.Drawing.Size(963, 647); - this.splitContainer1.SplitterDistance = 321; - this.splitContainer1.TabIndex = 1; - // - // lvProps - // - this.lvProps.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2}); - this.lvProps.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvProps.FullRowSelect = true; - this.lvProps.GridLines = true; - this.lvProps.Location = new System.Drawing.Point(0, 17); - this.lvProps.MultiSelect = false; - this.lvProps.Name = "lvProps"; - this.lvProps.Size = new System.Drawing.Size(321, 630); - this.lvProps.TabIndex = 3; - this.lvProps.UseCompatibleStateImageBehavior = false; - this.lvProps.View = System.Windows.Forms.View.Details; - this.lvProps.SelectedIndexChanged += new System.EventHandler(this.lvProps_SelectedIndexChanged); - this.lvProps.DoubleClick += new System.EventHandler(this.lvAnyTable_DoubleClick); - // - // columnHeader1 - // - this.columnHeader1.Text = "Key"; - this.columnHeader1.Width = 122; - // - // columnHeader2 - // - this.columnHeader2.Text = "Value"; - this.columnHeader2.Width = 175; - // - // label2 - // - this.label2.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label2.Dock = System.Windows.Forms.DockStyle.Top; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.label2.Location = new System.Drawing.Point(0, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(321, 17); - this.label2.TabIndex = 1; - this.label2.Text = "PROPERTIES"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(48, 90); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(0, 13); - this.label1.TabIndex = 0; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.lvTableData); - this.splitContainer2.Panel1.Controls.Add(this.txtString); - this.splitContainer2.Panel1.Controls.Add(this.lblData); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.lvMetaTable); - this.splitContainer2.Panel2.Controls.Add(this.label4); - this.splitContainer2.Size = new System.Drawing.Size(638, 647); - this.splitContainer2.SplitterDistance = 290; - this.splitContainer2.TabIndex = 0; - // - // lvTableData - // - this.lvTableData.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader3, - this.columnHeader4}); - this.lvTableData.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvTableData.FullRowSelect = true; - this.lvTableData.GridLines = true; - this.lvTableData.Location = new System.Drawing.Point(0, 17); - this.lvTableData.MultiSelect = false; - this.lvTableData.Name = "lvTableData"; - this.lvTableData.Size = new System.Drawing.Size(638, 273); - this.lvTableData.TabIndex = 6; - this.lvTableData.UseCompatibleStateImageBehavior = false; - this.lvTableData.View = System.Windows.Forms.View.Details; - this.lvTableData.SelectedIndexChanged += new System.EventHandler(this.lvTableData_SelectedIndexChanged); - this.lvTableData.DoubleClick += new System.EventHandler(this.lvAnyTable_DoubleClick); - // - // columnHeader3 - // - this.columnHeader3.Text = "Key"; - this.columnHeader3.Width = 260; - // - // columnHeader4 - // - this.columnHeader4.Text = "Value"; - this.columnHeader4.Width = 260; - // - // txtString - // - this.txtString.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtString.Location = new System.Drawing.Point(0, 17); - this.txtString.Multiline = true; - this.txtString.Name = "txtString"; - this.txtString.ReadOnly = true; - this.txtString.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtString.Size = new System.Drawing.Size(638, 273); - this.txtString.TabIndex = 5; - // - // lblData - // - this.lblData.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.lblData.Dock = System.Windows.Forms.DockStyle.Top; - this.lblData.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblData.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.lblData.Location = new System.Drawing.Point(0, 0); - this.lblData.Name = "lblData"; - this.lblData.Size = new System.Drawing.Size(638, 17); - this.lblData.TabIndex = 2; - this.lblData.Text = "DATA"; - this.lblData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lvMetaTable - // - this.lvMetaTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader5, - this.columnHeader6}); - this.lvMetaTable.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvMetaTable.FullRowSelect = true; - this.lvMetaTable.GridLines = true; - this.lvMetaTable.Location = new System.Drawing.Point(0, 17); - this.lvMetaTable.MultiSelect = false; - this.lvMetaTable.Name = "lvMetaTable"; - this.lvMetaTable.Size = new System.Drawing.Size(638, 336); - this.lvMetaTable.TabIndex = 4; - this.lvMetaTable.UseCompatibleStateImageBehavior = false; - this.lvMetaTable.View = System.Windows.Forms.View.Details; - this.lvMetaTable.SelectedIndexChanged += new System.EventHandler(this.lvMetaTable_SelectedIndexChanged); - this.lvMetaTable.DoubleClick += new System.EventHandler(this.lvAnyTable_DoubleClick); - // - // columnHeader5 - // - this.columnHeader5.Text = "Key"; - this.columnHeader5.Width = 260; - // - // columnHeader6 - // - this.columnHeader6.Text = "Value"; - this.columnHeader6.Width = 260; - // - // label4 - // - this.label4.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label4.Dock = System.Windows.Forms.DockStyle.Top; - this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.label4.Location = new System.Drawing.Point(0, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(638, 17); - this.label4.TabIndex = 2; - this.label4.Text = "METATABLE"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // ValueBrowser - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(963, 672); - this.Controls.Add(this.splitContainer1); - this.Controls.Add(this.toolStrip1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ValueBrowser"; - this.Text = "MoonSharp Value Browser"; - this.Load += new System.EventHandler(this.ValueBrowser_Load); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel1.PerformLayout(); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel1.PerformLayout(); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ToolStrip toolStrip1; - private System.Windows.Forms.ToolStripButton toolBack; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; - private System.Windows.Forms.ToolStripButton toolDigData; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.ListView lvProps; - private System.Windows.Forms.ColumnHeader columnHeader1; - private System.Windows.Forms.ColumnHeader columnHeader2; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.Label lblData; - private System.Windows.Forms.ListView lvMetaTable; - private System.Windows.Forms.ColumnHeader columnHeader5; - private System.Windows.Forms.ColumnHeader columnHeader6; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox txtString; - private System.Windows.Forms.ListView lvTableData; - private System.Windows.Forms.ColumnHeader columnHeader3; - private System.Windows.Forms.ColumnHeader columnHeader4; - } -} \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.cs b/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.cs deleted file mode 100644 index 5e47cc5c..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using MoonSharp.Interpreter; - -namespace MoonSharp.Debugger -{ - public partial class ValueBrowser : Form - { - Stack m_ValueStack = new Stack(); - public static void StartBrowse(DynValue v) - { - if (v == null) - return; - - ValueBrowser b = new ValueBrowser(); - b.m_ValueStack.Push(v); - b.ShowDialog(); - } - - public ValueBrowser() - { - InitializeComponent(); - } - - private void ValueBrowser_Load(object sender, EventArgs e) - { - InvalidateData(); - } - - private void InvalidateData() - { - DynValue V = m_ValueStack.Peek(); - toolBack.Enabled = (m_ValueStack.Count > 1); - - lvMetaTable.BeginUpdate(); - lvProps.BeginUpdate(); - lvTableData.BeginUpdate(); - - lvMetaTable.Items.Clear(); - lvProps.Items.Clear(); - txtString.Text = ""; - lvTableData.Items.Clear(); - lblData.Text = "VALUE"; - lvTableData.Visible = false; - txtString.Visible = false; - - AddProperty("Ref ID#", V.ReferenceID.ToString("X8")); - AddProperty("Read Only", V.ReadOnly); - AddProperty("VM Type", V.Type); - - switch (V.Type) - { - case DataType.Nil: - txtString.Visible = true; - txtString.Text = "Value is nil"; - break; - case DataType.Boolean: - txtString.Visible = true; - txtString.Text = V.Boolean.ToString(); - break; - case DataType.Number: - txtString.Visible = true; - txtString.Text = V.Boolean.ToString(); - break; - case DataType.String: - txtString.Visible = true; - txtString.Text = V.String.ToString(); - AddProperty("Raw Length", V.GetLength()); - break; - case DataType.Function: - lvTableData.Visible = true; - lblData.Text = "CLOSURE SCOPE"; - BuildFunctionTable(V); - break; - case DataType.Table: - lvTableData.Visible = true; - lblData.Text = "TABLE CONTENTS"; - AddProperty("Raw Length", V.GetLength()); - BuildTableTable(lvTableData, V); - break; - case DataType.Tuple: - lvTableData.Visible = true; - lblData.Text = "TUPLE"; - AddProperty("Count", V.Tuple.Length); - BuildTupleTable(V); - break; - case DataType.ClrFunction: - txtString.Visible = true; - txtString.Text = "Value is a CLR function."; - break; - case DataType.UserData: - txtString.Visible = true; - txtString.Text = "Value is a CLR object (userdata)."; - break; - case DataType.Thread: - txtString.Visible = true; - txtString.Text = "Value is a coroutine."; - break; - default: - break; - } - - Colorize(lvMetaTable); - Colorize(lvProps); - Colorize(lvTableData); - - lvMetaTable.EndUpdate(); - lvProps.EndUpdate(); - lvTableData.EndUpdate(); - } - - private void Colorize(ListView lv) - { - foreach (ListViewItem lvi in lv.Items) - { - if (lvi.Tag is DynValue) - { - lvi.ForeColor = Color.Blue; - } - } - } - - - - private void BuildFunctionTable(DynValue V) - { - var F = V.Function; - lvProps.Add("Bytecode Location", F.EntryPointByteCodeLocation.ToString("X8")); - - for (int i = 0; i < F.GetUpvaluesCount(); i++) - { - lvTableData.Add(F.GetUpvalueName(i), F.GetUpvalue(i)).Tag = F.GetUpvalue(i); - } - } - - private void BuildTupleTable(DynValue V) - { - var T = V.Tuple; - - for (int i = 0; i < T.Length; i++) - { - lvTableData.Add(i.ToString(), T[i]).Tag = T[i]; - } - } - - private void BuildTableTable(ListView listView, DynValue V) - { - var T = V.Table; - - foreach (var kvp in T.Pairs) - { - listView.Add(kvp.Key, kvp.Value).Tag = kvp.Value; - } - } - - private void AddProperty(string p1, object p2) - { - lvProps.Add(p1, p2.ToString()); - } - - private void lvTableData_SelectedIndexChanged(object sender, EventArgs e) - { - lvMetaTable.SelectedIndices.Clear(); - lvProps.SelectedIndices.Clear(); - } - - private void lvMetaTable_SelectedIndexChanged(object sender, EventArgs e) - { - lvTableData.SelectedIndices.Clear(); - lvProps.SelectedIndices.Clear(); - } - - private void lvProps_SelectedIndexChanged(object sender, EventArgs e) - { - lvTableData.SelectedIndices.Clear(); - lvMetaTable.SelectedIndices.Clear(); - } - - private void lvAnyTable_DoubleClick(object sender, EventArgs e) - { - DigData(sender as ListView); - } - - private void DigData(ListView listView) - { - if (listView == null) return; - ListViewItem lvi = listView.SelectedItems.OfType().FirstOrDefault(); - if (lvi == null) return; - - DynValue v = lvi.Tag as DynValue; - - if (v != null) - { - m_ValueStack.Push(v); - InvalidateData(); - } - } - - private void toolDigData_Click(object sender, EventArgs e) - { - ListView[] lvs = new ListView[] { lvMetaTable, lvTableData, lvProps }; - DigData(lvs.FirstOrDefault(lv => lv.SelectedItems.Count > 0)); - } - - private void toolBack_Click(object sender, EventArgs e) - { - m_ValueStack.Pop(); - InvalidateData(); - } - - - - - - - - - - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.resx b/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.resx deleted file mode 100644 index 061f9e8d..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/ValueBrowser.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.Designer.cs b/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.Designer.cs deleted file mode 100644 index fad85d33..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.Designer.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace MoonSharp.Debugger -{ - partial class WatchInputDialog - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtWatch = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // txtWatch - // - this.txtWatch.Location = new System.Drawing.Point(79, 15); - this.txtWatch.Name = "txtWatch"; - this.txtWatch.Size = new System.Drawing.Size(238, 20); - this.txtWatch.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 18); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(61, 13); - this.label1.TabIndex = 1; - this.label1.Text = "Add watch:"; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Location = new System.Drawing.Point(183, 51); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(64, 31); - this.btnOK.TabIndex = 2; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(253, 51); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 31); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - // - // WatchInputDialog - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(338, 98); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.label1); - this.Controls.Add(this.txtWatch); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "WatchInputDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Add new watch.."; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox txtWatch; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - } -} \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.cs b/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.cs deleted file mode 100644 index 3923ef84..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace MoonSharp.Debugger -{ - public partial class WatchInputDialog : Form - { - public WatchInputDialog() - { - InitializeComponent(); - } - - public static string GetNewWatchName() - { - WatchInputDialog dlg = new WatchInputDialog(); - var res = dlg.ShowDialog(); - - if (res == DialogResult.OK) - return dlg.txtWatch.Text; - - return null; - } - - - } -} diff --git a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.resx b/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.resx deleted file mode 100644 index 7080a7d1..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/WatchInputDialog.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/MoonSharp.VmDebugger/packages.config b/src/DevTools/MoonSharp.VmDebugger/packages.config deleted file mode 100644 index 0816f446..00000000 --- a/src/DevTools/MoonSharp.VmDebugger/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/DevTools/MoonSharpSL5ReplDemo/App.xaml b/src/DevTools/MoonSharpSL5ReplDemo/App.xaml deleted file mode 100644 index 4e67d384..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/App.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/src/DevTools/MoonSharpSL5ReplDemo/App.xaml.cs b/src/DevTools/MoonSharpSL5ReplDemo/App.xaml.cs deleted file mode 100644 index aa145e71..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/App.xaml.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -namespace MoonSharpSL5ReplDemo -{ - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - this.RootVisual = new MainPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); - } - } - - private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} diff --git a/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml b/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml deleted file mode 100644 index 954bf370..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml.cs b/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml.cs deleted file mode 100644 index 27dfba15..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/MainPage.xaml.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using MoonSharp.Interpreter; -using MoonSharp.Interpreter.REPL; - -namespace MoonSharpSL5ReplDemo -{ - public partial class MainPage : UserControl - { - Script script; - ReplHistoryInterpreter interpreter; - - public MainPage() - { - InitializeComponent(); - } - - private void UserControl_Loaded(object sender, RoutedEventArgs e) - { - Console_WriteLine("MoonSharp REPL {0} [{1}]", Script.VERSION, Script.GlobalOptions.Platform.GetPlatformName()); - Console_WriteLine("Copyright (C) 2014-2015 Marco Mastropaolo"); - Console_WriteLine("http://www.moonsharp.org"); - Console_WriteLine(); - - Console_WriteLine("Type Lua code in the text box below to execute it."); - Console_WriteLine("The 'io', 'file' and parts of the 'os' modules are not available due to Silverlight restrictions."); - Console_WriteLine("Type list() or list() to see which globals are available."); - Console_WriteLine(); - Console_WriteLine("Welcome."); - Console_WriteLine(); - - script = new Script(CoreModules.Preset_Complete); - - script.DoString(@" -local function pad(str, len) - str = str .. ' ' .. string.rep('.', len); - str = string.sub(str, 1, len); - return str; -end - -function list(lib) - if (lib == nil) then lib = _G; end - - if (type(lib) ~= 'table') then - print('A table was expected to list command.'); - return - end - - for k, v in pairs(lib) do - print(pad(type(v), 12) .. ' ' .. k) - end -end"); - - script.Options.DebugPrint = s => Console_WriteLine(s); - - interpreter = new ReplHistoryInterpreter(script, 100) - { - HandleDynamicExprs = true, - HandleClassicExprsSyntax = true - }; - - - DoPrompt(); - } - - private void Console_WriteLine(string str = null) - { - txtOutput.Text += (str ?? "") + "\n"; - scroller.ScrollToVerticalOffset(scroller.ScrollableHeight); - scroller.UpdateLayout(); - } - - private void Console_WriteLine(string format, params object[] args) - { - string str = string.Format(format, args); - Console_WriteLine(str); - } - - private void DoPrompt() - { - lblPrompt.Text = interpreter.ClassicPrompt; - txtInput.Text = ""; - txtInput.Focus(); - } - - private void txtInput_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - { - Console_WriteLine(lblPrompt.Text + " " + txtInput.Text); - - try - { - DynValue dv = interpreter.Evaluate(txtInput.Text); - - if (dv != null) - { - if (dv.Type == DataType.Void) - Console_WriteLine("ok"); - else - Console_WriteLine("{0}", dv); - } - } - catch (InterpreterException ex) - { - Console_WriteLine("{0}", ex.DecoratedMessage ?? ex.Message); - } - catch (Exception ex) - { - Console_WriteLine("Unexpected error: {0}", ex.Message); - } - - DoPrompt(); - } - else if (e.Key == Key.Up) - { - string v = interpreter.HistoryPrev(); - if (v != null) - { - txtInput.Text = v; - txtInput.Select(txtInput.Text.Length, 0); - } - } - else if (e.Key == Key.Down) - { - string v = interpreter.HistoryNext(); - if (v != null) - { - txtInput.Text = v; - txtInput.Select(txtInput.Text.Length, 0); - } - } - - } - - - - - } -} diff --git a/src/DevTools/MoonSharpSL5ReplDemo/MoonSharpSL5ReplDemo.csproj b/src/DevTools/MoonSharpSL5ReplDemo/MoonSharpSL5ReplDemo.csproj deleted file mode 100644 index 65ac061e..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/MoonSharpSL5ReplDemo.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {69B110B4-E578-4854-8F63-D80E4E14E1B6} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - MoonSharpSL5ReplDemo - MoonSharpSL5ReplDemo - Silverlight - v5.0 - $(TargetFrameworkVersion) - true - - - true - true - MoonSharpSL5ReplDemo.xap - Properties\AppManifest.xml - MoonSharpSL5ReplDemo.App - MoonSharpSL5ReplDemoTestPage.html - true - true - false - Properties\OutOfBrowserSettings.xml - false - true - - - - - - v3.5 - - - true - full - false - Bin\Debug - DEBUG;TRACE;SILVERLIGHT - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SILVERLIGHT - true - true - prompt - 4 - - - true - bin\Devp4\ - DEBUG;TRACE;SILVERLIGHT - true - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - true - - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\sl4\Microsoft.Threading.Tasks.dll - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\sl4\Microsoft.Threading.Tasks.Extensions.dll - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\sl4\Microsoft.Threading.Tasks.Extensions.Silverlight.dll - - - - ..\..\packages\Microsoft.Bcl.1.1.8\lib\sl5\System.IO.dll - - - ..\..\packages\Microsoft.Bcl.1.1.8\lib\sl5\System.Runtime.dll - - - ..\..\packages\Microsoft.Bcl.1.1.8\lib\sl5\System.Threading.Tasks.dll - - - - - $(TargetFrameworkDirectory)System.Core.dll - - - - - - - - App.xaml - - - MainPage.xaml - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - - {49f32476-fca0-45fd-8f89-0c7c0d15e409} - MoonSharp.Interpreter.portable40 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/MoonSharpSL5ReplDemo/Properties/AppManifest.xml b/src/DevTools/MoonSharpSL5ReplDemo/Properties/AppManifest.xml deleted file mode 100644 index 6712a117..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/Properties/AppManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/src/DevTools/MoonSharpSL5ReplDemo/Properties/AssemblyInfo.cs b/src/DevTools/MoonSharpSL5ReplDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index 4365a53b..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MoonSharpSL5ReplDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MoonSharpSL5ReplDemo")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("69b110b4-e578-4854-8f63-d80e4e14e1b6")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/MoonSharpSL5ReplDemo/packages.config b/src/DevTools/MoonSharpSL5ReplDemo/packages.config deleted file mode 100644 index 445f1878..00000000 --- a/src/DevTools/MoonSharpSL5ReplDemo/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/.gitignore b/src/DevTools/Nuget_Tests/NugetTests_net35/.gitignore deleted file mode 100644 index 645266dd..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/.gitignore +++ /dev/null @@ -1,170 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ -bin-debug/ - - -# Remove generated docs - -src/MoonSharp.Documentation/Help/html/ -src/MoonSharp.Documentation/Help/toc/ -src/MoonSharp.Documentation/Help/fti/ -src/MoonSharp.Documentation/Help/styles/ -src/MoonSharp.Documentation/Help/icons/ -src/MoonSharp.Documentation/Help/ - -# - -# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets -!packages/*/build/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc -*.dll - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - - -#LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml - -# ========================= -# Windows detritus -# ========================= - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac desktop service store files -.DS_Store diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35.sln b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35.sln deleted file mode 100644 index b64445c4..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35.sln +++ /dev/null @@ -1,84 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetTests_net35", "NugetTests_net35\NugetTests_net35.csproj", "{E6D28865-5094-46C1-8816-9640623B26E4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetTests_net40", "NugetTests_net40\NugetTests_net40.csproj", "{5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetTests_net45", "NugetTests_net45\NugetTests_net45.csproj", "{AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetTests_wsa", "NugetTests_wsa\NugetTests_wsa.csproj", "{2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E6D28865-5094-46C1-8816-9640623B26E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Debug|ARM.ActiveCfg = Debug|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Debug|x64.ActiveCfg = Debug|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Debug|x86.ActiveCfg = Debug|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Release|Any CPU.Build.0 = Release|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Release|ARM.ActiveCfg = Release|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Release|x64.ActiveCfg = Release|Any CPU - {E6D28865-5094-46C1-8816-9640623B26E4}.Release|x86.ActiveCfg = Release|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Debug|ARM.ActiveCfg = Debug|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Debug|x64.ActiveCfg = Debug|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Debug|x86.ActiveCfg = Debug|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Release|Any CPU.Build.0 = Release|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Release|ARM.ActiveCfg = Release|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Release|x64.ActiveCfg = Release|Any CPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD}.Release|x86.ActiveCfg = Release|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Debug|ARM.ActiveCfg = Debug|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Debug|x64.ActiveCfg = Debug|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Debug|x86.ActiveCfg = Debug|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Release|Any CPU.Build.0 = Release|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Release|ARM.ActiveCfg = Release|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Release|x64.ActiveCfg = Release|Any CPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2}.Release|x86.ActiveCfg = Release|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|ARM.ActiveCfg = Debug|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|ARM.Build.0 = Debug|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|ARM.Deploy.0 = Debug|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x64.ActiveCfg = Debug|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x64.Build.0 = Debug|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x64.Deploy.0 = Debug|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x86.ActiveCfg = Debug|x86 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x86.Build.0 = Debug|x86 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Debug|x86.Deploy.0 = Debug|x86 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|Any CPU.Build.0 = Release|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|Any CPU.Deploy.0 = Release|Any CPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|ARM.ActiveCfg = Release|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|ARM.Build.0 = Release|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|ARM.Deploy.0 = Release|ARM - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x64.ActiveCfg = Release|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x64.Build.0 = Release|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x64.Deploy.0 = Release|x64 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x86.ActiveCfg = Release|x86 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x86.Build.0 = Release|x86 - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA}.Release|x86.Deploy.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.Designer.cs deleted file mode 100644 index 341235e4..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.Designer.cs +++ /dev/null @@ -1,143 +0,0 @@ -namespace NugetTests_net35 -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.lblVersion = new System.Windows.Forms.Label(); - this.lblTestResult = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.lblPlatform = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(34, 33); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(96, 16); - this.label1.TabIndex = 0; - this.label1.Text = "Version check :"; - this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(48, 146); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(81, 16); - this.label2.TabIndex = 0; - this.label2.Text = "Simple test :"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblVersion - // - this.lblVersion.AutoSize = true; - this.lblVersion.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVersion.Location = new System.Drawing.Point(136, 33); - this.lblVersion.Name = "lblVersion"; - this.lblVersion.Size = new System.Drawing.Size(71, 16); - this.lblVersion.TabIndex = 1; - this.lblVersion.Text = "lblVersion"; - // - // lblTestResult - // - this.lblTestResult.AutoSize = true; - this.lblTestResult.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTestResult.Location = new System.Drawing.Point(136, 146); - this.lblTestResult.Name = "lblTestResult"; - this.lblTestResult.Size = new System.Drawing.Size(91, 16); - this.lblTestResult.TabIndex = 2; - this.lblTestResult.Text = "lblTestResult"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(52, 234); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(205, 59); - this.button1.TabIndex = 3; - this.button1.Text = "TryDebugger"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(32, 90); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(97, 16); - this.label5.TabIndex = 0; - this.label5.Text = "Platform check:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblPlatform - // - this.lblPlatform.AutoSize = true; - this.lblPlatform.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPlatform.Location = new System.Drawing.Point(136, 90); - this.lblPlatform.Name = "lblPlatform"; - this.lblPlatform.Size = new System.Drawing.Size(71, 16); - this.lblPlatform.TabIndex = 1; - this.lblPlatform.Text = "lblVersion"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(311, 330); - this.Controls.Add(this.button1); - this.Controls.Add(this.lblTestResult); - this.Controls.Add(this.lblPlatform); - this.Controls.Add(this.lblVersion); - this.Controls.Add(this.label5); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "Form1"; - this.Text = "Nuget on .NET 3.5"; - this.Load += new System.EventHandler(this.Form1_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label lblVersion; - private System.Windows.Forms.Label lblTestResult; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label lblPlatform; - } -} - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.cs deleted file mode 100644 index 360017cf..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using MoonSharp.Interpreter; -using MoonSharp.RemoteDebugger; - -namespace NugetTests_net35 -{ - public partial class Form1 : Form - { - string EXPECTEDVERSION = VERSION.NUMB; - string EXPECTEDPLATF = "std.dotnet.clr2"; - - string BASICSCRIPT = @" -function dodo(x, y, z) - return tostring((x + y) * z); -end - -return dodo; -"; - - public Form1() - { - InitializeComponent(); - } - - private void Form1_Load(object sender, EventArgs e) - { - CheckString(lblVersion, EXPECTEDVERSION, Script.VERSION); - CheckString(lblPlatform, EXPECTEDPLATF, Script.GlobalOptions.Platform.GetPlatformName()); - - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - } - - private void CheckString(Label label, string expected, string actual) - { - label.Text = actual; - - if (actual != expected) - label.ForeColor = Color.Red; - else - label.ForeColor = Color.Green; - } - - private void button1_Click(object sender, EventArgs e) - { - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - - ActivateRemoteDebugger(S); - - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - - } - - RemoteDebuggerService remoteDebugger; - - private void ActivateRemoteDebugger(Script script) - { - if (remoteDebugger == null) - { - remoteDebugger = new RemoteDebuggerService(); - - // the last boolean is to specify if the script is free to run - // after attachment, defaults to false - remoteDebugger.Attach(script, "Description of the script", false); - } - - // start the web-browser at the correct url. Replace this or just - // pass the url to the user in some way. - Process.Start(remoteDebugger.HttpUrlStringLocalHost); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.resx deleted file mode 100644 index 7080a7d1..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/NugetTests_net35.csproj b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/NugetTests_net35.csproj deleted file mode 100644 index 6766c9c7..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/NugetTests_net35.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Debug - AnyCPU - {E6D28865-5094-46C1-8816-9640623B26E4} - WinExe - Properties - NugetTests_net35 - NugetTests_net35 - v3.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\MoonSharp.0.9.4.0\lib\net35-client\MoonSharp.Interpreter.dll - - - False - ..\packages\MoonSharp.Debugger.0.9.4.0\lib\net35-client\MoonSharp.RemoteDebugger.dll - - - - - - - - - - - - - - Form - - - Form1.cs - - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Program.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Program.cs deleted file mode 100644 index 745d8923..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; - -namespace NugetTests_net35 -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/AssemblyInfo.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/AssemblyInfo.cs deleted file mode 100644 index 84f86f73..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NugetTests_net35")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NugetTests_net35")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("53b58219-038b-4850-9d66-4f92d39ee130")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.Designer.cs deleted file mode 100644 index 4085453e..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net35.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NugetTests_net35.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.Designer.cs deleted file mode 100644 index b1768ba2..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net35.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.settings b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/VERSION.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/VERSION.cs deleted file mode 100644 index 8b0ffef1..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/VERSION.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace System -{ - public static class VERSION - { - public const string NUMB = "0.9.2.0"; - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/packages.config b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/packages.config deleted file mode 100644 index 10e4edcc..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net35/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.Designer.cs deleted file mode 100644 index f480231a..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.Designer.cs +++ /dev/null @@ -1,143 +0,0 @@ -namespace NugetTests_net35 -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.lblVersion = new System.Windows.Forms.Label(); - this.lblTestResult = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.lblPlatform = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(34, 33); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(96, 16); - this.label1.TabIndex = 0; - this.label1.Text = "Version check :"; - this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(48, 146); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(81, 16); - this.label2.TabIndex = 0; - this.label2.Text = "Simple test :"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblVersion - // - this.lblVersion.AutoSize = true; - this.lblVersion.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVersion.Location = new System.Drawing.Point(136, 33); - this.lblVersion.Name = "lblVersion"; - this.lblVersion.Size = new System.Drawing.Size(71, 16); - this.lblVersion.TabIndex = 1; - this.lblVersion.Text = "lblVersion"; - // - // lblTestResult - // - this.lblTestResult.AutoSize = true; - this.lblTestResult.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTestResult.Location = new System.Drawing.Point(136, 146); - this.lblTestResult.Name = "lblTestResult"; - this.lblTestResult.Size = new System.Drawing.Size(91, 16); - this.lblTestResult.TabIndex = 2; - this.lblTestResult.Text = "lblTestResult"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(52, 234); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(205, 59); - this.button1.TabIndex = 3; - this.button1.Text = "TryDebugger"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(32, 90); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(97, 16); - this.label5.TabIndex = 0; - this.label5.Text = "Platform check:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblPlatform - // - this.lblPlatform.AutoSize = true; - this.lblPlatform.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPlatform.Location = new System.Drawing.Point(136, 90); - this.lblPlatform.Name = "lblPlatform"; - this.lblPlatform.Size = new System.Drawing.Size(71, 16); - this.lblPlatform.TabIndex = 1; - this.lblPlatform.Text = "lblVersion"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(311, 330); - this.Controls.Add(this.button1); - this.Controls.Add(this.lblTestResult); - this.Controls.Add(this.lblPlatform); - this.Controls.Add(this.lblVersion); - this.Controls.Add(this.label5); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "Form1"; - this.Text = "Nuget on .NET 4.0"; - this.Load += new System.EventHandler(this.Form1_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label lblVersion; - private System.Windows.Forms.Label lblTestResult; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label lblPlatform; - } -} - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.cs deleted file mode 100644 index 36b8f6a0..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using MoonSharp.Interpreter; -using MoonSharp.RemoteDebugger; - -namespace NugetTests_net35 -{ - public partial class Form1 : Form - { - string EXPECTEDVERSION = VERSION.NUMB; - string EXPECTEDPLATF = "std.dotnet.clr4"; - - string BASICSCRIPT = @" -function dodo(x, y, z) - return tostring((x + y) * z); -end - -return dodo; -"; - - public Form1() - { - InitializeComponent(); - } - - private void Form1_Load(object sender, EventArgs e) - { - CheckString(lblVersion, EXPECTEDVERSION, Script.VERSION); - CheckString(lblPlatform, EXPECTEDPLATF, Script.GlobalOptions.Platform.GetPlatformName()); - - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - } - - private void CheckString(Label label, string expected, string actual) - { - label.Text = actual; - - if (actual != expected) - label.ForeColor = Color.Red; - else - label.ForeColor = Color.Green; - } - - private void button1_Click(object sender, EventArgs e) - { - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - - ActivateRemoteDebugger(S); - - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - - } - - RemoteDebuggerService remoteDebugger; - - private void ActivateRemoteDebugger(Script script) - { - if (remoteDebugger == null) - { - remoteDebugger = new RemoteDebuggerService(); - - // the last boolean is to specify if the script is free to run - // after attachment, defaults to false - remoteDebugger.Attach(script, "Description of the script", false); - } - - // start the web-browser at the correct url. Replace this or just - // pass the url to the user in some way. - Process.Start(remoteDebugger.HttpUrlStringLocalHost); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.resx deleted file mode 100644 index 1af7de15..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/NugetTests_net40.csproj b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/NugetTests_net40.csproj deleted file mode 100644 index 3a3f4741..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/NugetTests_net40.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - - Debug - AnyCPU - {5CBA5DC0-AF86-4FC0-8D13-C3324EC51DDD} - WinExe - Properties - NugetTests_net40 - NugetTests_net40 - v4.0 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\MoonSharp.0.9.4.0\lib\net40-client\MoonSharp.Interpreter.dll - - - False - ..\packages\MoonSharp.Debugger.0.9.4.0\lib\net40-client\MoonSharp.RemoteDebugger.dll - - - - - - - - - - - - - - - VERSION.cs - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Program.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Program.cs deleted file mode 100644 index d440e991..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; -using NugetTests_net35; - -namespace NugetTests_net40 -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/AssemblyInfo.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/AssemblyInfo.cs deleted file mode 100644 index 87fda41c..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NugetTests_net40")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NugetTests_net40")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("29618db6-3979-4617-a55f-d7e27f641f22")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.Designer.cs deleted file mode 100644 index 37df8f5a..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net40.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NugetTests_net40.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.Designer.cs deleted file mode 100644 index 2f48db11..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net40.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.settings b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/packages.config b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/packages.config deleted file mode 100644 index eb1b1497..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net40/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/App.config b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/App.config deleted file mode 100644 index 8e156463..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.Designer.cs deleted file mode 100644 index 735c64e9..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.Designer.cs +++ /dev/null @@ -1,143 +0,0 @@ -namespace NugetTests_net35 -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.lblVersion = new System.Windows.Forms.Label(); - this.lblTestResult = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.lblPlatform = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(34, 33); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(96, 16); - this.label1.TabIndex = 0; - this.label1.Text = "Version check :"; - this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(48, 146); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(81, 16); - this.label2.TabIndex = 0; - this.label2.Text = "Simple test :"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblVersion - // - this.lblVersion.AutoSize = true; - this.lblVersion.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVersion.Location = new System.Drawing.Point(136, 33); - this.lblVersion.Name = "lblVersion"; - this.lblVersion.Size = new System.Drawing.Size(71, 16); - this.lblVersion.TabIndex = 1; - this.lblVersion.Text = "lblVersion"; - // - // lblTestResult - // - this.lblTestResult.AutoSize = true; - this.lblTestResult.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTestResult.Location = new System.Drawing.Point(136, 146); - this.lblTestResult.Name = "lblTestResult"; - this.lblTestResult.Size = new System.Drawing.Size(91, 16); - this.lblTestResult.TabIndex = 2; - this.lblTestResult.Text = "lblTestResult"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(52, 234); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(205, 59); - this.button1.TabIndex = 3; - this.button1.Text = "TryDebugger"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(32, 90); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(97, 16); - this.label5.TabIndex = 0; - this.label5.Text = "Platform check:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblPlatform - // - this.lblPlatform.AutoSize = true; - this.lblPlatform.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPlatform.Location = new System.Drawing.Point(136, 90); - this.lblPlatform.Name = "lblPlatform"; - this.lblPlatform.Size = new System.Drawing.Size(71, 16); - this.lblPlatform.TabIndex = 1; - this.lblPlatform.Text = "lblVersion"; - // - // Form1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(311, 330); - this.Controls.Add(this.button1); - this.Controls.Add(this.lblTestResult); - this.Controls.Add(this.lblPlatform); - this.Controls.Add(this.lblVersion); - this.Controls.Add(this.label5); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.Name = "Form1"; - this.Text = "Nuget on .NET 4.5"; - this.Load += new System.EventHandler(this.Form1_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label lblVersion; - private System.Windows.Forms.Label lblTestResult; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label lblPlatform; - } -} - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.cs deleted file mode 100644 index 36b8f6a0..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using MoonSharp.Interpreter; -using MoonSharp.RemoteDebugger; - -namespace NugetTests_net35 -{ - public partial class Form1 : Form - { - string EXPECTEDVERSION = VERSION.NUMB; - string EXPECTEDPLATF = "std.dotnet.clr4"; - - string BASICSCRIPT = @" -function dodo(x, y, z) - return tostring((x + y) * z); -end - -return dodo; -"; - - public Form1() - { - InitializeComponent(); - } - - private void Form1_Load(object sender, EventArgs e) - { - CheckString(lblVersion, EXPECTEDVERSION, Script.VERSION); - CheckString(lblPlatform, EXPECTEDPLATF, Script.GlobalOptions.Platform.GetPlatformName()); - - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - } - - private void CheckString(Label label, string expected, string actual) - { - label.Text = actual; - - if (actual != expected) - label.ForeColor = Color.Red; - else - label.ForeColor = Color.Green; - } - - private void button1_Click(object sender, EventArgs e) - { - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - - ActivateRemoteDebugger(S); - - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - - } - - RemoteDebuggerService remoteDebugger; - - private void ActivateRemoteDebugger(Script script) - { - if (remoteDebugger == null) - { - remoteDebugger = new RemoteDebuggerService(); - - // the last boolean is to specify if the script is free to run - // after attachment, defaults to false - remoteDebugger.Attach(script, "Description of the script", false); - } - - // start the web-browser at the correct url. Replace this or just - // pass the url to the user in some way. - Process.Start(remoteDebugger.HttpUrlStringLocalHost); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.resx deleted file mode 100644 index 1af7de15..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Form1.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/NugetTests_net45.csproj b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/NugetTests_net45.csproj deleted file mode 100644 index 8d2388da..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/NugetTests_net45.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Debug - AnyCPU - {AA376A70-0C4E-4777-B1A8-0107F8D6BFB2} - WinExe - Properties - NugetTests_net45 - NugetTests_net45 - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\MoonSharp.0.9.4.0\lib\net40-client\MoonSharp.Interpreter.dll - - - False - ..\packages\MoonSharp.Debugger.0.9.4.0\lib\net40-client\MoonSharp.RemoteDebugger.dll - - - - - - - - - - - - - - - VERSION.cs - - - Form - - - Form1.cs - - - - - Form1.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Program.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Program.cs deleted file mode 100644 index 8f55d765..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace NugetTests_net45 -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new NugetTests_net35.Form1()); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/AssemblyInfo.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/AssemblyInfo.cs deleted file mode 100644 index 86366b6a..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NugetTests_net45")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NugetTests_net45")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("21b69915-4abf-48d6-b0d8-047b6a7b4cb2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.Designer.cs deleted file mode 100644 index 8952926c..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net45.Properties -{ - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NugetTests_net45.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.resx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.Designer.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.Designer.cs deleted file mode 100644 index e0c3b832..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NugetTests_net45.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.settings b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.settings deleted file mode 100644 index 39645652..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/packages.config b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/packages.config deleted file mode 100644 index 987703a1..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_net45/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml deleted file mode 100644 index 6a54fe8d..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml.cs deleted file mode 100644 index ff5402a4..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/App.xaml.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 - -namespace NugetTests_wsa -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used such as when the application is launched to open a specific file. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs e) - { - -#if DEBUG - //if (System.Diagnostics.Debugger.IsAttached) - //{ - // this.DebugSettings.EnableFrameRateCounter = true; - //} -#endif - - Frame rootFrame = Window.Current.Content as Frame; - - // Do not repeat app initialization when the Window already has content, - // just ensure that the window is active - if (rootFrame == null) - { - // Create a Frame to act as the navigation context and navigate to the first page - rootFrame = new Frame(); - // Set the default language - rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; - - rootFrame.NavigationFailed += OnNavigationFailed; - - if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Place the frame in the current Window - Window.Current.Content = rootFrame; - } - - if (rootFrame.Content == null) - { - // When the navigation stack isn't restored navigate to the first page, - // configuring the new page by passing required information as a navigation - // parameter - rootFrame.Navigate(typeof(MainPage), e.Arguments); - } - // Ensure the current window is active - Window.Current.Activate(); - } - - /// - /// Invoked when Navigation to a certain page fails - /// - /// The Frame which failed navigation - /// Details about the navigation failure - void OnNavigationFailed(object sender, NavigationFailedEventArgs e) - { - throw new Exception("Failed to load Page " + e.SourcePageType.FullName); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/Logo.scale-100.png b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/Logo.scale-100.png deleted file mode 100644 index e26771cb..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/Logo.scale-100.png and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SmallLogo.scale-100.png b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SmallLogo.scale-100.png deleted file mode 100644 index 1eb0d9d5..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SmallLogo.scale-100.png and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SplashScreen.scale-100.png b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SplashScreen.scale-100.png deleted file mode 100644 index c951e031..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/StoreLogo.scale-100.png b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/StoreLogo.scale-100.png deleted file mode 100644 index dcb67271..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Assets/StoreLogo.scale-100.png and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml deleted file mode 100644 index 092b2d4d..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml.cs deleted file mode 100644 index ccac7b92..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/MainPage.xaml.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using MoonSharp.Interpreter; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 - -namespace NugetTests_wsa -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class MainPage : Page - { - string EXPECTEDVERSION = VERSION.NUMB; - string EXPECTEDPLATF = "limited.dotnet.portable.clr4"; - - string BASICSCRIPT = @" -function dodo(x, y, z) - return tostring((x + y) * z); -end - -return dodo; -"; - - public MainPage() - { - this.InitializeComponent(); - } - - private void Page_Loaded(object sender, RoutedEventArgs e) - { - CheckString(lblVersion, EXPECTEDVERSION, Script.VERSION); - CheckString(lblPlatform, EXPECTEDPLATF, Script.GlobalOptions.Platform.GetPlatformName()); - - Script S = new Script(); - DynValue fn = S.DoString(BASICSCRIPT); - string res = fn.Function.Call(2, 3, 4).String; - - CheckString(lblTestResult, "20", res); - } - - private void CheckString(TextBlock label, string expected, string actual) - { - label.Text = actual; - - if (actual != expected) - label.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0)); - else - label.Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 200, 0)); - } - } -} diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa.csproj b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa.csproj deleted file mode 100644 index 58a39393..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa.csproj +++ /dev/null @@ -1,156 +0,0 @@ - - - - - Debug - AnyCPU - {2611D4FB-FAB2-4723-9E0A-1D1285F40CCA} - AppContainerExe - Properties - NugetTests_wsa - NugetTests_wsa - en-US - 8.1 - 12 - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - NugetTests_wsa_TemporaryKey.pfx - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_APP - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE;WINDOWS_APP - prompt - 4 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_APP - ;2008 - full - ARM - false - prompt - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_APP - true - ;2008 - pdbonly - ARM - false - prompt - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_APP - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_APP - true - ;2008 - pdbonly - x64 - false - prompt - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_APP - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_APP - true - ;2008 - pdbonly - x86 - false - prompt - true - - - - VERSION.cs - - - App.xaml - - - MainPage.xaml - - - - - - Designer - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - False - ..\packages\MoonSharp.0.9.4.0\lib\portable-net4+sl5+wp8+win8\MoonSharp.Interpreter.dll - - - - 12.0 - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa_TemporaryKey.pfx b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa_TemporaryKey.pfx deleted file mode 100644 index 6731cd7b..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/NugetTests_wsa_TemporaryKey.pfx and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Package.appxmanifest b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Package.appxmanifest deleted file mode 100644 index 37c3a026..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Package.appxmanifest +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - NugetTests_wsa - Marco.Mastropaolo - Assets\StoreLogo.png - - - - 6.3.0 - 6.3.0 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Properties/AssemblyInfo.cs b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Properties/AssemblyInfo.cs deleted file mode 100644 index 1ea4871b..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NugetTests_wsa")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NugetTests_wsa")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/packages.config b/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/packages.config deleted file mode 100644 index 31fbe9f3..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/NugetTests_wsa/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/MoonSharp.0.9.4.0.nupkg b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/MoonSharp.0.9.4.0.nupkg deleted file mode 100644 index d5c95117..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/MoonSharp.0.9.4.0.nupkg and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net35-client/MoonSharp.Interpreter.xml b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net35-client/MoonSharp.Interpreter.xml deleted file mode 100644 index 51902bef..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net35-client/MoonSharp.Interpreter.xml +++ /dev/null @@ -1,6529 +0,0 @@ - - - - MoonSharp.Interpreter - - - - - Class implementing coroutine Lua functions - - - - - Class implementing basic Lua functions (print, type, tostring, etc) as a MoonSharp module. - - - - - Class implementing debug Lua functions. Support for the debug module is partial. - - - - - Class implementing dynamic expression evaluations at runtime (a MoonSharp addition). - - - - - Class implementing error handling Lua functions (pcall and xpcall) - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - A base class for many MoonSharp objects. - Helds a ReferenceID property which gets a different value for every object instance, for debugging - purposes. Note that the ID is not assigned in a thread safe manner for speed reason, so the IDs - are guaranteed to be unique only if everything is running on one thread at a time. - - - - - Formats a string with a type name and a ref-id - - The type name. - - - - - Gets the reference identifier. - - - The reference identifier. - - - - - Class implementing io Lua functions. Proper support requires a compatible IPlatformAccessor - - - - - Abstract class implementing an unclosable file Lua userdata. Methods are meant to be called by Lua code. - - - - - Class implementing loading Lua functions like 'require', 'load', etc. - - - - - Class implementing bit32 Lua functions - - - - - Class implementing math Lua functions - - - - - Class implementing metatable related Lua functions (xxxmetatable and rawxxx). - - - - - Class implementing system related Lua functions from the 'os' module. - Proper support requires a compatible IPlatformAccessor - - - - - Class implementing time related Lua functions from the 'os' module. - - - - - Classes using the classic interface should inherit from this class. - This class defines only static methods and is really meant to be used only - from C# and not other .NET languages. - - For easier operation they should also define: - using ptrdiff_t = System.Int32; - using lua_Integer = System.Int32; - using LUA_INTFRM_T = System.Int64; - using UNSIGNED_LUA_INTFRM_T = System.UInt64; - - - - - Calls a function. - To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, - the arguments to the function are pushed in direct order; that is, the first argument is pushed first. Finally you call - lua_call; nargs is the number of arguments that you pushed onto the stack. All arguments and the function value are - popped from the stack when the function is called. The function results are pushed onto the stack when the function - returns. The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from - the function are pushed. Lua takes care that the returned values fit into the stack space. The function results are - pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on - the top of the stack. - - The LuaState - The number of arguments. - The number of expected results. - - - - - A Dictionary where multiple values can be associated to the same key - - The key type - The value type - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The equality comparer to use in the underlying dictionary. - - - - Adds the specified key. Returns true if this is the first value for a given key - - The key. - The value. - - - - - Finds all the values associated with the specified key. - An empty collection is returned if not found. - - The key. - - - - Determines whether this contains the specified key - - The key. - - - - Clears this instance. - - - - - Removes the specified key and all its associated values from the multidictionary - - The key. - - - - Removes the value. Returns true if the removed value was the last of a given key - - The key. - The value. - - - - - Gets the keys. - - - - - Implementation of IEqualityComparer enforcing reference equality - - - - - Marks a method as the handler of metamethods of a userdata type - - - - - Initializes a new instance of the class. - - The metamethod name (like '__div', '__ipairs', etc.) - - - - The metamethod name (like '__div', '__ipairs', etc.) - - - - - Base interface to describe access to members of a given type. - While it's not infrastructural to implement custom type descriptors, it's needed for - classes extending . - - - - - Gets the value of this member as a to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value of this member as a . - - - - Sets the value of this member from a . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Extension methods for and . - - - - - Determines whether the specified MemberDescriptorAccess has ALL the specified flags. - - The access. - The flag. - - - - - Determines whether this instance can be read - - The descriptor instance. - - - - - Determines whether this instance can be written to - - The descriptor instance. - - - - - Determines whether this instance can be executed (called as a function) - - The descriptor instance. - - - - - Gets the getter of the member as a DynValue containing a callback - - The descriptor instance. - The script. - The object. - - - - - Returns the specified descriptor if it supports all the specified access modes, otherwise returns null. - - The descriptor instance. - The access mode(s). - - - - - Raises an appropriate ScriptRuntimeException if the specified access is not supported. - Checks are made for the MemberDescriptorAccess permissions AND for the access of instance - members through static userdatas. - - The desc. - The access. - The object to be checked for access. - - - - Interface for descriptors of any kind which support optimizations of their implementation according to InteropAccessMode - modes. This should seldom - if ever - be implemented in user code. - - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Specialized for members supporting overloads resolution. - - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Permissions for members access - - - - - The member can be read from - - - - - The member can be written to - - - - - The can be invoked - - - - - Descriptor of parameters used in implementations. - - - - - If the type got restricted, the original type before the restriction. - - - - - Initializes a new instance of the class. - - The name. - The type. - if set to true the parameter has default value. - The default value. - if set to true, is an out param. - - - - Initializes a new instance of the class. - - A ParameterInfo taken from reflection. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Restricts the type of this parameter to a tighter constraint. - Restrictions must be applied before the containing this - parameter is used in any way. - - The new type. - - Cannot restrict a ref/out param - or - Specified operation is not a restriction - - - - - Gets the name of the parameter - - - - - Gets the type of the parameter - - - - - Gets a value indicating whether this instance has a default value. - - - - - Gets the default value - - - - - Gets a value indicating whether this instance is an out parameter - - - - - Gets a value indicating whether this instance has been restricted. - - - - - Gets the original type of the parameter before any restriction has been applied. - - - - - Tries to convert a CLR object to a MoonSharp value, using "simple" logic. - Does NOT throw on failure. - - - - - Tries to convert a CLR object to a MoonSharp value, using more in-depth analysis - - - - - Converts an IEnumerable or IEnumerator to a DynValue - - The script. - The object. - - - - - Static functions to handle conversions of numeric types - - - - - HashSet of numeric types - - - - - Array of numeric types in order used for some conversions - - - - - Converts a double to another type - - - - - Converts a type to double - - - - - Converts a DynValue to a CLR object [simple conversion] - - - - - Converts a DynValue to a CLR object of a specific type - - - - - Gets a relative weight of how much the conversion is matching the given types. - Implementation must follow that of DynValueToObjectOfType.. it's not very DRY in that sense. - However here we are in perf-sensitive path.. TODO : double-check the gain and see if a DRY impl is better. - - - - - Converts an IList to a Lua table. - - - - - Converts an IDictionary to a Lua table. - - - - - Determines whether the specified table can be converted to the specified type - - The table. - The type. - - - - - Converts a table to a CLR object of a given type - - - - - Converts a table to a - - - - - Converts a table to a T[] - - - - - Converts a table to a - - - - - Converts a table to a , known in advance - - - - - Converts a table to a Dictionary, known in advance - - - - - A collection of custom converters between MoonSharp types and CLR types. - If a converter function is not specified or returns null, the standard conversion path applies. - - - - - Sets a custom converter from a script data type to a CLR data type. Set null to remove a previous custom converter. - - The script data type - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a script data type to a CLR data type, or null - - The script data type - The CLR data type. - The converter function, or null if not found - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a CLR data type, or null - - Type of the color data. - The converter function, or null if not found - - - - Removes all converters. - - - - - Helper extension methods used to simplify some parts of userdata descriptor implementations - - - - - Determines whether a - is changing visibility of a member - to scripts. - - The member to check. - - true if visibility is forced visible, - false if visibility is forced hidden or the specified MemberInfo is null, - if no attribute was found - - - - - Determines whether the specified PropertyInfo is visible publicly (either the getter or the setter is public). - - The PropertyInfo. - - - - - Gets the list of metamethod names from attributes - in practice the list of metamethods declared through - . - - The mi. - - - - - Gets the name of a conversion method to be exposed to Lua scripts - - The type. - - - - - An abstract user data descriptor which accepts members described by objects and - correctly dispatches to them. - Metamethods are also by default dispatched to operator overloads and other similar methods - see - . - - - - - Interface used by MoonSharp to access objects of a given type from scripts. - - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - The special name used by CLR for indexer getters - - - - - The special name used by CLR for indexer setters - - - - - The special name used by CLR for explicit cast conversions - - - - - The special name used by CLR for implicit cast conversions - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - A friendly name for the type, or null. - - - - Adds a member to the meta-members list. - - The name of the metamethod. - The desc. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Adds a DynValue as a member - - The name. - The value. - - - - Adds a property to the member list - - The name. - The descriptor. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Performs an "index" "get" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing operation by checking newly added extension methods for the given indexName. - - The script. - The object. - Member name to be indexed. - - - - - - Determines whether the descriptor contains the specified member (by exact name) - - Name of the member. - - - - - Determines whether the descriptor contains the specified member in the meta list (by exact name) - - Name of the meta-member. - - - - - Tries to perform an indexing operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - - - - - Performs an "index" "set" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing "set" operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - The value. - - - - - Converts the specified name from underscore_case to camelCase. - - The name. - - - - - Converts the specified name to one with an uppercase first letter (something to Something). - - The name. - - - - - Converts this userdata to string - - The object. - - - - - Executes the specified indexer method. - - The method descriptor - The script. - The object. - The indexer parameter - The dynvalue to set on a setter, or null. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - See for further details. - - If a method exists marked with for the specific - metamethod requested, that method is returned. - - If the above fails, the following dispatching occur: - - __add, __sub, __mul, __div, __mod and __unm are dispatched to C# operator overloads (if they exist) - __eq is dispatched to System.Object.Equals. - __lt and __le are dispatched IComparable.Compare, if the type implements IComparable or IComparable{object} - __len is dispatched to Length and Count properties, if those exist. - __iterator is handled if the object implements IEnumerable or IEnumerator. - __tonumber is dispatched to implicit or explicit conversion operators to standard numeric types. - __tobool is dispatched to an implicit or explicit conversion operator to bool. If that fails, operator true is used. - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Gets a human readable friendly name of the descriptor - - - - - Standard descriptor for Enum values - - - - - Initializes a new instance of the class. - - Type of the enum. - Name of the friendly. - enumType must be an enum! - - - - Fills the member list. - - - - - Adds an enum method to the object - - The name. - The dyn value. - - - - Gets the value of the enum as a long - - - - - Gets the value of the enum as a ulong - - - - - Creates an enum value from a long - - - - - Creates an enum value from a ulong - - - - - Creates conversion functions for signed enums - - - - - Creates conversion functions for unsigned enums - - - - - Determines whether the specified object is compatible with the specified type. - - The type. - The object. - - - - - Gets a "meta" operation on this userdata. - In this specific case, only the concat operator is supported, only on flags enums and it implements the - 'or' operator. - - - - - - - - - Gets the underlying type of the enum. - - - - - Gets a value indicating whether underlying type of the enum is unsigned. - - - - - Gets a value indicating whether this instance describes a flags enumeration. - - - - - Class providing a simple descriptor for constant DynValues in userdata - - - - - Initializes a new instance of the class. - - The name. - The value. - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - userdata '{0}' cannot be written to. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Gets the value wrapped by this descriptor - - - - - Class providing easier marshalling of CLR events. Handling is limited to a narrow range of handler signatures, which, - however, covers in practice most of all available events. - - - - - The maximum number of arguments supported in an event handler delegate - - - - - Tries to create a new StandardUserDataEventDescriptor, returning null in case the method is not - visible to script code. - - The EventInfo. - The - A new StandardUserDataEventDescriptor or null. - - - - Checks if the event is compatible with a standard descriptor - - The EventInfo. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The event is declared in a value type - or - The event does not have both add and remove methods - or - The event handler type doesn't implement a public Invoke method - or - The event handler has a return type which is not System.Void - or - The event handler has more than MAX_ARGS_IN_DELEGATE parameters - or - The event handler has a value type parameter or a by ref parameter - or - The event handler signature is not a valid method according to - - - - - Initializes a new instance of the class. - - The ei. - The access mode. - - - - Gets a dynvalue which is a facade supporting add/remove methods which is callable from scripts - - The script. - The object for which the facade should be written. - - - - - Sets the value. - - The script. - The object. - The v. - - - - Gets the EventInfo object of the event described by this descriptor - - - - - Gets a value indicating whether the event described by this descriptor is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - As a convenience, every type deriving from IUserDataType is "self-described". That is, no descriptor is needed/generated - and the object itself is used to describe the type for interop. See also , - and . - - - - - Performs an "index" "get" operation. - - The script originating the request - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The name of the metamember. - - - - - Class providing easier marshalling of overloaded CLR functions - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptor of the first overloaded method. - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptors of the overloaded methods. - - - - Sets the extension methods snapshot. - - The version. - The ext methods. - - - - Adds an overload. - - The overload. - - - - Performs the overloaded call. - - The script. - The object. - The context. - The arguments. - - function call doesn't match any overload - - - - Calculates the score for the overload. - - The context. - The arguments. - The method. - if set to true, is an extension method. - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - - - - - Gets or sets a value indicating whether this instance ignores extension methods. - - - - - Gets the name of the first described overload - - - - - Gets the name of the first described overload - - - - - Gets the number of overloaded methods contained in this collection - - - The overload count. - - - - - Gets a value indicating whether there is at least one static method in the resolution list - - - - - - Gets the types of access supported by this member - - - - - Comparer class for IOverloadableMemberDescriptor - - - - - Class providing easier marshalling of CLR fields - - - - - Tries to create a new StandardUserDataFieldDescriptor, returning null in case the field is not - visible to script code. - - The FieldInfo. - The - A new StandardUserDataFieldDescriptor or null. - - - - Initializes a new instance of the class. - - The FieldInfo. - The - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Gets the FieldInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance is a constant - - - - - Gets a value indicating whether this instance is readonly - - - - - Gets the types of access supported by this member - - - - - Member descriptor for the default constructor of value types. - - - - - Initializes a new instance of the - class - representing the default empty ctor for a value type. - - Type of the value. - valueType is not a value type - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a - to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a - . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - This property is equal to the value type to be constructed. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the types of access supported by this member - - - - - "Optimized" BinaryReader which shares strings and use a dumb compression for integers - - - - - "Optimized" BinaryWriter which shares strings and use a dumb compression for integers - - - - - An adapter over Stream which bypasses the Dispose and Close methods. - Used to work around the pesky wrappers .NET has over Stream (BinaryReader, StreamWriter, etc.) which think they - own the Stream and close them when they shouldn't. Damn. - - - - - Enumerations of the possible policies to handle UserData type registrations - See also : . - - - - - Types must be explicitly registered. If a base type or interface is registered, that is used. - - - - - Types are automatically registered if not found in the registry. This is easier to use but potentially unsafe. - - - - - A Delegate type which can wrap a script function - - The arguments. - The return value of the script function - - - - A Delegate type which can wrap a script function with a generic typed return value - - - The arguments. - The return value of the script function - - - - Flags to alter the way the DynValue.CheckType and other related functions operate on data types for - validation. - - - - - No type validation specific behaviour - - - - - Nil and Void values are allowed (and returned by the call) - - - - - Simple autoconversions are attempted: - 1) Numbers are convertible to strings - 2) Strings are convertible to numbers if they contain a number - 3) Everything is convertible to boolean (with void and nil converting to 'false', everything else converting to 'true') - Note: if both AutoConvert and AllowNil are specified, nils will NOT be converted to false booleans. - - - - - The default : Autoconverting values, no nils. - - - - - Exception thrown when a dynamic expression is invalid - - - - - Exception for all runtime errors. In addition to constructors, it offers a lot of static methods - generating more "standard" Lua errors. - - - - - Base type of all exceptions thrown in MoonSharp - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Gets the instruction pointer of the execution (if it makes sense) - - - - - Gets the interpreter call stack. - - - - - Gets the decorated message (error message plus error location in script) if possible. - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an arithmetic operation was attempted on non-numbers - - The left operand. - The right operand (or null). - The exception to be raised. - If both are numbers - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a concat operation was attempted on non-strings - - The left operand. - The right operand. - The exception to be raised. - If both are numbers or strings - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a len operator was applied on an invalid operand - - The operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a comparison operator was applied on an invalid combination of operand types - - The left operand. - The right operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The error message. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad userdata argument - - The argument number (0-based). - Name of the function generating this error. - The expected System.Type. - The object which was used. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - The data type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected type description. - The description of the type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - - This function creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - while creates a message like "bad argument #xxx to 'yyy' (value expected)" - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an out of range index was specified - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a negative number when a positive one was expected. - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - This function creates a message like "bad argument #xxx to 'yyy' (value expected)" - while creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an invalid attempt to index the specified object was made - - The object. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __index over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __newindex over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __call over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used nil as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used a NaN as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion to number failed. - - - Selects the correct error message: - 0 - "value must be a number" - 1 - "'for' initial value must be a number" - 2 - "'for' step must be a number" - 3 - "'for' limit must be a number" - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a CLR type to a Lua type has failed. - - The object which could not be converted. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a Lua type to a CLR type has failed. - - The Lua type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a constrained conversion of a Lua type to a CLR type has failed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a userdata of a specific CLR type was expected and a non-userdata type was passed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to index an invalid member of a userdata was done. - - The name of the userdata type. - The field name. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt resume a coroutine in an invalid state was done. - - The state of the coroutine. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield across a CLR boundary was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield from the main coroutine was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to call a non-function was made - - The lua non-function data type. - The debug text to aid location (appears as "near 'xxx'"). - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The member descriptor. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The type descriptor. - The member descriptor. - - - - - Gets or sets a value indicating whether the message should not be decorated - - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Initializes a new instance of the class. - - The message. - - - - Represents a dynamic expression in the script - - - - - Common interface for all resources which are uniquely bound to a script. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - The code which generated this expression - - - - - Evaluates the expression - - The context. - - - - - Finds a symbol in the expression - - The context. - - - - - Determines whether this instance is a constant expression - - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - Internal type used by for registration - - - - - Wrapper which allows for easier management of userdata without registering a new userdata type - useful - if a type which is not exposed to scripts but can be managed as a "black box" by scripts is desired. - - The type to wrap - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The o. - - - - Gets or sets the value this instance wraps. - - - - - Determines whether the specified value is of numeric type. - - The object to check. - - true if o is a numeric type; otherwise, false. - - - - - Determines whether the specified value is positive. - - The value. - if set to true treats 0 as positive. - - true if the specified value is positive; otherwise, false. - - - - - Converts the specified values boxed type to its correpsonding unsigned - type. - - The value. - A boxed numeric object whos type is unsigned. - - - - Converts the specified values boxed type to its correpsonding integer - type. - - The value. - if set to true [round]. - - A boxed numeric object whos type is an integer type. - - - - - Replaces the string representations of meta chars with their corresponding - character values. - - The input. - A string with all string meta chars are replaced - - - - Class implementing string Lua functions - - - - - Class implementing table Lua iterators (pairs, ipairs, next) - - - - - Class implementing table Lua functions - - - - - Class exposing table.unpack and table.pack in the global namespace (to work around the most common Lua 5.1 compatibility issue). - - - - - Extension methods used in the whole project. - - - - - Gets a value from the dictionary or returns the default value - - The type of the key. - The type of the value. - The dictionary. - The key. - - - - - Gets a value from the dictionary or creates it - - The type of the key. - The type of the value. - The dictionary. - The key. - A function which will create the value if it doesn't exist. - - - - - A non preallocated, non_fixed size stack - - - - - - An index to accelerate operations on a LinkedList using a single key of type - More than one LinkedListIndex can index the same linked list, but every node in the linked list must be indexed by one and only one - LinkedListIndex object. - - The type of the key. Must implement Equals and GetHashCode appropriately. - The type of the values contained in the linked list. - - - - Initializes a new instance of the class. - - The linked list to be indexed. - - - - Finds the node indexed by the specified key, or null. - - The key. - - - - Updates or creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - The previous value of the element - - - - Creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - - - - Removes the specified key from the index, and the node indexed by the key from the linked list. - - The key. - - - - Determines whether the index contains the specified key. - - The key. - - - - Clears this instance (removes all elements) - - - - - Provides facility to create a "sliced" view over an existing IList - - The type of the items contained in the collection - - - - Initializes a new instance of the class. - - The list to apply the Slice view on - From which index - The length of the slice - if set to true the view is in reversed order. - - - - Calculates the real index in the underlying collection - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Converts to an array. - - - - - Converts to an list. - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - Slices are readonly - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - Slices are readonly - - - - Adds an item to the . - - The object to add to the . - Slices are readonly - - - - Removes all items from the . - - Slices are readonly - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - Slices are readonly - - - - Gets or sets the element at the specified index. - - The index. - - - - - Gets the index from which the slice starts - - - - - Gets the number of elements contained in the . - - The number of elements contained in the . - - - - Gets a value indicating whether this operates in a reversed direction. - - - true if this operates in a reversed direction; otherwise, false. - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - A class representing a script coroutine - - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as DynValue(s) - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as System.Object. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as the specified type. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - The purpose of this method is to convert a MoonSharp/Lua coroutine to a Unity3D coroutine. - This loops over the coroutine, discarding returned values, and returning null for each invocation. - This means however that the coroutine will be invoked each frame. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - The arguments. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - - Resumes the coroutine - - The ScriptExecutionContext. - The arguments. - - - - - Gets the coroutine stack trace for debug purposes - - The skip. - The entry source reference. - - - - - Gets the type of coroutine - - - - - Gets the coroutine state. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - - Possible types of coroutine - - - - - A valid coroutine - - - - - A CLR callback assigned to a coroutine. - - - - - A CLR callback assigned to a coroutine and already executed. - - - - - Class used to support "tail" continuations - a way for C# / Lua interaction which supports - coroutine yielding (at the expense of a LOT of added complexity in calling code). - - - - - Gets or sets the function to call - - - - - Gets or sets the arguments to the function - - - - - Gets or sets the callback to be used as a continuation. - - - - - Gets or sets the callback to be used in case of errors. - - - - - Gets or sets the error handler to be called before stack unwinding - - - - - Class exposing C# objects as Lua userdata. - For efficiency, a global registry of types is maintained, instead of a per-script one. - - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers all types marked with a MoonSharpUserDataAttribute that ar contained in an assembly. - - The assembly. - if set to true extension types are registered to the appropriate registry. - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The type to be unregistered - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The The type to be unregistered - - - - Creates a userdata DynValue from the specified object, using a specific descriptor - - The object - The descriptor. - - - - - Creates a userdata DynValue from the specified object - - The object - - - - - Creates a static userdata DynValue from the specified IUserDataDescriptor - - The IUserDataDescriptor - - - - - Creates a static userdata DynValue from the specified Type - - The type - - - - - Creates a static userdata DynValue from the specified Type - - The Type - - - - - Registers an extension Type (that is a type containing extension methods) - - The type. - The InteropAccessMode. - - - - Gets all the extension methods which can match a given name - - The name. - - - - - Gets a number which gets incremented everytime the extension methods registry changes. - Use this to invalidate caches based on extension methods - - - - - - Gets or sets the "uservalue". See debug.getuservalue and debug.setuservalue. - http://www.lua.org/manual/5.2/manual.html#pdf-debug.setuservalue - - - - - Gets the object associated to this userdata (null for statics) - - - - - Gets the type descriptor of this userdata - - - - - Gets or sets the registration policy to be used in the whole application - - - - - Gets or sets the default access mode to be used in the whole application - - - The default access mode. - - InteropAccessMode is InteropAccessMode.Default - - - - Constants of well known "symbols" in the MoonSharp grammar - - - - - The variadic argument symbol ("...") - - - - - The environment symbol ("_ENV") - - - - - Class wrapping a request to yield a coroutine - - - - - The return values of the coroutine - - - - - Wrapper for a debugger initiated action - - - - - Initializes a new instance of the class. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - The type of action - - - - - Gets the time stamp UTC of this action - - - - - Gets or sets the source identifier this action refers to. - - - - - Gets or sets the source line this action refers to. - - - - - Gets or sets the source column this action refers to. - - - - - Gets the age of this debugger action - - - - - Type of the action - - - - - Step-in at the bytecode level - - - - - Step-over at the bytecode level - - - - - Step-out at the bytecode level - - - - - Step-in at the source level - - - - - Step-over at the source level - - - - - Step-out at the source level - - - - - Continue execution "freely" - - - - - Toggles breakpoint - - - - - Sets a breakpoint - - - - - Clears a breakpoint - - - - - Refresh the data - - - - - Hard refresh of data - - - - - No action - - - - - Interface for debuggers to implement, in order to provide debugging facilities to Scripts. - - - - - Called by the script engine when a source code is added or changed. - - The source code object. - - - - Called by the script engine when the bytecode changes. - - The bytecode source - - - - Called by the script engine at execution time to check if a break has - been requested. Should return pretty fast as it's called A LOT. - - - - - Called by the script engine when a runtime error occurs. - The debugger can return true to signal the engine that it wants to break - into the source of the error. If it does so, it should also return true - to subsequent calls to IsPauseRequested(). - - The runtime exception. - True if this error should break execution. - - - - Called by the script engine to get what action to do next. - - The instruction pointer in bytecode. - The source reference. - T - - - - Called by the script engine when the execution ends. - - - - - Called by the script engine to update watches of a given type. Note - that this method is not called only for watches in the strictest term, - but also for the stack, etc. - - Type of the watch. - The items. - - - - Called by the script engine to get which expressions are active - watches in the debugger. - - A list of watches - - - - Called by the script engine to refresh the breakpoint list. - - - - - Class representing a reference to source code interval - - - - - Gets a value indicating whether this instance is a breakpoint - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets whether the source ref includes the specified location - - Index of the source. - The line. - The column. - - - - - Sets the CannotBreakpoint flag. - - - - - - Formats the location according to script preferences - - The script. - if set to true the classic Lua format is forced. - - - - - Gets a value indicating whether this location is inside CLR . - - - - - Gets the index of the source. - - - - - Gets from which column the source code ref starts - - - - - Gets to which column the source code ref ends - - - - - Gets from which line the source code ref starts - - - - - Gets to which line the source code ref ends - - - - - Gets a value indicating whether this instance is a stop "step" in source mode - - - - - Gets a value indicating whether this instance cannot be set as a breakpoint - - - - - A watch item for the debugger to consume. - Most properties make or not sense depending on the WatchType. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the address of the item - - - - - Gets or sets the base pointer (base value of v-stack at entering the function). - Valid only for call-stack items - - - - - Gets or sets the return address. - Valid only for call-stack items - - - - - Gets or sets the name of the item - - - - - Gets or sets the value of the item - - - - - Gets or sets the symbol reference of the item - - - - - Gets or sets a value indicating whether this instance is generating an error. - - - - - Gets or sets the source location this item refers to. - - - - - Enumeration of the possible watch types - - - - - A real variable watch - - - - - The status of the v-stack - - - - - The call stack - - - - - The list of coroutines - - - - - The maximum value of this enum - - - - - Enumeration of the possible performance counters - - - - - Measures the time spent parsing the source creating the AST - - - - - Measures the time spent converting ASTs in bytecode - - - - - Measures the time spent in executing scripts - - - - - Measures the on the fly creation/compilation of functions in userdata descriptors - - - - - Sentinel value to get the enum size - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Enumeration of unit of measures of the performance counters - - - - - The performance counter is specified in bytes (of memory) - - - - - The performance counter is specified in milliseconds - - - - - A single object of this type exists for every script and gives access to performance statistics. - - - - - Gets the result of the specified performance counter . - - The PerformanceCounter. - - - - - Starts a stopwatch. - - - - - - Starts a stopwatch. - - - - - - Gets a string with a complete performance log. - - - - - - Gets or sets a value indicating whether this collection of performance stats is enabled. - - - true if enabled; otherwise, false. - - - - - The result of a performance counter - - - - - Returns a that represents this instance. - - - - - Converts a PerformanceCounterType to a string. - - The type. - - - - Gets the name of the performance counter which generated this result. - - - - - Gets the quantity monitored - see Type to understand what this field contains - - - - - Gets the number of instances which led to the specified counter being incremented - e.g. the times a specific - code is executed, or object instanced - - - - - Gets a value indicating whether this is global or relative to the resource - for which it's called. - - - - - Gets the unit of measure of the Counter field. - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Exception thrown when an inconsistent state is reached in the interpreter - - - - - Exception for all parsing/lexing errors. - - - - - Gets or sets a value indicating whether this exception was caused by premature stream termination (that is, unexpected EOF). - This can be used in REPL interfaces to tell between unrecoverable errors and those which can be recovered by extra input. - - - - - This class is a container for arguments received by a CallbackFunction - - - - - Initializes a new instance of the class. - - The arguments. - if set to true [is method call]. - - - - Gets the at the specified index, or null. - - The index. - if set to true all voids are translated to nils. - - - - - Converts the arguments to an array - - The number of elements to skip (default= 0). - - - - - Gets the specified argument as as an argument of the specified type. If not possible, - an exception is raised. - - The argument number. - Name of the function. - The type desired. - if set to true nil values are allowed. - - - - - Gets the specified argument as as an argument of the specified user data type. If not possible, - an exception is raised. - - The desired userdata type - The argument number. - Name of the function. - if set to true nil values are allowed. - - - - - Gets the specified argument as an integer - - The argument number. - Name of the function. - - - - - Gets the specified argument as a string, calling the __tostring metamethod if needed, in a NON - yield-compatible way. - - The execution context. - The argument number. - Name of the function. - - 'tostring' must return a string to '{0}' - - - - Returns a copy of CallbackArguments where the first ("self") argument is skipped if this was a method call, - otherwise returns itself. - - - - - - Gets the count of arguments - - - - - Gets or sets a value indicating whether this is a method call. - - - - - Gets the at the specified index, or Void if not found - - - - - A class representing a script function - - - - - Shortcut for an empty closure - - - - - Initializes a new instance of the class. - - The script. - The index. - The symbols. - The resolved locals. - - - - Calls this function with the specified args - - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Gets a delegate wrapping calls to this scripted function - - - - - - Gets a delegate wrapping calls to this scripted function - - The type of return value of the delegate. - - - - - Gets the number of upvalues in this closure - - The number of upvalues in this closure - - - - Gets the name of the specified upvalue. - - The index of the upvalue. - The upvalue name - - - - Gets the value of an upvalue - - The index of the upvalue. - The value of an upvalue - - - - Gets the type of the upvalues contained in this closure - - - - - - Gets the entry point location in bytecode . - - - - - Gets the script owning this function - - - - - The current closure context - - - - - Type of closure based on upvalues - - - - - The closure has no upvalues (thus, technically, it's a function and not a closure!) - - - - - The closure has _ENV as its only upvalue - - - - - The closure is a "real" closure, with multiple upvalues - - - - - This class wraps a CLR function - - - - - Initializes a new instance of the class. - - The callback function to be called. - The callback name, used in stacktraces, debugger, etc.. - - - - Invokes the callback function - - The execution context. - The arguments. - if set to true this is a method call. - - - - - Creates a CallbackFunction from a delegate. - - The script. - The delegate. - The access mode. - - - - - Creates a CallbackFunction from a MethodInfo relative to a function. - - The script. - The MethodInfo object. - The object to which the function applies, or null for static methods. - The access mode. - - The method is not static. - - - - Checks the callback signature of a method is compatible for callbacks - - - - - Gets the name of the function - - - - - Gets the call back. - - - The call back. - - - - - Gets or sets the default access mode used when marshalling delegates - - - The default access mode. Default, HideMembers and BackgroundOptimized are NOT supported. - - Default, HideMembers and BackgroundOptimized are NOT supported. - - - - Gets or sets an object used as additional data to the callback function (available in the execution context). - - - - - A class representing a value in a Lua/MoonSharp script. - - - - - Creates a new writable value initialized to Nil. - - - - - Creates a new writable value initialized to the specified boolean. - - - - - Creates a new writable value initialized to the specified number. - - - - - Creates a new writable value initialized to the specified string. - - - - - Creates a new writable value initialized to the specified StringBuilder. - - - - - Creates a new writable value initialized to the specified string using String.Format like syntax - - - - - Creates a new writable value initialized to the specified coroutine. - Internal use only, for external use, see Script.CoroutineCreate - - The coroutine object. - - - - - Creates a new writable value initialized to the specified closure (function). - - - - - Creates a new writable value initialized to the specified CLR callback. - - - - - Creates a new writable value initialized to the specified CLR callback. - See also CallbackFunction.FromDelegate and CallbackFunction.FromMethodInfo factory methods. - - - - - Creates a new writable value initialized to the specified table. - - - - - Creates a new writable value initialized to an empty table. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The function to be called. - The arguments. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The data for the tail call. - - - - - Creates a new request for a yield of the current coroutine. - - The yield argumenst. - - - - - Creates a new tuple initialized to the specified values. - - - - - Creates a new tuple initialized to the specified values - which can be potentially other tuples - - - - - Creates a new userdata value - - - - - Returns this value as readonly - eventually cloning it in the process if it isn't readonly to start with. - - - - - Clones this instance. - - - - - - Clones this instance, overriding the "readonly" status. - - if set to true the new instance is set as readonly, or writeable otherwise. - - - - - Clones this instance, returning a writable copy. - - Can't clone Symbol values - - - - Returns a string which is what it's expected to be output by the print function applied to this value. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Casts this DynValue to string, using coercion if the type is number. - - The string representation, or null if not number, not string. - - - - Casts this DynValue to a double, using coercion if the type is string. - - The string representation, or null if not number, not string or non-convertible-string. - - - - Casts this DynValue to a bool - - False if value is false or nil, true otherwise. - - - - Converts a tuple to a scalar value. If it's already a scalar value, this function returns "this". - - - - - Performs an assignment, overwriting the value with the specified one. - - The value. - If the value is readonly. - - - - Gets the length of a string or table value. - - - Value is not a table or string. - - - - Determines whether this instance is nil or void - - - - - Determines whether this instance is not nil or void - - - - - Determines whether this instance is void - - - - - Determines whether this instance is not void - - - - - Determines whether is nil, void or NaN (and thus unsuitable for using as a table key). - - - - - Changes the numeric value of a number DynValue. - - - - - Creates a new DynValue from a CLR object - - The script. - The object. - - - - - Converts this MoonSharp DynValue to a CLR object. - - - - - Converts this MoonSharp DynValue to a CLR object of the specified type. - - - - - Checks the type of this value corresponds to the desired type. A propert ScriptRuntimeException is thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - Name of the function requesting the value, for error message purposes. - The desired data type. - The argument number, for error message purposes. - The TypeValidationFlags. - - Thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - - - Checks if the type is a specific userdata type, and returns it or throws. - - - Name of the function. - The argument number. - The flags. - - - - - Gets a unique reference identifier. This is guaranteed to be unique only for dynvalues created in a single thread as it's not thread-safe. - - - - - Gets the type of the value. - - - - - Gets the function (valid only if the is ) - - - - - Gets the numeric value (valid only if the is ) - - - - - Gets the values in the tuple (valid only if the is Tuple). - This field is currently also used to hold arguments in values whose is . - - - - - Gets the coroutine handle. (valid only if the is Thread). - - - - - Gets the table (valid only if the is ) - - - - - Gets the boolean value (valid only if the is ) - - - - - Gets the string value (valid only if the is ) - - - - - Gets the CLR callback (valid only if the is ) - - - - - Gets the tail call data. - - - - - Gets the yield request data. - - - - - Gets the tail call data. - - - - - Returns true if this instance is write protected. - - - - - A preinitialized, readonly instance, equaling Void - - - - - A preinitialized, readonly instance, equaling Nil - - - - - A preinitialized, readonly instance, equaling True - - - - - A preinitialized, readonly instance, equaling False - - - - - A class representing a key/value pair for Table use - - - - - Initializes a new instance of the struct. - - The key. - The value. - - - - Gets the key. - - - - - Gets or sets the value. - - - - - Gets the nil pair - - - - - Class giving access to details of the environment where the script is executing - - - - - Gets the metatable associated with the given value. - - The value. - - - - - Gets the specified metamethod associated with the given value. - - The value. - The metamethod name. - - - - - prepares a tail call request for the specified metamethod, or null if no metamethod is found. - - - - - Gets the metamethod to be used for a binary operation using op1 and op2. - - - - - Gets the script object associated with this request - - - - - - Gets the coroutine which is performing the call - - - - - Calls a callback function implemented in "classic way". - Useful to port C code from Lua, or C# code from UniLua and KopiLua. - Lua : http://www.lua.org/ - UniLua : http://github.com/xebecnan/UniLua - KopiLua : http://github.com/NLua/KopiLua - - The arguments. - Name of the function - for error messages. - The callback. - - - - - Calls the specified function, supporting most cases. The called function must not yield. - - The function; it must be a Function or ClrFunction or have a call metamethod defined. - The arguments. - - If the function yields, returns a tail call request with continuations/handlers or, of course, if it encounters errors. - - - - Tries to get the reference of a symbol in the current execution state - - - - - Tries to get the value of a symbol in the current execution state - - - - - Finds a symbol by name in the current execution state - - - - - Performs a message decoration before unwinding after an error. To be used in the implementation of xpcall like functions. - - The message handler. - The exception. - - - - Gets a value indicating whether this instance is running a dynamic execution. - Under a dynamic execution, most methods of ScriptExecutionContext are not reliable as the - processing engine of the script is not "really" running or is not available. - - - - - Gets the location of the code calling back - - - - - Gets or sets the additional data associated to this CLR function call. - - - - - Gets the current global env, or null if not found. - - - - - Class representing the source code of a given script - - - - - Gets the code snippet represented by a source ref - - The source code reference. - - - - - Gets the name of the source code - - - - - Gets the source code as a string - - - - - Gets the source code lines. - - - - - Gets the script owning this resource. - - - - - Gets the source identifier inside a script - - - - - State of coroutines - - - - - This is the main coroutine - - - - - Coroutine has not started yet - - - - - Coroutine is suspended - - - - - Coroutine is running - - - - - Coroutine has terminated - - - - - Wrappers for enumerables as return types - - - - - LINQ helper methods - - - - - Converts the specified enumerable dynvalues of a given script type to objects of a given type - - The desired type - The enumerable. - The type. - - - - Filters an enumeration for items of the given script type - - The enumerable. - The script type. - - - - Converts the elements to CLR objects - - The enumerable. - - - - Converts the elements to CLR objects of the desired type - - The desired type - The enumerable. - - - - - - - - - Marks a type of automatic registration as userdata (which happens only if UserData.RegisterAssembly is called). - - - - - Initializes a new instance of the class. - - - - - The interop access mode - - - - - Forces a class member visibility to scripts. Can be used to hide public members or to expose non-public ones. - - - - - Initializes a new instance of the class. - - if set to true the member will be exposed to scripts, if false the member will be hidden. - - - - Gets a value indicating whether this is set to "visible". - - - - - Descriptor which acts as a non-containing adapter from IUserDataType to IUserDataDescriptor - - - - - Initializes a new instance of the class. - - The type. - Name of the friendly. - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Standard descriptor for userdata types. - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - The interop access mode this descriptor uses for members access - A human readable friendly name of the descriptor. - - - - Fills the member list. - - - - - Gets the interop access mode this descriptor uses for members access - - - - - Enumerations of the possible strategies to marshal CLR objects to MoonSharp userdata and functions - when using automatic descriptors. - Note that these are "hints" and MoonSharp is free to ignore the access mode specified (if different from - HideMembers) and downgrade the access mode to "Reflection". - This particularly happens when running on AOT platforms like iOS. - See also : and . - - - - - Optimization is not performed and reflection is used everytime to access members. - This is the slowest approach but saves a lot of memory if members are seldomly used. - - - - - Optimization is done on the fly the first time a member is accessed. - This saves memory for all members that are never accessed, at the cost of an increased script execution time. - - - - - Optimization is done at registration time. - - - - - Optimization is done in a background thread which starts at registration time. - If a member is accessed before optimization is completed, reflection is used. - - - - - No optimization is done, and members are not accessible at all. - - - - - No reflection is allowed, nor code generation. This is used as a safeguard when registering types which should not - use a standard reflection based descriptor - for example for types implementing - - - - - Use the default access mode - - - - - Class providing easier marshalling of CLR functions - - - - - Tries to create a new StandardUserDataMethodDescriptor, returning - null in case the method is not - visible to script code. - - The MethodBase. - The - if set to true forces visibility. - - A new StandardUserDataMethodDescriptor or null. - - - - - Initializes a new instance of the class. - - The MethodBase (MethodInfo or ConstructorInfo) got through reflection. - The interop access mode. - Invalid accessMode - - - - Checks if the method is compatible with a standard descriptor - - The MethodBase. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The method contains unresolved generic parameters, or has an unresolved generic return type - or - The method contains pointer parameters, or has a pointer return type - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function as a DynValue. - - The script for which the callback must be generated. - The object (null for static). - - - - - Creates a callback DynValue starting from a MethodInfo. - - The script. - The mi. - The object. - - - - - The internal callback which actually executes the method - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value. - - The script. - The object. - The v. - - - - - Gets the method information (can be a MethodInfo or ConstructorInfo) - - - - - Gets the access mode used for interop - - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - Gets a value indicating whether the described method is a constructor - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets the types of access supported by this member - - - - - Class providing easier marshalling of CLR properties - - - - - Tries to create a new StandardUserDataPropertyDescriptor, returning null in case the property is not - visible to script code. - - The PropertyInfo. - The - A new StandardUserDataPropertyDescriptor or null. - - - - Initializes a new instance of the class. - NOTE: This constructor gives get/set visibility based exclusively on the CLR visibility of the - getter and setter methods. - - The pi. - The access mode. - - - - Initializes a new instance of the class. - - The PropertyInfo. - The - The getter method. Use null to make the property writeonly. - The setter method. Use null to make the property readonly. - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Gets the PropertyInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance can be read from - - - true if this instance can be read from; otherwise, false. - - - - - Gets a value indicating whether this instance can be written to. - - - true if this instance can be written to; otherwise, false. - - - - - Gets the types of access supported by this member - - - - - The scope of a closure (container of upvalues) - - - - - Gets the symbols. - - - - - Enumeration of the types of SymbolRef - - - - - The symbol ref of a local variable - - - - - The symbol ref of an upvalue variable - - - - - The symbol ref of a global variable - - - - - The symbol ref of the global environment - - - - - This class stores a possible l-value (that is a potential target of an assignment) - - - - - Creates a new symbol reference pointing to a global var - - The name. - The _ENV symbol. - - - - - Creates a new symbol reference pointing to a local var - - The name. - The index of the var in local scope. - - - - - Creates a new symbol reference pointing to an upvalue var - - The name. - The index of the var in closure scope. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Writes this instance to a binary stream - - - - - Reads a symbolref from a binary stream - - - - - Gets the type of this symbol reference - - - - - Gets the index of this symbol in its scope context - - - - - Gets the name of this symbol - - - - - Gets the environment this symbol refers to (for global symbols only) - - - - - Gets the default _ENV. - - - - - Enumeration of possible data types in MoonSharp - - - - - A nil value, as in Lua - - - - - A place holder for no value - - - - - A Lua boolean - - - - - A Lua number - - - - - A Lua string - - - - - A Lua function - - - - - A Lua table - - - - - A set of multiple values - - - - - A userdata reference - that is a wrapped CLR object - - - - - A coroutine handle - - - - - A callback function - - - - - A request to execute a tail call - - - - - A request to coroutine.yield - - - - - Extension methods to DataType - - - - - Determines whether this data type can have type metatables. - - The type. - - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function, with additional values - to support debuggers - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - A script loader loading scripts from an assembly resources - - - - - A base implementation of IScriptLoader, offering resolution of module names. - - - - - Class dictating how requests to read scripts from files are handled. - - It's recommended that no class implement IScriptLoader directly, and rather extend ScriptLoaderBase. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile) - - The modname. - The global context. - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves the name of a module on a set of paths. - - The modname. - The paths. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable (if and only if - the IgnoreLuaPathGlobal is false), and - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - Unpacks a string path in a form like "?;?.lua" to an array - - - - - Gets the default environment paths. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Gets or sets the modules paths used by the "require" function. If null, the default paths are used (using - environment variables etc.). - - - - - Gets or sets a value indicating whether the LUA_PATH global is checked or not to get the path where modules are contained. - If true, the LUA_PATH global is NOT checked. - - - - - Initializes a new instance of the class. - - The assembly containing the scripts as embedded resources or null to use the calling assembly. - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader used for platforms we cannot initialize in any better way.. - - - - - An implementation of which supports a very basic history of recent input lines. - - - - - This class provides a simple REPL intepreter ready to be reused in a simple way. - - - - - Initializes a new instance of the class. - - The script. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - This method returns the result of the computation, or null if more input is needed for a computation. - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "?" as a - dynamic expression to evaluate instead of script code (likely invalid) - - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "=" as a - non-dynamic expression to evaluate (just like the Lua interpreter does by default). - - - - - Gets a value indicating whether this instance has a pending command - - - - - Gets the current pending command. - - - - - Gets the classic prompt (">" or ">>") given the current state of the interpreter - - - - - Initializes a new instance of the class. - - The script. - Size of the history. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - - This method returns the result of the computation, or null if more input is needed for a computation. - - - - - Gets the previous item in history, or null - - - - - Gets the next item in history, or null - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - AND starts with module paths taken from environment variables (again, not going through the platform object). - - The paths are preconstructed using : - * The MOONSHARP_PATH environment variable if it exists - * The LUA_PATH_5_2 environment variable if MOONSHARP_PATH does not exists - * The LUA_PATH environment variable if LUA_PATH_5_2 and MOONSHARP_PATH do not exists - * The "?;?.lua" path if all the above fail - - Also, everytime a module is require(d), the "LUA_PATH" global variable is checked. If it exists, those paths - will be used to load the module instead of the global ones. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable, and - - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - A script loader which can load scripts from assets in Unity3D. - Scripts should be saved as .txt files in a subdirectory of Assets/Resources. - - When MoonSharp is activated on Unity3D and the default script loader is used, - scripts should be saved as .txt files in Assets/Resources/MoonSharp/Scripts. - - - - - The default path where scripts are meant to be stored (if not changed) - - - - - Initializes a new instance of the class. - - The path, relative to Assets/Resources. For example - if your scripts are stored under Assets/Resources/Scripts, you should - pass the value "Scripts". If null, "MoonSharp/Scripts" is used. - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - UnityAssetsScriptLoader.LoadFile : Cannot load + file - - - - Checks if a given file exists - - The file. - - - - - Gets the list of loaded scripts filenames (useful for debugging purposes). - - - - - - In a module type, mark fields with this attribute to have them exposed as a module constant. - - See for more information about modules. - - - - - Gets or sets the name of the constant - if different from the name of the field itself - - - - - Namespace containing all the most commonly used classes for MoonSharp operation. - When in doubt, refer to and classes as starting points. - - - - - Namespace containing the implementation of the Lua standard library, as MoonSharp modules. - There's seldom the need to access these classes directly. - - - - - Namespace containing userdata classes for the 'io' module - - - - - Namespace containing classes used to support debuggers - - - - - Namespace containing classes used to support self diagnostics (e.g. performance counters) - - - - - Namespace containing classes used to customize and support advanced interoperations between - scripts and CLR code. - - - - - Namespace containing classes used to provide a minimal support for porting code based on the classic - "LuaState" model (e.g. code based on KopiLua, UniLua or Lua itself). - - - - - Namespace containing classes used to customized how scripts are loaded from external files. - - - - - Namespace containing classes used to customize how the interfacing with the operative system happens - for the 'os' and 'io' modules, and for future modules/classes which may require OS access. - See and . - - - - - Contains classes useful to implement REPL interpreters. - See : - - - - - Interface to abstract all accesses made to the underlying platform (OS, framework) by the scripting engine. - Can be used both to support "non-standard" platforms (i.e. non-posix, non-windows) and/or to sandbox the behaviour - of the scripting engine. - - It's recommended that no class implement IPlatformAccessor directly, and rather extend . - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - Gets the name of the platform (used for debug purposes). - - The name of the platform (used for debug purposes) - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If a meaningful implementation cannot be provided, this method should return null. - - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - The script. - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - True if the file exists, false otherwise. - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - An abstract class which offers basic services on top of IPlatformAccessor to provide easier implementation of platforms. - - - - - Gets the platform name prefix - - - - - - Gets the name of the platform (used for debug purposes). - - - The name of the platform (used for debug purposes) - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - DEPRECATED. - This is kept for backward compatibility, see the overload taking a prompt as an input parameter. - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - A static class offering properties for autodetection of system/platform details - - - - - Gets a value indicating whether this instance is running on mono. - - - - - Gets a value indicating whether this instance is running on a CLR4 compatible implementation - - - - - Gets a value indicating whether this instance is running on Unity-3D - - - - - Gets a value indicating whether this instance has been built as a Portable Class Library - - - - - Gets a value indicating whether this instance is running a system using Ahead-Of-Time compilation - and not supporting JIT. - - - - - A class implementing all the bits needed to have a minimal support of a platform. - This does not support the 'io'/'file' modules and has partial support of the 'os' module. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - A function used to open files in the 'io' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a standard stream (stdin, stdout, stderr). - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The type. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Exits the process, returning the specified exit code. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The exit code. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Checks if a file exists. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - - True if the file exists, false otherwise. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Deletes the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Moves the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The source. - The DST. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The cmdline. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets the platform name prefix - - - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - - Enumeration of standard file handles - - - - - Standard Input - - - - - Standard Output - - - - - Standard Error Output - - - - - Class providing the IPlatformAccessor interface for standard full-feaured implementations. - - - - - Converts a Lua string access mode to a FileAccess enum - - The mode. - - - - - Converts a Lua string access mode to a ParseFileMode enum - - The mode. - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - type - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets the platform name prefix - - - - - - - This class implements a MoonSharp scripting session. Multiple Script objects can coexist in the same program but cannot share - data among themselves unless some mechanism is put in place. - - - - - The version of the MoonSharp engine - - - - - The Lua version being supported - - - - - Initializes the class. - - - - - Initializes a new instance of the clas.s - - - - - Initializes a new instance of the class. - - The core modules to be pre-registered in the default global table. - - - - Loads a string containing a Lua/MoonSharp function. - - The code. - The global table to bind to this chunk. - Name of the function used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a Lua/MoonSharp script from a System.IO.Stream. NOTE: This will *NOT* close the stream! - - The stream containing code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Dumps on the specified stream. - - The function. - The stream. - - function arg is not a function! - or - stream is readonly! - or - function arg has upvalues other than _ENV - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - The filename to be used in error messages. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads and executes a string containing a Lua/MoonSharp script. - - The code. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a stream containing a Lua/MoonSharp script. - - The stream. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a file containing a Lua/MoonSharp script. - - The filename. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Runs the specified file with all possible defaults for quick experimenting. - - The filename. - A DynValue containing the result of the processing of the executed script. - - - - Runs the specified code with all possible defaults for quick experimenting. - - The Lua/MoonSharp code. - A DynValue containing the result of the processing of the executed script. - - - - Creates a closure from a bytecode address. - - The address. - The env table to create a 0-upvalue - - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Gets the main chunk function. - - A DynValue containing a function which executes the first chunk that has been loaded. - - - - Attaches a debugger. This usually should be called by the debugger itself and not by user code. - - The debugger object. - - - - Gets the source code. - - The source code identifier. - - - - - Loads a module as per the "require" Lua function. http://www.lua.org/pil/8.1.html - - The module name - The global context. - - Raised if module is not found - - - - Gets a type metatable. - - The type. - - - - - Sets a type metatable. - - The type. Must be Nil, Boolean, Number, String or Function - The metatable. - Specified type not supported : + type.ToString() - - - - Warms up the parser/lexer structures so that MoonSharp operations start faster. - - - - - Creates a new dynamic expression. - - The code of the expression. - - - - - Creates a new dynamic expression which is actually quite static, returning always the same constant value. - - The code of the not-so-dynamic expression. - The constant to return. - - - - - Gets an execution context exposing only partial functionality, which should be used for - those cases where the execution engine is not really running - for example for dynamic expression - or calls from CLR to CLR callbacks - - - - - Gets or sets the script loader which will be used as the value of the - ScriptLoader property for all newly created scripts. - - - - - Gets access to the script options. - - - - - Gets the global options, that is options which cannot be customized per-script. - - - - - Gets access to performance statistics. - - - - - Gets the default global table for this script. Unless a different table is intentionally passed (or setfenv has been used) - execution uses this table. - - - - - Gets the source code count. - - - The source code count. - - - - - MoonSharp (like Lua itself) provides a registry, a predefined table that can be used by any CLR code to - store whatever Lua values it needs to store. - Any CLR code can store data into this table, but it should take care to choose keys - that are different from those used by other libraries, to avoid collisions. - Typically, you should use as key a string GUID, a string containing your library name, or a - userdata with the address of a CLR object in your code. - - - - - A class representing a Lua table. - - - - - Initializes a new instance of the class. - - The owner script. - - - - Removes all items from the Table. - - - - - Gets the integral key from a double. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) - - The key. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) as a System.Object. - - The key. - - - - - Sets the dynvalue associated with the specified key. Both expressed as System.Object. - - The key. - The value. - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Gets the value associated with the specified key, without bringing to Nil the non-existant values. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Collects the dead keys. This frees up memory but invalidates pending iterators. - It's called automatically internally when the semantics of Lua tables allow, but can be forced - externally if it's known that no iterators are pending. - - - - - Returns the next pair from a value - - - - - Gets the script owning this resource. - - - - - Gets or sets the - with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - Multiple keys can be used to access subtables. - - - The . - - The key. - Optional subkeys to access subtables - - - - - Gets or sets the with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - - - The . - - The key. - - - - - Gets the length of the "array part". - - - - - Gets the meta-table associated with this instance. - - - - - Enumerates the key/value pairs. - - - - - - Enumerates the keys. - - - - - - Enumerates the values - - - - - - A preallocated, non-resizable, stack - - - - - - Enumeration (combinable as flags) of all the standard library modules - - - - - Value used to specify no modules to be loaded (equals 0). - - - - - The basic methods. Includes "assert", "collectgarbage", "error", "print", "select", "type", "tonumber" and "tostring". - - - - - The global constants: "_G", "_VERSION" and "_MOONSHARP". - - - - - The table iterators: "next", "ipairs" and "pairs". - - - - - The metatable methods : "setmetatable", "getmetatable", "rawset", "rawget", "rawequal" and "rawlen". - - - - - The string package - - - - - The load methods: "load", "loadsafe", "loadfile", "loadfilesafe", "dofile" and "require" - - - - - The table package - - - - - The error handling methods: "pcall" and "xpcall" - - - - - The math package - - - - - The coroutine package - - - - - The bit32 package - - - - - The time methods of the "os" package: "clock", "difftime", "date" and "time" - - - - - The methods of "os" package excluding those listed for OS_Time. These are not supported under Unity. - - - - - The methods of "io" and "file" packages. These are not supported under Unity. - - - - - The "debug" package (it has limited support) - - - - - The "dynamic" package (introduced by MoonSharp). - - - - - A sort of "hard" sandbox preset, including string, math, table, bit32 packages, constants and table iterators. - - - - - A softer sandbox preset, adding metatables support, error handling, coroutine, time functions and dynamic evaluations. - - - - - The default preset. Includes everything except "debug" as now. - Beware that using this preset allows scripts unlimited access to the system. - - - - - The complete package. - Beware that using this preset allows scripts unlimited access to the system. - - - - - Class managing modules (mostly as extension methods) - - - - - Register the core modules to a table - - The table. - The modules. - - - - - Registers the standard constants (_G, _VERSION, _MOONSHARP) to a table - - The table. - - - - - Registers a module type to the specified table - - The table. - The type - - If the module contains some incompatibility - - - - Registers a module type to the specified table - - The module type - The table. - - If the module contains some incompatibility - - - - In a module type, mark methods or fields with this attribute to have them exposed as module functions. - Methods must have the signature "public static DynValue ...(ScriptExecutionContextCallbackArguments)". - Fields must be static or const strings, with an anonymous Lua function inside. - - See for more information about modules. - - - - - Gets or sets the name of the function in the module (defaults to member name) - - - - - Marks a CLR type to be a MoonSharp module. - Modules are the fastest way to bring interop between scripts and CLR code, albeit at the cost of a very increased - complexity in writing them. Modules is what's used for the standard library, for maximum efficiency. - - Modules are basically classes containing only static methods, with the callback function signature. - - See and for (extension) methods used to register modules to a - table. - - See for information regarding the standard callback signature along with easier ways - to marshal methods. - - See for easier object marshalling. - - - - - Gets or sets the namespace, that is the name of the table which will contain the defined functions. - Can be null to be in the global table. - - - - - Class containing script global options, that is options which cannot be customized per-script. - - - - - - Gets or sets the custom converters. - - - - - Gets or sets the platform abstraction to use. - - - The current platform abstraction. - - - - - This class contains options to customize behaviour of Script objects. - - - - - Gets or sets the current script-loader. - - - - - Gets or sets the debug print handler - - - - - Gets or sets the debug input handler (takes a prompt as an input, for interactive interpreters, like debug.debug). - - - - - Gets or sets a value indicating whether error messages will use Lua error locations instead of MoonSharp - improved ones. Use this for compatibility with legacy Lua code which parses error messages. - - - - - Gets or sets the stream used as stdin. If null, a default stream is used. - - - - - Gets or sets the stream used as stdout. If null, a default stream is used. - - - - - Gets or sets the stream used as stderr. If null, a default stream is used. - - - - - Gets or sets the stack depth threshold at which MoonSharp starts doing - tail call optimizations. - TCOs can provide the little benefit of avoiding stack overflows in corner case - scenarios, at the expense of losing debug information and error stack traces - in all other, more common scenarios. MoonSharp choice is to start performing - TCOs only after a certain threshold of stack usage is reached - by default - half the current stack depth (128K entries), thus 64K entries, on either - the internal stacks. - Set this to int.MaxValue to disable TCOs entirely, or to 0 to always have - TCOs enabled. - - - - - Gets or sets a value indicating whether the thread check is enabled. - A "lazy" thread check is performed everytime execution is entered to ensure that no two threads - calls MoonSharp execution concurrently. However 1) the check is performed best effort (thus, it might - not detect all issues) and 2) it might trigger in very odd legal situations (like, switching threads - inside a CLR-callback without actually having concurrency. - - Disable this option if the thread check is giving problems in your scenario, but please check that - you are not calling MoonSharp execution concurrently as it is not supported. - - - - - Primaries the exp. - - The lcontext. - - - - - - - - - - Creates a sub tree of binary expressions - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net40-client/MoonSharp.Interpreter.xml b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net40-client/MoonSharp.Interpreter.xml deleted file mode 100644 index 51902bef..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/net40-client/MoonSharp.Interpreter.xml +++ /dev/null @@ -1,6529 +0,0 @@ - - - - MoonSharp.Interpreter - - - - - Class implementing coroutine Lua functions - - - - - Class implementing basic Lua functions (print, type, tostring, etc) as a MoonSharp module. - - - - - Class implementing debug Lua functions. Support for the debug module is partial. - - - - - Class implementing dynamic expression evaluations at runtime (a MoonSharp addition). - - - - - Class implementing error handling Lua functions (pcall and xpcall) - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - A base class for many MoonSharp objects. - Helds a ReferenceID property which gets a different value for every object instance, for debugging - purposes. Note that the ID is not assigned in a thread safe manner for speed reason, so the IDs - are guaranteed to be unique only if everything is running on one thread at a time. - - - - - Formats a string with a type name and a ref-id - - The type name. - - - - - Gets the reference identifier. - - - The reference identifier. - - - - - Class implementing io Lua functions. Proper support requires a compatible IPlatformAccessor - - - - - Abstract class implementing an unclosable file Lua userdata. Methods are meant to be called by Lua code. - - - - - Class implementing loading Lua functions like 'require', 'load', etc. - - - - - Class implementing bit32 Lua functions - - - - - Class implementing math Lua functions - - - - - Class implementing metatable related Lua functions (xxxmetatable and rawxxx). - - - - - Class implementing system related Lua functions from the 'os' module. - Proper support requires a compatible IPlatformAccessor - - - - - Class implementing time related Lua functions from the 'os' module. - - - - - Classes using the classic interface should inherit from this class. - This class defines only static methods and is really meant to be used only - from C# and not other .NET languages. - - For easier operation they should also define: - using ptrdiff_t = System.Int32; - using lua_Integer = System.Int32; - using LUA_INTFRM_T = System.Int64; - using UNSIGNED_LUA_INTFRM_T = System.UInt64; - - - - - Calls a function. - To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, - the arguments to the function are pushed in direct order; that is, the first argument is pushed first. Finally you call - lua_call; nargs is the number of arguments that you pushed onto the stack. All arguments and the function value are - popped from the stack when the function is called. The function results are pushed onto the stack when the function - returns. The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from - the function are pushed. Lua takes care that the returned values fit into the stack space. The function results are - pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on - the top of the stack. - - The LuaState - The number of arguments. - The number of expected results. - - - - - A Dictionary where multiple values can be associated to the same key - - The key type - The value type - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The equality comparer to use in the underlying dictionary. - - - - Adds the specified key. Returns true if this is the first value for a given key - - The key. - The value. - - - - - Finds all the values associated with the specified key. - An empty collection is returned if not found. - - The key. - - - - Determines whether this contains the specified key - - The key. - - - - Clears this instance. - - - - - Removes the specified key and all its associated values from the multidictionary - - The key. - - - - Removes the value. Returns true if the removed value was the last of a given key - - The key. - The value. - - - - - Gets the keys. - - - - - Implementation of IEqualityComparer enforcing reference equality - - - - - Marks a method as the handler of metamethods of a userdata type - - - - - Initializes a new instance of the class. - - The metamethod name (like '__div', '__ipairs', etc.) - - - - The metamethod name (like '__div', '__ipairs', etc.) - - - - - Base interface to describe access to members of a given type. - While it's not infrastructural to implement custom type descriptors, it's needed for - classes extending . - - - - - Gets the value of this member as a to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value of this member as a . - - - - Sets the value of this member from a . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Extension methods for and . - - - - - Determines whether the specified MemberDescriptorAccess has ALL the specified flags. - - The access. - The flag. - - - - - Determines whether this instance can be read - - The descriptor instance. - - - - - Determines whether this instance can be written to - - The descriptor instance. - - - - - Determines whether this instance can be executed (called as a function) - - The descriptor instance. - - - - - Gets the getter of the member as a DynValue containing a callback - - The descriptor instance. - The script. - The object. - - - - - Returns the specified descriptor if it supports all the specified access modes, otherwise returns null. - - The descriptor instance. - The access mode(s). - - - - - Raises an appropriate ScriptRuntimeException if the specified access is not supported. - Checks are made for the MemberDescriptorAccess permissions AND for the access of instance - members through static userdatas. - - The desc. - The access. - The object to be checked for access. - - - - Interface for descriptors of any kind which support optimizations of their implementation according to InteropAccessMode - modes. This should seldom - if ever - be implemented in user code. - - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Specialized for members supporting overloads resolution. - - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Permissions for members access - - - - - The member can be read from - - - - - The member can be written to - - - - - The can be invoked - - - - - Descriptor of parameters used in implementations. - - - - - If the type got restricted, the original type before the restriction. - - - - - Initializes a new instance of the class. - - The name. - The type. - if set to true the parameter has default value. - The default value. - if set to true, is an out param. - - - - Initializes a new instance of the class. - - A ParameterInfo taken from reflection. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Restricts the type of this parameter to a tighter constraint. - Restrictions must be applied before the containing this - parameter is used in any way. - - The new type. - - Cannot restrict a ref/out param - or - Specified operation is not a restriction - - - - - Gets the name of the parameter - - - - - Gets the type of the parameter - - - - - Gets a value indicating whether this instance has a default value. - - - - - Gets the default value - - - - - Gets a value indicating whether this instance is an out parameter - - - - - Gets a value indicating whether this instance has been restricted. - - - - - Gets the original type of the parameter before any restriction has been applied. - - - - - Tries to convert a CLR object to a MoonSharp value, using "simple" logic. - Does NOT throw on failure. - - - - - Tries to convert a CLR object to a MoonSharp value, using more in-depth analysis - - - - - Converts an IEnumerable or IEnumerator to a DynValue - - The script. - The object. - - - - - Static functions to handle conversions of numeric types - - - - - HashSet of numeric types - - - - - Array of numeric types in order used for some conversions - - - - - Converts a double to another type - - - - - Converts a type to double - - - - - Converts a DynValue to a CLR object [simple conversion] - - - - - Converts a DynValue to a CLR object of a specific type - - - - - Gets a relative weight of how much the conversion is matching the given types. - Implementation must follow that of DynValueToObjectOfType.. it's not very DRY in that sense. - However here we are in perf-sensitive path.. TODO : double-check the gain and see if a DRY impl is better. - - - - - Converts an IList to a Lua table. - - - - - Converts an IDictionary to a Lua table. - - - - - Determines whether the specified table can be converted to the specified type - - The table. - The type. - - - - - Converts a table to a CLR object of a given type - - - - - Converts a table to a - - - - - Converts a table to a T[] - - - - - Converts a table to a - - - - - Converts a table to a , known in advance - - - - - Converts a table to a Dictionary, known in advance - - - - - A collection of custom converters between MoonSharp types and CLR types. - If a converter function is not specified or returns null, the standard conversion path applies. - - - - - Sets a custom converter from a script data type to a CLR data type. Set null to remove a previous custom converter. - - The script data type - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a script data type to a CLR data type, or null - - The script data type - The CLR data type. - The converter function, or null if not found - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a CLR data type, or null - - Type of the color data. - The converter function, or null if not found - - - - Removes all converters. - - - - - Helper extension methods used to simplify some parts of userdata descriptor implementations - - - - - Determines whether a - is changing visibility of a member - to scripts. - - The member to check. - - true if visibility is forced visible, - false if visibility is forced hidden or the specified MemberInfo is null, - if no attribute was found - - - - - Determines whether the specified PropertyInfo is visible publicly (either the getter or the setter is public). - - The PropertyInfo. - - - - - Gets the list of metamethod names from attributes - in practice the list of metamethods declared through - . - - The mi. - - - - - Gets the name of a conversion method to be exposed to Lua scripts - - The type. - - - - - An abstract user data descriptor which accepts members described by objects and - correctly dispatches to them. - Metamethods are also by default dispatched to operator overloads and other similar methods - see - . - - - - - Interface used by MoonSharp to access objects of a given type from scripts. - - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - The special name used by CLR for indexer getters - - - - - The special name used by CLR for indexer setters - - - - - The special name used by CLR for explicit cast conversions - - - - - The special name used by CLR for implicit cast conversions - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - A friendly name for the type, or null. - - - - Adds a member to the meta-members list. - - The name of the metamethod. - The desc. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Adds a DynValue as a member - - The name. - The value. - - - - Adds a property to the member list - - The name. - The descriptor. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Performs an "index" "get" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing operation by checking newly added extension methods for the given indexName. - - The script. - The object. - Member name to be indexed. - - - - - - Determines whether the descriptor contains the specified member (by exact name) - - Name of the member. - - - - - Determines whether the descriptor contains the specified member in the meta list (by exact name) - - Name of the meta-member. - - - - - Tries to perform an indexing operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - - - - - Performs an "index" "set" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing "set" operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - The value. - - - - - Converts the specified name from underscore_case to camelCase. - - The name. - - - - - Converts the specified name to one with an uppercase first letter (something to Something). - - The name. - - - - - Converts this userdata to string - - The object. - - - - - Executes the specified indexer method. - - The method descriptor - The script. - The object. - The indexer parameter - The dynvalue to set on a setter, or null. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - See for further details. - - If a method exists marked with for the specific - metamethod requested, that method is returned. - - If the above fails, the following dispatching occur: - - __add, __sub, __mul, __div, __mod and __unm are dispatched to C# operator overloads (if they exist) - __eq is dispatched to System.Object.Equals. - __lt and __le are dispatched IComparable.Compare, if the type implements IComparable or IComparable{object} - __len is dispatched to Length and Count properties, if those exist. - __iterator is handled if the object implements IEnumerable or IEnumerator. - __tonumber is dispatched to implicit or explicit conversion operators to standard numeric types. - __tobool is dispatched to an implicit or explicit conversion operator to bool. If that fails, operator true is used. - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Gets a human readable friendly name of the descriptor - - - - - Standard descriptor for Enum values - - - - - Initializes a new instance of the class. - - Type of the enum. - Name of the friendly. - enumType must be an enum! - - - - Fills the member list. - - - - - Adds an enum method to the object - - The name. - The dyn value. - - - - Gets the value of the enum as a long - - - - - Gets the value of the enum as a ulong - - - - - Creates an enum value from a long - - - - - Creates an enum value from a ulong - - - - - Creates conversion functions for signed enums - - - - - Creates conversion functions for unsigned enums - - - - - Determines whether the specified object is compatible with the specified type. - - The type. - The object. - - - - - Gets a "meta" operation on this userdata. - In this specific case, only the concat operator is supported, only on flags enums and it implements the - 'or' operator. - - - - - - - - - Gets the underlying type of the enum. - - - - - Gets a value indicating whether underlying type of the enum is unsigned. - - - - - Gets a value indicating whether this instance describes a flags enumeration. - - - - - Class providing a simple descriptor for constant DynValues in userdata - - - - - Initializes a new instance of the class. - - The name. - The value. - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - userdata '{0}' cannot be written to. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Gets the value wrapped by this descriptor - - - - - Class providing easier marshalling of CLR events. Handling is limited to a narrow range of handler signatures, which, - however, covers in practice most of all available events. - - - - - The maximum number of arguments supported in an event handler delegate - - - - - Tries to create a new StandardUserDataEventDescriptor, returning null in case the method is not - visible to script code. - - The EventInfo. - The - A new StandardUserDataEventDescriptor or null. - - - - Checks if the event is compatible with a standard descriptor - - The EventInfo. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The event is declared in a value type - or - The event does not have both add and remove methods - or - The event handler type doesn't implement a public Invoke method - or - The event handler has a return type which is not System.Void - or - The event handler has more than MAX_ARGS_IN_DELEGATE parameters - or - The event handler has a value type parameter or a by ref parameter - or - The event handler signature is not a valid method according to - - - - - Initializes a new instance of the class. - - The ei. - The access mode. - - - - Gets a dynvalue which is a facade supporting add/remove methods which is callable from scripts - - The script. - The object for which the facade should be written. - - - - - Sets the value. - - The script. - The object. - The v. - - - - Gets the EventInfo object of the event described by this descriptor - - - - - Gets a value indicating whether the event described by this descriptor is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - As a convenience, every type deriving from IUserDataType is "self-described". That is, no descriptor is needed/generated - and the object itself is used to describe the type for interop. See also , - and . - - - - - Performs an "index" "get" operation. - - The script originating the request - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The name of the metamember. - - - - - Class providing easier marshalling of overloaded CLR functions - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptor of the first overloaded method. - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptors of the overloaded methods. - - - - Sets the extension methods snapshot. - - The version. - The ext methods. - - - - Adds an overload. - - The overload. - - - - Performs the overloaded call. - - The script. - The object. - The context. - The arguments. - - function call doesn't match any overload - - - - Calculates the score for the overload. - - The context. - The arguments. - The method. - if set to true, is an extension method. - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - - - - - Gets or sets a value indicating whether this instance ignores extension methods. - - - - - Gets the name of the first described overload - - - - - Gets the name of the first described overload - - - - - Gets the number of overloaded methods contained in this collection - - - The overload count. - - - - - Gets a value indicating whether there is at least one static method in the resolution list - - - - - - Gets the types of access supported by this member - - - - - Comparer class for IOverloadableMemberDescriptor - - - - - Class providing easier marshalling of CLR fields - - - - - Tries to create a new StandardUserDataFieldDescriptor, returning null in case the field is not - visible to script code. - - The FieldInfo. - The - A new StandardUserDataFieldDescriptor or null. - - - - Initializes a new instance of the class. - - The FieldInfo. - The - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Gets the FieldInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance is a constant - - - - - Gets a value indicating whether this instance is readonly - - - - - Gets the types of access supported by this member - - - - - Member descriptor for the default constructor of value types. - - - - - Initializes a new instance of the - class - representing the default empty ctor for a value type. - - Type of the value. - valueType is not a value type - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a - to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a - . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - This property is equal to the value type to be constructed. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the types of access supported by this member - - - - - "Optimized" BinaryReader which shares strings and use a dumb compression for integers - - - - - "Optimized" BinaryWriter which shares strings and use a dumb compression for integers - - - - - An adapter over Stream which bypasses the Dispose and Close methods. - Used to work around the pesky wrappers .NET has over Stream (BinaryReader, StreamWriter, etc.) which think they - own the Stream and close them when they shouldn't. Damn. - - - - - Enumerations of the possible policies to handle UserData type registrations - See also : . - - - - - Types must be explicitly registered. If a base type or interface is registered, that is used. - - - - - Types are automatically registered if not found in the registry. This is easier to use but potentially unsafe. - - - - - A Delegate type which can wrap a script function - - The arguments. - The return value of the script function - - - - A Delegate type which can wrap a script function with a generic typed return value - - - The arguments. - The return value of the script function - - - - Flags to alter the way the DynValue.CheckType and other related functions operate on data types for - validation. - - - - - No type validation specific behaviour - - - - - Nil and Void values are allowed (and returned by the call) - - - - - Simple autoconversions are attempted: - 1) Numbers are convertible to strings - 2) Strings are convertible to numbers if they contain a number - 3) Everything is convertible to boolean (with void and nil converting to 'false', everything else converting to 'true') - Note: if both AutoConvert and AllowNil are specified, nils will NOT be converted to false booleans. - - - - - The default : Autoconverting values, no nils. - - - - - Exception thrown when a dynamic expression is invalid - - - - - Exception for all runtime errors. In addition to constructors, it offers a lot of static methods - generating more "standard" Lua errors. - - - - - Base type of all exceptions thrown in MoonSharp - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Gets the instruction pointer of the execution (if it makes sense) - - - - - Gets the interpreter call stack. - - - - - Gets the decorated message (error message plus error location in script) if possible. - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an arithmetic operation was attempted on non-numbers - - The left operand. - The right operand (or null). - The exception to be raised. - If both are numbers - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a concat operation was attempted on non-strings - - The left operand. - The right operand. - The exception to be raised. - If both are numbers or strings - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a len operator was applied on an invalid operand - - The operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a comparison operator was applied on an invalid combination of operand types - - The left operand. - The right operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The error message. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad userdata argument - - The argument number (0-based). - Name of the function generating this error. - The expected System.Type. - The object which was used. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - The data type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected type description. - The description of the type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - - This function creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - while creates a message like "bad argument #xxx to 'yyy' (value expected)" - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an out of range index was specified - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a negative number when a positive one was expected. - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - This function creates a message like "bad argument #xxx to 'yyy' (value expected)" - while creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an invalid attempt to index the specified object was made - - The object. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __index over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __newindex over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __call over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used nil as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used a NaN as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion to number failed. - - - Selects the correct error message: - 0 - "value must be a number" - 1 - "'for' initial value must be a number" - 2 - "'for' step must be a number" - 3 - "'for' limit must be a number" - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a CLR type to a Lua type has failed. - - The object which could not be converted. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a Lua type to a CLR type has failed. - - The Lua type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a constrained conversion of a Lua type to a CLR type has failed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a userdata of a specific CLR type was expected and a non-userdata type was passed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to index an invalid member of a userdata was done. - - The name of the userdata type. - The field name. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt resume a coroutine in an invalid state was done. - - The state of the coroutine. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield across a CLR boundary was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield from the main coroutine was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to call a non-function was made - - The lua non-function data type. - The debug text to aid location (appears as "near 'xxx'"). - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The member descriptor. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The type descriptor. - The member descriptor. - - - - - Gets or sets a value indicating whether the message should not be decorated - - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Initializes a new instance of the class. - - The message. - - - - Represents a dynamic expression in the script - - - - - Common interface for all resources which are uniquely bound to a script. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - The code which generated this expression - - - - - Evaluates the expression - - The context. - - - - - Finds a symbol in the expression - - The context. - - - - - Determines whether this instance is a constant expression - - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - Internal type used by for registration - - - - - Wrapper which allows for easier management of userdata without registering a new userdata type - useful - if a type which is not exposed to scripts but can be managed as a "black box" by scripts is desired. - - The type to wrap - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The o. - - - - Gets or sets the value this instance wraps. - - - - - Determines whether the specified value is of numeric type. - - The object to check. - - true if o is a numeric type; otherwise, false. - - - - - Determines whether the specified value is positive. - - The value. - if set to true treats 0 as positive. - - true if the specified value is positive; otherwise, false. - - - - - Converts the specified values boxed type to its correpsonding unsigned - type. - - The value. - A boxed numeric object whos type is unsigned. - - - - Converts the specified values boxed type to its correpsonding integer - type. - - The value. - if set to true [round]. - - A boxed numeric object whos type is an integer type. - - - - - Replaces the string representations of meta chars with their corresponding - character values. - - The input. - A string with all string meta chars are replaced - - - - Class implementing string Lua functions - - - - - Class implementing table Lua iterators (pairs, ipairs, next) - - - - - Class implementing table Lua functions - - - - - Class exposing table.unpack and table.pack in the global namespace (to work around the most common Lua 5.1 compatibility issue). - - - - - Extension methods used in the whole project. - - - - - Gets a value from the dictionary or returns the default value - - The type of the key. - The type of the value. - The dictionary. - The key. - - - - - Gets a value from the dictionary or creates it - - The type of the key. - The type of the value. - The dictionary. - The key. - A function which will create the value if it doesn't exist. - - - - - A non preallocated, non_fixed size stack - - - - - - An index to accelerate operations on a LinkedList using a single key of type - More than one LinkedListIndex can index the same linked list, but every node in the linked list must be indexed by one and only one - LinkedListIndex object. - - The type of the key. Must implement Equals and GetHashCode appropriately. - The type of the values contained in the linked list. - - - - Initializes a new instance of the class. - - The linked list to be indexed. - - - - Finds the node indexed by the specified key, or null. - - The key. - - - - Updates or creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - The previous value of the element - - - - Creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - - - - Removes the specified key from the index, and the node indexed by the key from the linked list. - - The key. - - - - Determines whether the index contains the specified key. - - The key. - - - - Clears this instance (removes all elements) - - - - - Provides facility to create a "sliced" view over an existing IList - - The type of the items contained in the collection - - - - Initializes a new instance of the class. - - The list to apply the Slice view on - From which index - The length of the slice - if set to true the view is in reversed order. - - - - Calculates the real index in the underlying collection - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Converts to an array. - - - - - Converts to an list. - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - Slices are readonly - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - Slices are readonly - - - - Adds an item to the . - - The object to add to the . - Slices are readonly - - - - Removes all items from the . - - Slices are readonly - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - Slices are readonly - - - - Gets or sets the element at the specified index. - - The index. - - - - - Gets the index from which the slice starts - - - - - Gets the number of elements contained in the . - - The number of elements contained in the . - - - - Gets a value indicating whether this operates in a reversed direction. - - - true if this operates in a reversed direction; otherwise, false. - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - A class representing a script coroutine - - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as DynValue(s) - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as System.Object. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as the specified type. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - The purpose of this method is to convert a MoonSharp/Lua coroutine to a Unity3D coroutine. - This loops over the coroutine, discarding returned values, and returning null for each invocation. - This means however that the coroutine will be invoked each frame. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - The arguments. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - - Resumes the coroutine - - The ScriptExecutionContext. - The arguments. - - - - - Gets the coroutine stack trace for debug purposes - - The skip. - The entry source reference. - - - - - Gets the type of coroutine - - - - - Gets the coroutine state. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - - Possible types of coroutine - - - - - A valid coroutine - - - - - A CLR callback assigned to a coroutine. - - - - - A CLR callback assigned to a coroutine and already executed. - - - - - Class used to support "tail" continuations - a way for C# / Lua interaction which supports - coroutine yielding (at the expense of a LOT of added complexity in calling code). - - - - - Gets or sets the function to call - - - - - Gets or sets the arguments to the function - - - - - Gets or sets the callback to be used as a continuation. - - - - - Gets or sets the callback to be used in case of errors. - - - - - Gets or sets the error handler to be called before stack unwinding - - - - - Class exposing C# objects as Lua userdata. - For efficiency, a global registry of types is maintained, instead of a per-script one. - - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers all types marked with a MoonSharpUserDataAttribute that ar contained in an assembly. - - The assembly. - if set to true extension types are registered to the appropriate registry. - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The type to be unregistered - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The The type to be unregistered - - - - Creates a userdata DynValue from the specified object, using a specific descriptor - - The object - The descriptor. - - - - - Creates a userdata DynValue from the specified object - - The object - - - - - Creates a static userdata DynValue from the specified IUserDataDescriptor - - The IUserDataDescriptor - - - - - Creates a static userdata DynValue from the specified Type - - The type - - - - - Creates a static userdata DynValue from the specified Type - - The Type - - - - - Registers an extension Type (that is a type containing extension methods) - - The type. - The InteropAccessMode. - - - - Gets all the extension methods which can match a given name - - The name. - - - - - Gets a number which gets incremented everytime the extension methods registry changes. - Use this to invalidate caches based on extension methods - - - - - - Gets or sets the "uservalue". See debug.getuservalue and debug.setuservalue. - http://www.lua.org/manual/5.2/manual.html#pdf-debug.setuservalue - - - - - Gets the object associated to this userdata (null for statics) - - - - - Gets the type descriptor of this userdata - - - - - Gets or sets the registration policy to be used in the whole application - - - - - Gets or sets the default access mode to be used in the whole application - - - The default access mode. - - InteropAccessMode is InteropAccessMode.Default - - - - Constants of well known "symbols" in the MoonSharp grammar - - - - - The variadic argument symbol ("...") - - - - - The environment symbol ("_ENV") - - - - - Class wrapping a request to yield a coroutine - - - - - The return values of the coroutine - - - - - Wrapper for a debugger initiated action - - - - - Initializes a new instance of the class. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - The type of action - - - - - Gets the time stamp UTC of this action - - - - - Gets or sets the source identifier this action refers to. - - - - - Gets or sets the source line this action refers to. - - - - - Gets or sets the source column this action refers to. - - - - - Gets the age of this debugger action - - - - - Type of the action - - - - - Step-in at the bytecode level - - - - - Step-over at the bytecode level - - - - - Step-out at the bytecode level - - - - - Step-in at the source level - - - - - Step-over at the source level - - - - - Step-out at the source level - - - - - Continue execution "freely" - - - - - Toggles breakpoint - - - - - Sets a breakpoint - - - - - Clears a breakpoint - - - - - Refresh the data - - - - - Hard refresh of data - - - - - No action - - - - - Interface for debuggers to implement, in order to provide debugging facilities to Scripts. - - - - - Called by the script engine when a source code is added or changed. - - The source code object. - - - - Called by the script engine when the bytecode changes. - - The bytecode source - - - - Called by the script engine at execution time to check if a break has - been requested. Should return pretty fast as it's called A LOT. - - - - - Called by the script engine when a runtime error occurs. - The debugger can return true to signal the engine that it wants to break - into the source of the error. If it does so, it should also return true - to subsequent calls to IsPauseRequested(). - - The runtime exception. - True if this error should break execution. - - - - Called by the script engine to get what action to do next. - - The instruction pointer in bytecode. - The source reference. - T - - - - Called by the script engine when the execution ends. - - - - - Called by the script engine to update watches of a given type. Note - that this method is not called only for watches in the strictest term, - but also for the stack, etc. - - Type of the watch. - The items. - - - - Called by the script engine to get which expressions are active - watches in the debugger. - - A list of watches - - - - Called by the script engine to refresh the breakpoint list. - - - - - Class representing a reference to source code interval - - - - - Gets a value indicating whether this instance is a breakpoint - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets whether the source ref includes the specified location - - Index of the source. - The line. - The column. - - - - - Sets the CannotBreakpoint flag. - - - - - - Formats the location according to script preferences - - The script. - if set to true the classic Lua format is forced. - - - - - Gets a value indicating whether this location is inside CLR . - - - - - Gets the index of the source. - - - - - Gets from which column the source code ref starts - - - - - Gets to which column the source code ref ends - - - - - Gets from which line the source code ref starts - - - - - Gets to which line the source code ref ends - - - - - Gets a value indicating whether this instance is a stop "step" in source mode - - - - - Gets a value indicating whether this instance cannot be set as a breakpoint - - - - - A watch item for the debugger to consume. - Most properties make or not sense depending on the WatchType. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the address of the item - - - - - Gets or sets the base pointer (base value of v-stack at entering the function). - Valid only for call-stack items - - - - - Gets or sets the return address. - Valid only for call-stack items - - - - - Gets or sets the name of the item - - - - - Gets or sets the value of the item - - - - - Gets or sets the symbol reference of the item - - - - - Gets or sets a value indicating whether this instance is generating an error. - - - - - Gets or sets the source location this item refers to. - - - - - Enumeration of the possible watch types - - - - - A real variable watch - - - - - The status of the v-stack - - - - - The call stack - - - - - The list of coroutines - - - - - The maximum value of this enum - - - - - Enumeration of the possible performance counters - - - - - Measures the time spent parsing the source creating the AST - - - - - Measures the time spent converting ASTs in bytecode - - - - - Measures the time spent in executing scripts - - - - - Measures the on the fly creation/compilation of functions in userdata descriptors - - - - - Sentinel value to get the enum size - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Enumeration of unit of measures of the performance counters - - - - - The performance counter is specified in bytes (of memory) - - - - - The performance counter is specified in milliseconds - - - - - A single object of this type exists for every script and gives access to performance statistics. - - - - - Gets the result of the specified performance counter . - - The PerformanceCounter. - - - - - Starts a stopwatch. - - - - - - Starts a stopwatch. - - - - - - Gets a string with a complete performance log. - - - - - - Gets or sets a value indicating whether this collection of performance stats is enabled. - - - true if enabled; otherwise, false. - - - - - The result of a performance counter - - - - - Returns a that represents this instance. - - - - - Converts a PerformanceCounterType to a string. - - The type. - - - - Gets the name of the performance counter which generated this result. - - - - - Gets the quantity monitored - see Type to understand what this field contains - - - - - Gets the number of instances which led to the specified counter being incremented - e.g. the times a specific - code is executed, or object instanced - - - - - Gets a value indicating whether this is global or relative to the resource - for which it's called. - - - - - Gets the unit of measure of the Counter field. - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Exception thrown when an inconsistent state is reached in the interpreter - - - - - Exception for all parsing/lexing errors. - - - - - Gets or sets a value indicating whether this exception was caused by premature stream termination (that is, unexpected EOF). - This can be used in REPL interfaces to tell between unrecoverable errors and those which can be recovered by extra input. - - - - - This class is a container for arguments received by a CallbackFunction - - - - - Initializes a new instance of the class. - - The arguments. - if set to true [is method call]. - - - - Gets the at the specified index, or null. - - The index. - if set to true all voids are translated to nils. - - - - - Converts the arguments to an array - - The number of elements to skip (default= 0). - - - - - Gets the specified argument as as an argument of the specified type. If not possible, - an exception is raised. - - The argument number. - Name of the function. - The type desired. - if set to true nil values are allowed. - - - - - Gets the specified argument as as an argument of the specified user data type. If not possible, - an exception is raised. - - The desired userdata type - The argument number. - Name of the function. - if set to true nil values are allowed. - - - - - Gets the specified argument as an integer - - The argument number. - Name of the function. - - - - - Gets the specified argument as a string, calling the __tostring metamethod if needed, in a NON - yield-compatible way. - - The execution context. - The argument number. - Name of the function. - - 'tostring' must return a string to '{0}' - - - - Returns a copy of CallbackArguments where the first ("self") argument is skipped if this was a method call, - otherwise returns itself. - - - - - - Gets the count of arguments - - - - - Gets or sets a value indicating whether this is a method call. - - - - - Gets the at the specified index, or Void if not found - - - - - A class representing a script function - - - - - Shortcut for an empty closure - - - - - Initializes a new instance of the class. - - The script. - The index. - The symbols. - The resolved locals. - - - - Calls this function with the specified args - - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Gets a delegate wrapping calls to this scripted function - - - - - - Gets a delegate wrapping calls to this scripted function - - The type of return value of the delegate. - - - - - Gets the number of upvalues in this closure - - The number of upvalues in this closure - - - - Gets the name of the specified upvalue. - - The index of the upvalue. - The upvalue name - - - - Gets the value of an upvalue - - The index of the upvalue. - The value of an upvalue - - - - Gets the type of the upvalues contained in this closure - - - - - - Gets the entry point location in bytecode . - - - - - Gets the script owning this function - - - - - The current closure context - - - - - Type of closure based on upvalues - - - - - The closure has no upvalues (thus, technically, it's a function and not a closure!) - - - - - The closure has _ENV as its only upvalue - - - - - The closure is a "real" closure, with multiple upvalues - - - - - This class wraps a CLR function - - - - - Initializes a new instance of the class. - - The callback function to be called. - The callback name, used in stacktraces, debugger, etc.. - - - - Invokes the callback function - - The execution context. - The arguments. - if set to true this is a method call. - - - - - Creates a CallbackFunction from a delegate. - - The script. - The delegate. - The access mode. - - - - - Creates a CallbackFunction from a MethodInfo relative to a function. - - The script. - The MethodInfo object. - The object to which the function applies, or null for static methods. - The access mode. - - The method is not static. - - - - Checks the callback signature of a method is compatible for callbacks - - - - - Gets the name of the function - - - - - Gets the call back. - - - The call back. - - - - - Gets or sets the default access mode used when marshalling delegates - - - The default access mode. Default, HideMembers and BackgroundOptimized are NOT supported. - - Default, HideMembers and BackgroundOptimized are NOT supported. - - - - Gets or sets an object used as additional data to the callback function (available in the execution context). - - - - - A class representing a value in a Lua/MoonSharp script. - - - - - Creates a new writable value initialized to Nil. - - - - - Creates a new writable value initialized to the specified boolean. - - - - - Creates a new writable value initialized to the specified number. - - - - - Creates a new writable value initialized to the specified string. - - - - - Creates a new writable value initialized to the specified StringBuilder. - - - - - Creates a new writable value initialized to the specified string using String.Format like syntax - - - - - Creates a new writable value initialized to the specified coroutine. - Internal use only, for external use, see Script.CoroutineCreate - - The coroutine object. - - - - - Creates a new writable value initialized to the specified closure (function). - - - - - Creates a new writable value initialized to the specified CLR callback. - - - - - Creates a new writable value initialized to the specified CLR callback. - See also CallbackFunction.FromDelegate and CallbackFunction.FromMethodInfo factory methods. - - - - - Creates a new writable value initialized to the specified table. - - - - - Creates a new writable value initialized to an empty table. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The function to be called. - The arguments. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The data for the tail call. - - - - - Creates a new request for a yield of the current coroutine. - - The yield argumenst. - - - - - Creates a new tuple initialized to the specified values. - - - - - Creates a new tuple initialized to the specified values - which can be potentially other tuples - - - - - Creates a new userdata value - - - - - Returns this value as readonly - eventually cloning it in the process if it isn't readonly to start with. - - - - - Clones this instance. - - - - - - Clones this instance, overriding the "readonly" status. - - if set to true the new instance is set as readonly, or writeable otherwise. - - - - - Clones this instance, returning a writable copy. - - Can't clone Symbol values - - - - Returns a string which is what it's expected to be output by the print function applied to this value. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Casts this DynValue to string, using coercion if the type is number. - - The string representation, or null if not number, not string. - - - - Casts this DynValue to a double, using coercion if the type is string. - - The string representation, or null if not number, not string or non-convertible-string. - - - - Casts this DynValue to a bool - - False if value is false or nil, true otherwise. - - - - Converts a tuple to a scalar value. If it's already a scalar value, this function returns "this". - - - - - Performs an assignment, overwriting the value with the specified one. - - The value. - If the value is readonly. - - - - Gets the length of a string or table value. - - - Value is not a table or string. - - - - Determines whether this instance is nil or void - - - - - Determines whether this instance is not nil or void - - - - - Determines whether this instance is void - - - - - Determines whether this instance is not void - - - - - Determines whether is nil, void or NaN (and thus unsuitable for using as a table key). - - - - - Changes the numeric value of a number DynValue. - - - - - Creates a new DynValue from a CLR object - - The script. - The object. - - - - - Converts this MoonSharp DynValue to a CLR object. - - - - - Converts this MoonSharp DynValue to a CLR object of the specified type. - - - - - Checks the type of this value corresponds to the desired type. A propert ScriptRuntimeException is thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - Name of the function requesting the value, for error message purposes. - The desired data type. - The argument number, for error message purposes. - The TypeValidationFlags. - - Thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - - - Checks if the type is a specific userdata type, and returns it or throws. - - - Name of the function. - The argument number. - The flags. - - - - - Gets a unique reference identifier. This is guaranteed to be unique only for dynvalues created in a single thread as it's not thread-safe. - - - - - Gets the type of the value. - - - - - Gets the function (valid only if the is ) - - - - - Gets the numeric value (valid only if the is ) - - - - - Gets the values in the tuple (valid only if the is Tuple). - This field is currently also used to hold arguments in values whose is . - - - - - Gets the coroutine handle. (valid only if the is Thread). - - - - - Gets the table (valid only if the is ) - - - - - Gets the boolean value (valid only if the is ) - - - - - Gets the string value (valid only if the is ) - - - - - Gets the CLR callback (valid only if the is ) - - - - - Gets the tail call data. - - - - - Gets the yield request data. - - - - - Gets the tail call data. - - - - - Returns true if this instance is write protected. - - - - - A preinitialized, readonly instance, equaling Void - - - - - A preinitialized, readonly instance, equaling Nil - - - - - A preinitialized, readonly instance, equaling True - - - - - A preinitialized, readonly instance, equaling False - - - - - A class representing a key/value pair for Table use - - - - - Initializes a new instance of the struct. - - The key. - The value. - - - - Gets the key. - - - - - Gets or sets the value. - - - - - Gets the nil pair - - - - - Class giving access to details of the environment where the script is executing - - - - - Gets the metatable associated with the given value. - - The value. - - - - - Gets the specified metamethod associated with the given value. - - The value. - The metamethod name. - - - - - prepares a tail call request for the specified metamethod, or null if no metamethod is found. - - - - - Gets the metamethod to be used for a binary operation using op1 and op2. - - - - - Gets the script object associated with this request - - - - - - Gets the coroutine which is performing the call - - - - - Calls a callback function implemented in "classic way". - Useful to port C code from Lua, or C# code from UniLua and KopiLua. - Lua : http://www.lua.org/ - UniLua : http://github.com/xebecnan/UniLua - KopiLua : http://github.com/NLua/KopiLua - - The arguments. - Name of the function - for error messages. - The callback. - - - - - Calls the specified function, supporting most cases. The called function must not yield. - - The function; it must be a Function or ClrFunction or have a call metamethod defined. - The arguments. - - If the function yields, returns a tail call request with continuations/handlers or, of course, if it encounters errors. - - - - Tries to get the reference of a symbol in the current execution state - - - - - Tries to get the value of a symbol in the current execution state - - - - - Finds a symbol by name in the current execution state - - - - - Performs a message decoration before unwinding after an error. To be used in the implementation of xpcall like functions. - - The message handler. - The exception. - - - - Gets a value indicating whether this instance is running a dynamic execution. - Under a dynamic execution, most methods of ScriptExecutionContext are not reliable as the - processing engine of the script is not "really" running or is not available. - - - - - Gets the location of the code calling back - - - - - Gets or sets the additional data associated to this CLR function call. - - - - - Gets the current global env, or null if not found. - - - - - Class representing the source code of a given script - - - - - Gets the code snippet represented by a source ref - - The source code reference. - - - - - Gets the name of the source code - - - - - Gets the source code as a string - - - - - Gets the source code lines. - - - - - Gets the script owning this resource. - - - - - Gets the source identifier inside a script - - - - - State of coroutines - - - - - This is the main coroutine - - - - - Coroutine has not started yet - - - - - Coroutine is suspended - - - - - Coroutine is running - - - - - Coroutine has terminated - - - - - Wrappers for enumerables as return types - - - - - LINQ helper methods - - - - - Converts the specified enumerable dynvalues of a given script type to objects of a given type - - The desired type - The enumerable. - The type. - - - - Filters an enumeration for items of the given script type - - The enumerable. - The script type. - - - - Converts the elements to CLR objects - - The enumerable. - - - - Converts the elements to CLR objects of the desired type - - The desired type - The enumerable. - - - - - - - - - Marks a type of automatic registration as userdata (which happens only if UserData.RegisterAssembly is called). - - - - - Initializes a new instance of the class. - - - - - The interop access mode - - - - - Forces a class member visibility to scripts. Can be used to hide public members or to expose non-public ones. - - - - - Initializes a new instance of the class. - - if set to true the member will be exposed to scripts, if false the member will be hidden. - - - - Gets a value indicating whether this is set to "visible". - - - - - Descriptor which acts as a non-containing adapter from IUserDataType to IUserDataDescriptor - - - - - Initializes a new instance of the class. - - The type. - Name of the friendly. - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Standard descriptor for userdata types. - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - The interop access mode this descriptor uses for members access - A human readable friendly name of the descriptor. - - - - Fills the member list. - - - - - Gets the interop access mode this descriptor uses for members access - - - - - Enumerations of the possible strategies to marshal CLR objects to MoonSharp userdata and functions - when using automatic descriptors. - Note that these are "hints" and MoonSharp is free to ignore the access mode specified (if different from - HideMembers) and downgrade the access mode to "Reflection". - This particularly happens when running on AOT platforms like iOS. - See also : and . - - - - - Optimization is not performed and reflection is used everytime to access members. - This is the slowest approach but saves a lot of memory if members are seldomly used. - - - - - Optimization is done on the fly the first time a member is accessed. - This saves memory for all members that are never accessed, at the cost of an increased script execution time. - - - - - Optimization is done at registration time. - - - - - Optimization is done in a background thread which starts at registration time. - If a member is accessed before optimization is completed, reflection is used. - - - - - No optimization is done, and members are not accessible at all. - - - - - No reflection is allowed, nor code generation. This is used as a safeguard when registering types which should not - use a standard reflection based descriptor - for example for types implementing - - - - - Use the default access mode - - - - - Class providing easier marshalling of CLR functions - - - - - Tries to create a new StandardUserDataMethodDescriptor, returning - null in case the method is not - visible to script code. - - The MethodBase. - The - if set to true forces visibility. - - A new StandardUserDataMethodDescriptor or null. - - - - - Initializes a new instance of the class. - - The MethodBase (MethodInfo or ConstructorInfo) got through reflection. - The interop access mode. - Invalid accessMode - - - - Checks if the method is compatible with a standard descriptor - - The MethodBase. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The method contains unresolved generic parameters, or has an unresolved generic return type - or - The method contains pointer parameters, or has a pointer return type - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function as a DynValue. - - The script for which the callback must be generated. - The object (null for static). - - - - - Creates a callback DynValue starting from a MethodInfo. - - The script. - The mi. - The object. - - - - - The internal callback which actually executes the method - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value. - - The script. - The object. - The v. - - - - - Gets the method information (can be a MethodInfo or ConstructorInfo) - - - - - Gets the access mode used for interop - - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - Gets a value indicating whether the described method is a constructor - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets the types of access supported by this member - - - - - Class providing easier marshalling of CLR properties - - - - - Tries to create a new StandardUserDataPropertyDescriptor, returning null in case the property is not - visible to script code. - - The PropertyInfo. - The - A new StandardUserDataPropertyDescriptor or null. - - - - Initializes a new instance of the class. - NOTE: This constructor gives get/set visibility based exclusively on the CLR visibility of the - getter and setter methods. - - The pi. - The access mode. - - - - Initializes a new instance of the class. - - The PropertyInfo. - The - The getter method. Use null to make the property writeonly. - The setter method. Use null to make the property readonly. - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Gets the PropertyInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance can be read from - - - true if this instance can be read from; otherwise, false. - - - - - Gets a value indicating whether this instance can be written to. - - - true if this instance can be written to; otherwise, false. - - - - - Gets the types of access supported by this member - - - - - The scope of a closure (container of upvalues) - - - - - Gets the symbols. - - - - - Enumeration of the types of SymbolRef - - - - - The symbol ref of a local variable - - - - - The symbol ref of an upvalue variable - - - - - The symbol ref of a global variable - - - - - The symbol ref of the global environment - - - - - This class stores a possible l-value (that is a potential target of an assignment) - - - - - Creates a new symbol reference pointing to a global var - - The name. - The _ENV symbol. - - - - - Creates a new symbol reference pointing to a local var - - The name. - The index of the var in local scope. - - - - - Creates a new symbol reference pointing to an upvalue var - - The name. - The index of the var in closure scope. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Writes this instance to a binary stream - - - - - Reads a symbolref from a binary stream - - - - - Gets the type of this symbol reference - - - - - Gets the index of this symbol in its scope context - - - - - Gets the name of this symbol - - - - - Gets the environment this symbol refers to (for global symbols only) - - - - - Gets the default _ENV. - - - - - Enumeration of possible data types in MoonSharp - - - - - A nil value, as in Lua - - - - - A place holder for no value - - - - - A Lua boolean - - - - - A Lua number - - - - - A Lua string - - - - - A Lua function - - - - - A Lua table - - - - - A set of multiple values - - - - - A userdata reference - that is a wrapped CLR object - - - - - A coroutine handle - - - - - A callback function - - - - - A request to execute a tail call - - - - - A request to coroutine.yield - - - - - Extension methods to DataType - - - - - Determines whether this data type can have type metatables. - - The type. - - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function, with additional values - to support debuggers - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - A script loader loading scripts from an assembly resources - - - - - A base implementation of IScriptLoader, offering resolution of module names. - - - - - Class dictating how requests to read scripts from files are handled. - - It's recommended that no class implement IScriptLoader directly, and rather extend ScriptLoaderBase. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile) - - The modname. - The global context. - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves the name of a module on a set of paths. - - The modname. - The paths. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable (if and only if - the IgnoreLuaPathGlobal is false), and - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - Unpacks a string path in a form like "?;?.lua" to an array - - - - - Gets the default environment paths. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Gets or sets the modules paths used by the "require" function. If null, the default paths are used (using - environment variables etc.). - - - - - Gets or sets a value indicating whether the LUA_PATH global is checked or not to get the path where modules are contained. - If true, the LUA_PATH global is NOT checked. - - - - - Initializes a new instance of the class. - - The assembly containing the scripts as embedded resources or null to use the calling assembly. - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader used for platforms we cannot initialize in any better way.. - - - - - An implementation of which supports a very basic history of recent input lines. - - - - - This class provides a simple REPL intepreter ready to be reused in a simple way. - - - - - Initializes a new instance of the class. - - The script. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - This method returns the result of the computation, or null if more input is needed for a computation. - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "?" as a - dynamic expression to evaluate instead of script code (likely invalid) - - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "=" as a - non-dynamic expression to evaluate (just like the Lua interpreter does by default). - - - - - Gets a value indicating whether this instance has a pending command - - - - - Gets the current pending command. - - - - - Gets the classic prompt (">" or ">>") given the current state of the interpreter - - - - - Initializes a new instance of the class. - - The script. - Size of the history. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - - This method returns the result of the computation, or null if more input is needed for a computation. - - - - - Gets the previous item in history, or null - - - - - Gets the next item in history, or null - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - AND starts with module paths taken from environment variables (again, not going through the platform object). - - The paths are preconstructed using : - * The MOONSHARP_PATH environment variable if it exists - * The LUA_PATH_5_2 environment variable if MOONSHARP_PATH does not exists - * The LUA_PATH environment variable if LUA_PATH_5_2 and MOONSHARP_PATH do not exists - * The "?;?.lua" path if all the above fail - - Also, everytime a module is require(d), the "LUA_PATH" global variable is checked. If it exists, those paths - will be used to load the module instead of the global ones. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable, and - - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - A script loader which can load scripts from assets in Unity3D. - Scripts should be saved as .txt files in a subdirectory of Assets/Resources. - - When MoonSharp is activated on Unity3D and the default script loader is used, - scripts should be saved as .txt files in Assets/Resources/MoonSharp/Scripts. - - - - - The default path where scripts are meant to be stored (if not changed) - - - - - Initializes a new instance of the class. - - The path, relative to Assets/Resources. For example - if your scripts are stored under Assets/Resources/Scripts, you should - pass the value "Scripts". If null, "MoonSharp/Scripts" is used. - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - UnityAssetsScriptLoader.LoadFile : Cannot load + file - - - - Checks if a given file exists - - The file. - - - - - Gets the list of loaded scripts filenames (useful for debugging purposes). - - - - - - In a module type, mark fields with this attribute to have them exposed as a module constant. - - See for more information about modules. - - - - - Gets or sets the name of the constant - if different from the name of the field itself - - - - - Namespace containing all the most commonly used classes for MoonSharp operation. - When in doubt, refer to and classes as starting points. - - - - - Namespace containing the implementation of the Lua standard library, as MoonSharp modules. - There's seldom the need to access these classes directly. - - - - - Namespace containing userdata classes for the 'io' module - - - - - Namespace containing classes used to support debuggers - - - - - Namespace containing classes used to support self diagnostics (e.g. performance counters) - - - - - Namespace containing classes used to customize and support advanced interoperations between - scripts and CLR code. - - - - - Namespace containing classes used to provide a minimal support for porting code based on the classic - "LuaState" model (e.g. code based on KopiLua, UniLua or Lua itself). - - - - - Namespace containing classes used to customized how scripts are loaded from external files. - - - - - Namespace containing classes used to customize how the interfacing with the operative system happens - for the 'os' and 'io' modules, and for future modules/classes which may require OS access. - See and . - - - - - Contains classes useful to implement REPL interpreters. - See : - - - - - Interface to abstract all accesses made to the underlying platform (OS, framework) by the scripting engine. - Can be used both to support "non-standard" platforms (i.e. non-posix, non-windows) and/or to sandbox the behaviour - of the scripting engine. - - It's recommended that no class implement IPlatformAccessor directly, and rather extend . - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - Gets the name of the platform (used for debug purposes). - - The name of the platform (used for debug purposes) - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If a meaningful implementation cannot be provided, this method should return null. - - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - The script. - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - True if the file exists, false otherwise. - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - An abstract class which offers basic services on top of IPlatformAccessor to provide easier implementation of platforms. - - - - - Gets the platform name prefix - - - - - - Gets the name of the platform (used for debug purposes). - - - The name of the platform (used for debug purposes) - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - DEPRECATED. - This is kept for backward compatibility, see the overload taking a prompt as an input parameter. - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - A static class offering properties for autodetection of system/platform details - - - - - Gets a value indicating whether this instance is running on mono. - - - - - Gets a value indicating whether this instance is running on a CLR4 compatible implementation - - - - - Gets a value indicating whether this instance is running on Unity-3D - - - - - Gets a value indicating whether this instance has been built as a Portable Class Library - - - - - Gets a value indicating whether this instance is running a system using Ahead-Of-Time compilation - and not supporting JIT. - - - - - A class implementing all the bits needed to have a minimal support of a platform. - This does not support the 'io'/'file' modules and has partial support of the 'os' module. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - A function used to open files in the 'io' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a standard stream (stdin, stdout, stderr). - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The type. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Exits the process, returning the specified exit code. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The exit code. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Checks if a file exists. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - - True if the file exists, false otherwise. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Deletes the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Moves the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The source. - The DST. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The cmdline. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets the platform name prefix - - - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - - Enumeration of standard file handles - - - - - Standard Input - - - - - Standard Output - - - - - Standard Error Output - - - - - Class providing the IPlatformAccessor interface for standard full-feaured implementations. - - - - - Converts a Lua string access mode to a FileAccess enum - - The mode. - - - - - Converts a Lua string access mode to a ParseFileMode enum - - The mode. - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - type - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets the platform name prefix - - - - - - - This class implements a MoonSharp scripting session. Multiple Script objects can coexist in the same program but cannot share - data among themselves unless some mechanism is put in place. - - - - - The version of the MoonSharp engine - - - - - The Lua version being supported - - - - - Initializes the class. - - - - - Initializes a new instance of the clas.s - - - - - Initializes a new instance of the class. - - The core modules to be pre-registered in the default global table. - - - - Loads a string containing a Lua/MoonSharp function. - - The code. - The global table to bind to this chunk. - Name of the function used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a Lua/MoonSharp script from a System.IO.Stream. NOTE: This will *NOT* close the stream! - - The stream containing code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Dumps on the specified stream. - - The function. - The stream. - - function arg is not a function! - or - stream is readonly! - or - function arg has upvalues other than _ENV - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - The filename to be used in error messages. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads and executes a string containing a Lua/MoonSharp script. - - The code. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a stream containing a Lua/MoonSharp script. - - The stream. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a file containing a Lua/MoonSharp script. - - The filename. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Runs the specified file with all possible defaults for quick experimenting. - - The filename. - A DynValue containing the result of the processing of the executed script. - - - - Runs the specified code with all possible defaults for quick experimenting. - - The Lua/MoonSharp code. - A DynValue containing the result of the processing of the executed script. - - - - Creates a closure from a bytecode address. - - The address. - The env table to create a 0-upvalue - - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Gets the main chunk function. - - A DynValue containing a function which executes the first chunk that has been loaded. - - - - Attaches a debugger. This usually should be called by the debugger itself and not by user code. - - The debugger object. - - - - Gets the source code. - - The source code identifier. - - - - - Loads a module as per the "require" Lua function. http://www.lua.org/pil/8.1.html - - The module name - The global context. - - Raised if module is not found - - - - Gets a type metatable. - - The type. - - - - - Sets a type metatable. - - The type. Must be Nil, Boolean, Number, String or Function - The metatable. - Specified type not supported : + type.ToString() - - - - Warms up the parser/lexer structures so that MoonSharp operations start faster. - - - - - Creates a new dynamic expression. - - The code of the expression. - - - - - Creates a new dynamic expression which is actually quite static, returning always the same constant value. - - The code of the not-so-dynamic expression. - The constant to return. - - - - - Gets an execution context exposing only partial functionality, which should be used for - those cases where the execution engine is not really running - for example for dynamic expression - or calls from CLR to CLR callbacks - - - - - Gets or sets the script loader which will be used as the value of the - ScriptLoader property for all newly created scripts. - - - - - Gets access to the script options. - - - - - Gets the global options, that is options which cannot be customized per-script. - - - - - Gets access to performance statistics. - - - - - Gets the default global table for this script. Unless a different table is intentionally passed (or setfenv has been used) - execution uses this table. - - - - - Gets the source code count. - - - The source code count. - - - - - MoonSharp (like Lua itself) provides a registry, a predefined table that can be used by any CLR code to - store whatever Lua values it needs to store. - Any CLR code can store data into this table, but it should take care to choose keys - that are different from those used by other libraries, to avoid collisions. - Typically, you should use as key a string GUID, a string containing your library name, or a - userdata with the address of a CLR object in your code. - - - - - A class representing a Lua table. - - - - - Initializes a new instance of the class. - - The owner script. - - - - Removes all items from the Table. - - - - - Gets the integral key from a double. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) - - The key. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) as a System.Object. - - The key. - - - - - Sets the dynvalue associated with the specified key. Both expressed as System.Object. - - The key. - The value. - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Gets the value associated with the specified key, without bringing to Nil the non-existant values. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Collects the dead keys. This frees up memory but invalidates pending iterators. - It's called automatically internally when the semantics of Lua tables allow, but can be forced - externally if it's known that no iterators are pending. - - - - - Returns the next pair from a value - - - - - Gets the script owning this resource. - - - - - Gets or sets the - with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - Multiple keys can be used to access subtables. - - - The . - - The key. - Optional subkeys to access subtables - - - - - Gets or sets the with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - - - The . - - The key. - - - - - Gets the length of the "array part". - - - - - Gets the meta-table associated with this instance. - - - - - Enumerates the key/value pairs. - - - - - - Enumerates the keys. - - - - - - Enumerates the values - - - - - - A preallocated, non-resizable, stack - - - - - - Enumeration (combinable as flags) of all the standard library modules - - - - - Value used to specify no modules to be loaded (equals 0). - - - - - The basic methods. Includes "assert", "collectgarbage", "error", "print", "select", "type", "tonumber" and "tostring". - - - - - The global constants: "_G", "_VERSION" and "_MOONSHARP". - - - - - The table iterators: "next", "ipairs" and "pairs". - - - - - The metatable methods : "setmetatable", "getmetatable", "rawset", "rawget", "rawequal" and "rawlen". - - - - - The string package - - - - - The load methods: "load", "loadsafe", "loadfile", "loadfilesafe", "dofile" and "require" - - - - - The table package - - - - - The error handling methods: "pcall" and "xpcall" - - - - - The math package - - - - - The coroutine package - - - - - The bit32 package - - - - - The time methods of the "os" package: "clock", "difftime", "date" and "time" - - - - - The methods of "os" package excluding those listed for OS_Time. These are not supported under Unity. - - - - - The methods of "io" and "file" packages. These are not supported under Unity. - - - - - The "debug" package (it has limited support) - - - - - The "dynamic" package (introduced by MoonSharp). - - - - - A sort of "hard" sandbox preset, including string, math, table, bit32 packages, constants and table iterators. - - - - - A softer sandbox preset, adding metatables support, error handling, coroutine, time functions and dynamic evaluations. - - - - - The default preset. Includes everything except "debug" as now. - Beware that using this preset allows scripts unlimited access to the system. - - - - - The complete package. - Beware that using this preset allows scripts unlimited access to the system. - - - - - Class managing modules (mostly as extension methods) - - - - - Register the core modules to a table - - The table. - The modules. - - - - - Registers the standard constants (_G, _VERSION, _MOONSHARP) to a table - - The table. - - - - - Registers a module type to the specified table - - The table. - The type - - If the module contains some incompatibility - - - - Registers a module type to the specified table - - The module type - The table. - - If the module contains some incompatibility - - - - In a module type, mark methods or fields with this attribute to have them exposed as module functions. - Methods must have the signature "public static DynValue ...(ScriptExecutionContextCallbackArguments)". - Fields must be static or const strings, with an anonymous Lua function inside. - - See for more information about modules. - - - - - Gets or sets the name of the function in the module (defaults to member name) - - - - - Marks a CLR type to be a MoonSharp module. - Modules are the fastest way to bring interop between scripts and CLR code, albeit at the cost of a very increased - complexity in writing them. Modules is what's used for the standard library, for maximum efficiency. - - Modules are basically classes containing only static methods, with the callback function signature. - - See and for (extension) methods used to register modules to a - table. - - See for information regarding the standard callback signature along with easier ways - to marshal methods. - - See for easier object marshalling. - - - - - Gets or sets the namespace, that is the name of the table which will contain the defined functions. - Can be null to be in the global table. - - - - - Class containing script global options, that is options which cannot be customized per-script. - - - - - - Gets or sets the custom converters. - - - - - Gets or sets the platform abstraction to use. - - - The current platform abstraction. - - - - - This class contains options to customize behaviour of Script objects. - - - - - Gets or sets the current script-loader. - - - - - Gets or sets the debug print handler - - - - - Gets or sets the debug input handler (takes a prompt as an input, for interactive interpreters, like debug.debug). - - - - - Gets or sets a value indicating whether error messages will use Lua error locations instead of MoonSharp - improved ones. Use this for compatibility with legacy Lua code which parses error messages. - - - - - Gets or sets the stream used as stdin. If null, a default stream is used. - - - - - Gets or sets the stream used as stdout. If null, a default stream is used. - - - - - Gets or sets the stream used as stderr. If null, a default stream is used. - - - - - Gets or sets the stack depth threshold at which MoonSharp starts doing - tail call optimizations. - TCOs can provide the little benefit of avoiding stack overflows in corner case - scenarios, at the expense of losing debug information and error stack traces - in all other, more common scenarios. MoonSharp choice is to start performing - TCOs only after a certain threshold of stack usage is reached - by default - half the current stack depth (128K entries), thus 64K entries, on either - the internal stacks. - Set this to int.MaxValue to disable TCOs entirely, or to 0 to always have - TCOs enabled. - - - - - Gets or sets a value indicating whether the thread check is enabled. - A "lazy" thread check is performed everytime execution is entered to ensure that no two threads - calls MoonSharp execution concurrently. However 1) the check is performed best effort (thus, it might - not detect all issues) and 2) it might trigger in very odd legal situations (like, switching threads - inside a CLR-callback without actually having concurrency. - - Disable this option if the thread check is giving problems in your scenario, but please check that - you are not calling MoonSharp execution concurrently as it is not supported. - - - - - Primaries the exp. - - The lcontext. - - - - - - - - - - Creates a sub tree of binary expressions - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/portable-net4+sl5+wp8+win8/MoonSharp.Interpreter.xml b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/portable-net4+sl5+wp8+win8/MoonSharp.Interpreter.xml deleted file mode 100644 index 51902bef..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.0.9.4.0/lib/portable-net4+sl5+wp8+win8/MoonSharp.Interpreter.xml +++ /dev/null @@ -1,6529 +0,0 @@ - - - - MoonSharp.Interpreter - - - - - Class implementing coroutine Lua functions - - - - - Class implementing basic Lua functions (print, type, tostring, etc) as a MoonSharp module. - - - - - Class implementing debug Lua functions. Support for the debug module is partial. - - - - - Class implementing dynamic expression evaluations at runtime (a MoonSharp addition). - - - - - Class implementing error handling Lua functions (pcall and xpcall) - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - Abstract class implementing a file Lua userdata. Methods are meant to be called by Lua code. - - - - - A base class for many MoonSharp objects. - Helds a ReferenceID property which gets a different value for every object instance, for debugging - purposes. Note that the ID is not assigned in a thread safe manner for speed reason, so the IDs - are guaranteed to be unique only if everything is running on one thread at a time. - - - - - Formats a string with a type name and a ref-id - - The type name. - - - - - Gets the reference identifier. - - - The reference identifier. - - - - - Class implementing io Lua functions. Proper support requires a compatible IPlatformAccessor - - - - - Abstract class implementing an unclosable file Lua userdata. Methods are meant to be called by Lua code. - - - - - Class implementing loading Lua functions like 'require', 'load', etc. - - - - - Class implementing bit32 Lua functions - - - - - Class implementing math Lua functions - - - - - Class implementing metatable related Lua functions (xxxmetatable and rawxxx). - - - - - Class implementing system related Lua functions from the 'os' module. - Proper support requires a compatible IPlatformAccessor - - - - - Class implementing time related Lua functions from the 'os' module. - - - - - Classes using the classic interface should inherit from this class. - This class defines only static methods and is really meant to be used only - from C# and not other .NET languages. - - For easier operation they should also define: - using ptrdiff_t = System.Int32; - using lua_Integer = System.Int32; - using LUA_INTFRM_T = System.Int64; - using UNSIGNED_LUA_INTFRM_T = System.UInt64; - - - - - Calls a function. - To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, - the arguments to the function are pushed in direct order; that is, the first argument is pushed first. Finally you call - lua_call; nargs is the number of arguments that you pushed onto the stack. All arguments and the function value are - popped from the stack when the function is called. The function results are pushed onto the stack when the function - returns. The number of results is adjusted to nresults, unless nresults is LUA_MULTRET. In this case, all results from - the function are pushed. Lua takes care that the returned values fit into the stack space. The function results are - pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on - the top of the stack. - - The LuaState - The number of arguments. - The number of expected results. - - - - - A Dictionary where multiple values can be associated to the same key - - The key type - The value type - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The equality comparer to use in the underlying dictionary. - - - - Adds the specified key. Returns true if this is the first value for a given key - - The key. - The value. - - - - - Finds all the values associated with the specified key. - An empty collection is returned if not found. - - The key. - - - - Determines whether this contains the specified key - - The key. - - - - Clears this instance. - - - - - Removes the specified key and all its associated values from the multidictionary - - The key. - - - - Removes the value. Returns true if the removed value was the last of a given key - - The key. - The value. - - - - - Gets the keys. - - - - - Implementation of IEqualityComparer enforcing reference equality - - - - - Marks a method as the handler of metamethods of a userdata type - - - - - Initializes a new instance of the class. - - The metamethod name (like '__div', '__ipairs', etc.) - - - - The metamethod name (like '__div', '__ipairs', etc.) - - - - - Base interface to describe access to members of a given type. - While it's not infrastructural to implement custom type descriptors, it's needed for - classes extending . - - - - - Gets the value of this member as a to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value of this member as a . - - - - Sets the value of this member from a . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Extension methods for and . - - - - - Determines whether the specified MemberDescriptorAccess has ALL the specified flags. - - The access. - The flag. - - - - - Determines whether this instance can be read - - The descriptor instance. - - - - - Determines whether this instance can be written to - - The descriptor instance. - - - - - Determines whether this instance can be executed (called as a function) - - The descriptor instance. - - - - - Gets the getter of the member as a DynValue containing a callback - - The descriptor instance. - The script. - The object. - - - - - Returns the specified descriptor if it supports all the specified access modes, otherwise returns null. - - The descriptor instance. - The access mode(s). - - - - - Raises an appropriate ScriptRuntimeException if the specified access is not supported. - Checks are made for the MemberDescriptorAccess permissions AND for the access of instance - members through static userdatas. - - The desc. - The access. - The object to be checked for access. - - - - Interface for descriptors of any kind which support optimizations of their implementation according to InteropAccessMode - modes. This should seldom - if ever - be implemented in user code. - - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Specialized for members supporting overloads resolution. - - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Permissions for members access - - - - - The member can be read from - - - - - The member can be written to - - - - - The can be invoked - - - - - Descriptor of parameters used in implementations. - - - - - If the type got restricted, the original type before the restriction. - - - - - Initializes a new instance of the class. - - The name. - The type. - if set to true the parameter has default value. - The default value. - if set to true, is an out param. - - - - Initializes a new instance of the class. - - A ParameterInfo taken from reflection. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Restricts the type of this parameter to a tighter constraint. - Restrictions must be applied before the containing this - parameter is used in any way. - - The new type. - - Cannot restrict a ref/out param - or - Specified operation is not a restriction - - - - - Gets the name of the parameter - - - - - Gets the type of the parameter - - - - - Gets a value indicating whether this instance has a default value. - - - - - Gets the default value - - - - - Gets a value indicating whether this instance is an out parameter - - - - - Gets a value indicating whether this instance has been restricted. - - - - - Gets the original type of the parameter before any restriction has been applied. - - - - - Tries to convert a CLR object to a MoonSharp value, using "simple" logic. - Does NOT throw on failure. - - - - - Tries to convert a CLR object to a MoonSharp value, using more in-depth analysis - - - - - Converts an IEnumerable or IEnumerator to a DynValue - - The script. - The object. - - - - - Static functions to handle conversions of numeric types - - - - - HashSet of numeric types - - - - - Array of numeric types in order used for some conversions - - - - - Converts a double to another type - - - - - Converts a type to double - - - - - Converts a DynValue to a CLR object [simple conversion] - - - - - Converts a DynValue to a CLR object of a specific type - - - - - Gets a relative weight of how much the conversion is matching the given types. - Implementation must follow that of DynValueToObjectOfType.. it's not very DRY in that sense. - However here we are in perf-sensitive path.. TODO : double-check the gain and see if a DRY impl is better. - - - - - Converts an IList to a Lua table. - - - - - Converts an IDictionary to a Lua table. - - - - - Determines whether the specified table can be converted to the specified type - - The table. - The type. - - - - - Converts a table to a CLR object of a given type - - - - - Converts a table to a - - - - - Converts a table to a T[] - - - - - Converts a table to a - - - - - Converts a table to a , known in advance - - - - - Converts a table to a Dictionary, known in advance - - - - - A collection of custom converters between MoonSharp types and CLR types. - If a converter function is not specified or returns null, the standard conversion path applies. - - - - - Sets a custom converter from a script data type to a CLR data type. Set null to remove a previous custom converter. - - The script data type - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a script data type to a CLR data type, or null - - The script data type - The CLR data type. - The converter function, or null if not found - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Sets a custom converter from a CLR data type. Set null to remove a previous custom converter. - - The CLR data type. - The converter, or null. - - - - Gets a custom converter from a CLR data type, or null - - Type of the color data. - The converter function, or null if not found - - - - Removes all converters. - - - - - Helper extension methods used to simplify some parts of userdata descriptor implementations - - - - - Determines whether a - is changing visibility of a member - to scripts. - - The member to check. - - true if visibility is forced visible, - false if visibility is forced hidden or the specified MemberInfo is null, - if no attribute was found - - - - - Determines whether the specified PropertyInfo is visible publicly (either the getter or the setter is public). - - The PropertyInfo. - - - - - Gets the list of metamethod names from attributes - in practice the list of metamethods declared through - . - - The mi. - - - - - Gets the name of a conversion method to be exposed to Lua scripts - - The type. - - - - - An abstract user data descriptor which accepts members described by objects and - correctly dispatches to them. - Metamethods are also by default dispatched to operator overloads and other similar methods - see - . - - - - - Interface used by MoonSharp to access objects of a given type from scripts. - - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - The special name used by CLR for indexer getters - - - - - The special name used by CLR for indexer setters - - - - - The special name used by CLR for explicit cast conversions - - - - - The special name used by CLR for implicit cast conversions - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - A friendly name for the type, or null. - - - - Adds a member to the meta-members list. - - The name of the metamethod. - The desc. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Adds a DynValue as a member - - The name. - The value. - - - - Adds a property to the member list - - The name. - The descriptor. - - Thrown if a name conflict is detected and one of the conflicting members does not support overloads. - - - - - Performs an "index" "get" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing operation by checking newly added extension methods for the given indexName. - - The script. - The object. - Member name to be indexed. - - - - - - Determines whether the descriptor contains the specified member (by exact name) - - Name of the member. - - - - - Determines whether the descriptor contains the specified member in the meta list (by exact name) - - Name of the meta-member. - - - - - Tries to perform an indexing operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - - - - - Performs an "index" "set" operation. This tries to resolve minor variations of member names. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Tries to perform an indexing "set" operation by checking methods and properties for the given indexName - - The script. - The object. - Member name to be indexed. - The value. - - - - - Converts the specified name from underscore_case to camelCase. - - The name. - - - - - Converts the specified name to one with an uppercase first letter (something to Something). - - The name. - - - - - Converts this userdata to string - - The object. - - - - - Executes the specified indexer method. - - The method descriptor - The script. - The object. - The indexer parameter - The dynvalue to set on a setter, or null. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - See for further details. - - If a method exists marked with for the specific - metamethod requested, that method is returned. - - If the above fails, the following dispatching occur: - - __add, __sub, __mul, __div, __mod and __unm are dispatched to C# operator overloads (if they exist) - __eq is dispatched to System.Object.Equals. - __lt and __le are dispatched IComparable.Compare, if the type implements IComparable or IComparable{object} - __len is dispatched to Length and Count properties, if those exist. - __iterator is handled if the object implements IEnumerable or IEnumerator. - __tonumber is dispatched to implicit or explicit conversion operators to standard numeric types. - __tobool is dispatched to an implicit or explicit conversion operator to bool. If that fails, operator true is used. - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Gets a human readable friendly name of the descriptor - - - - - Standard descriptor for Enum values - - - - - Initializes a new instance of the class. - - Type of the enum. - Name of the friendly. - enumType must be an enum! - - - - Fills the member list. - - - - - Adds an enum method to the object - - The name. - The dyn value. - - - - Gets the value of the enum as a long - - - - - Gets the value of the enum as a ulong - - - - - Creates an enum value from a long - - - - - Creates an enum value from a ulong - - - - - Creates conversion functions for signed enums - - - - - Creates conversion functions for unsigned enums - - - - - Determines whether the specified object is compatible with the specified type. - - The type. - The object. - - - - - Gets a "meta" operation on this userdata. - In this specific case, only the concat operator is supported, only on flags enums and it implements the - 'or' operator. - - - - - - - - - Gets the underlying type of the enum. - - - - - Gets a value indicating whether underlying type of the enum is unsigned. - - - - - Gets a value indicating whether this instance describes a flags enumeration. - - - - - Class providing a simple descriptor for constant DynValues in userdata - - - - - Initializes a new instance of the class. - - The name. - The value. - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - userdata '{0}' cannot be written to. - - - - Gets a value indicating whether the described member is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - Gets the value wrapped by this descriptor - - - - - Class providing easier marshalling of CLR events. Handling is limited to a narrow range of handler signatures, which, - however, covers in practice most of all available events. - - - - - The maximum number of arguments supported in an event handler delegate - - - - - Tries to create a new StandardUserDataEventDescriptor, returning null in case the method is not - visible to script code. - - The EventInfo. - The - A new StandardUserDataEventDescriptor or null. - - - - Checks if the event is compatible with a standard descriptor - - The EventInfo. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The event is declared in a value type - or - The event does not have both add and remove methods - or - The event handler type doesn't implement a public Invoke method - or - The event handler has a return type which is not System.Void - or - The event handler has more than MAX_ARGS_IN_DELEGATE parameters - or - The event handler has a value type parameter or a by ref parameter - or - The event handler signature is not a valid method according to - - - - - Initializes a new instance of the class. - - The ei. - The access mode. - - - - Gets a dynvalue which is a facade supporting add/remove methods which is callable from scripts - - The script. - The object for which the facade should be written. - - - - - Sets the value. - - The script. - The object. - The v. - - - - Gets the EventInfo object of the event described by this descriptor - - - - - Gets a value indicating whether the event described by this descriptor is static. - - - - - Gets the name of the member - - - - - Gets the types of access supported by this member - - - - - As a convenience, every type deriving from IUserDataType is "self-described". That is, no descriptor is needed/generated - and the object itself is used to describe the type for interop. See also , - and . - - - - - Performs an "index" "get" operation. - - The script originating the request - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - - The script originating the request - The name of the metamember. - - - - - Class providing easier marshalling of overloaded CLR functions - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptor of the first overloaded method. - - - - Initializes a new instance of the class. - - The name. - The declaring type. - The descriptors of the overloaded methods. - - - - Sets the extension methods snapshot. - - The version. - The ext methods. - - - - Adds an overload. - - The overload. - - - - Performs the overloaded call. - - The script. - The object. - The context. - The arguments. - - function call doesn't match any overload - - - - Calculates the score for the overload. - - The context. - The arguments. - The method. - if set to true, is an extension method. - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a . - - The script. - The object owning this member, or null if static. - The value to be set. - - - - - Gets or sets a value indicating whether this instance ignores extension methods. - - - - - Gets the name of the first described overload - - - - - Gets the name of the first described overload - - - - - Gets the number of overloaded methods contained in this collection - - - The overload count. - - - - - Gets a value indicating whether there is at least one static method in the resolution list - - - - - - Gets the types of access supported by this member - - - - - Comparer class for IOverloadableMemberDescriptor - - - - - Class providing easier marshalling of CLR fields - - - - - Tries to create a new StandardUserDataFieldDescriptor, returning null in case the field is not - visible to script code. - - The FieldInfo. - The - A new StandardUserDataFieldDescriptor or null. - - - - Initializes a new instance of the class. - - The FieldInfo. - The - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Gets the FieldInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance is a constant - - - - - Gets a value indicating whether this instance is readonly - - - - - Gets the types of access supported by this member - - - - - Member descriptor for the default constructor of value types. - - - - - Initializes a new instance of the - class - representing the default empty ctor for a value type. - - Type of the value. - valueType is not a value type - - - - Invokes the member from script. - Implementors should raise exceptions if the value cannot be executed or if access to an - instance member through a static userdata is attempted. - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a - to be exposed to scripts. - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value of this member from a - . - Implementors should raise exceptions if the value cannot be read or if access to an - instance member through a static userdata is attempted. - - The script. - The object owning this member, or null if static. - The value to be set. - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - This property is equal to the value type to be constructed. - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the types of access supported by this member - - - - - "Optimized" BinaryReader which shares strings and use a dumb compression for integers - - - - - "Optimized" BinaryWriter which shares strings and use a dumb compression for integers - - - - - An adapter over Stream which bypasses the Dispose and Close methods. - Used to work around the pesky wrappers .NET has over Stream (BinaryReader, StreamWriter, etc.) which think they - own the Stream and close them when they shouldn't. Damn. - - - - - Enumerations of the possible policies to handle UserData type registrations - See also : . - - - - - Types must be explicitly registered. If a base type or interface is registered, that is used. - - - - - Types are automatically registered if not found in the registry. This is easier to use but potentially unsafe. - - - - - A Delegate type which can wrap a script function - - The arguments. - The return value of the script function - - - - A Delegate type which can wrap a script function with a generic typed return value - - - The arguments. - The return value of the script function - - - - Flags to alter the way the DynValue.CheckType and other related functions operate on data types for - validation. - - - - - No type validation specific behaviour - - - - - Nil and Void values are allowed (and returned by the call) - - - - - Simple autoconversions are attempted: - 1) Numbers are convertible to strings - 2) Strings are convertible to numbers if they contain a number - 3) Everything is convertible to boolean (with void and nil converting to 'false', everything else converting to 'true') - Note: if both AutoConvert and AllowNil are specified, nils will NOT be converted to false booleans. - - - - - The default : Autoconverting values, no nils. - - - - - Exception thrown when a dynamic expression is invalid - - - - - Exception for all runtime errors. In addition to constructors, it offers a lot of static methods - generating more "standard" Lua errors. - - - - - Base type of all exceptions thrown in MoonSharp - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Gets the instruction pointer of the execution (if it makes sense) - - - - - Gets the interpreter call stack. - - - - - Gets the decorated message (error message plus error location in script) if possible. - - - - - Initializes a new instance of the class. - - The ex. - - - - Initializes a new instance of the class. - - The message that describes the error. - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an arithmetic operation was attempted on non-numbers - - The left operand. - The right operand (or null). - The exception to be raised. - If both are numbers - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a concat operation was attempted on non-strings - - The left operand. - The right operand. - The exception to be raised. - If both are numbers or strings - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a len operator was applied on an invalid operand - - The operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a comparison operator was applied on an invalid combination of operand types - - The left operand. - The right operand. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The error message. - The exception to be raised. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad userdata argument - - The argument number (0-based). - Name of the function generating this error. - The expected System.Type. - The object which was used. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - The data type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a bad argument - - The argument number (0-based). - Name of the function generating this error. - The expected type description. - The description of the type received. - True if nils were allowed in this call. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - - This function creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - while creates a message like "bad argument #xxx to 'yyy' (value expected)" - - The argument number (0-based). - Name of the function generating this error. - The expected data type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an out of range index was specified - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with a negative number when a positive one was expected. - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a function was called with no value when a value was required. - This function creates a message like "bad argument #xxx to 'yyy' (value expected)" - while creates a message like "bad argument #xxx to 'yyy' (zzz expected, got no value)" - - The argument number (0-based). - Name of the function generating this error. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an invalid attempt to index the specified object was made - - The object. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __index over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __newindex over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a loop was detected when performing __call over metatables. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used nil as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a table indexing operation used a NaN as the key. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion to number failed. - - - Selects the correct error message: - 0 - "value must be a number" - 1 - "'for' initial value must be a number" - 2 - "'for' step must be a number" - 3 - "'for' limit must be a number" - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a CLR type to a Lua type has failed. - - The object which could not be converted. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a conversion of a Lua type to a CLR type has failed. - - The Lua type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a constrained conversion of a Lua type to a CLR type has failed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - a userdata of a specific CLR type was expected and a non-userdata type was passed. - - The Lua type. - The expected CLR type. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to index an invalid member of a userdata was done. - - The name of the userdata type. - The field name. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt resume a coroutine in an invalid state was done. - - The state of the coroutine. - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield across a CLR boundary was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to yield from the main coroutine was made. - - - The exception to be raised. - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to call a non-function was made - - The lua non-function data type. - The debug text to aid location (appears as "near 'xxx'"). - - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The member descriptor. - - - - Creates a ScriptRuntimeException with a predefined error message specifying that - an attempt to access a non-static member from a static userdata was made - - The type descriptor. - The member descriptor. - - - - - Gets or sets a value indicating whether the message should not be decorated - - - - - Initializes a new instance of the class. - - The format. - The arguments. - - - - Initializes a new instance of the class. - - The message. - - - - Represents a dynamic expression in the script - - - - - Common interface for all resources which are uniquely bound to a script. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - The code which generated this expression - - - - - Evaluates the expression - - The context. - - - - - Finds a symbol in the expression - - The context. - - - - - Determines whether this instance is a constant expression - - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - Internal type used by for registration - - - - - Wrapper which allows for easier management of userdata without registering a new userdata type - useful - if a type which is not exposed to scripts but can be managed as a "black box" by scripts is desired. - - The type to wrap - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The o. - - - - Gets or sets the value this instance wraps. - - - - - Determines whether the specified value is of numeric type. - - The object to check. - - true if o is a numeric type; otherwise, false. - - - - - Determines whether the specified value is positive. - - The value. - if set to true treats 0 as positive. - - true if the specified value is positive; otherwise, false. - - - - - Converts the specified values boxed type to its correpsonding unsigned - type. - - The value. - A boxed numeric object whos type is unsigned. - - - - Converts the specified values boxed type to its correpsonding integer - type. - - The value. - if set to true [round]. - - A boxed numeric object whos type is an integer type. - - - - - Replaces the string representations of meta chars with their corresponding - character values. - - The input. - A string with all string meta chars are replaced - - - - Class implementing string Lua functions - - - - - Class implementing table Lua iterators (pairs, ipairs, next) - - - - - Class implementing table Lua functions - - - - - Class exposing table.unpack and table.pack in the global namespace (to work around the most common Lua 5.1 compatibility issue). - - - - - Extension methods used in the whole project. - - - - - Gets a value from the dictionary or returns the default value - - The type of the key. - The type of the value. - The dictionary. - The key. - - - - - Gets a value from the dictionary or creates it - - The type of the key. - The type of the value. - The dictionary. - The key. - A function which will create the value if it doesn't exist. - - - - - A non preallocated, non_fixed size stack - - - - - - An index to accelerate operations on a LinkedList using a single key of type - More than one LinkedListIndex can index the same linked list, but every node in the linked list must be indexed by one and only one - LinkedListIndex object. - - The type of the key. Must implement Equals and GetHashCode appropriately. - The type of the values contained in the linked list. - - - - Initializes a new instance of the class. - - The linked list to be indexed. - - - - Finds the node indexed by the specified key, or null. - - The key. - - - - Updates or creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - The previous value of the element - - - - Creates a new node in the linked list, indexed by the specified key. - - The key. - The value. - - - - Removes the specified key from the index, and the node indexed by the key from the linked list. - - The key. - - - - Determines whether the index contains the specified key. - - The key. - - - - Clears this instance (removes all elements) - - - - - Provides facility to create a "sliced" view over an existing IList - - The type of the items contained in the collection - - - - Initializes a new instance of the class. - - The list to apply the Slice view on - From which index - The length of the slice - if set to true the view is in reversed order. - - - - Calculates the real index in the underlying collection - - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Converts to an array. - - - - - Converts to an list. - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - Slices are readonly - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - Slices are readonly - - - - Adds an item to the . - - The object to add to the . - Slices are readonly - - - - Removes all items from the . - - Slices are readonly - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - Slices are readonly - - - - Gets or sets the element at the specified index. - - The index. - - - - - Gets the index from which the slice starts - - - - - Gets the number of elements contained in the . - - The number of elements contained in the . - - - - Gets a value indicating whether this operates in a reversed direction. - - - true if this operates in a reversed direction; otherwise, false. - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - A class representing a script coroutine - - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as DynValue(s) - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as System.Object. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Gets this coroutine as a typed enumerable which can be looped over for resuming. - Returns its result as the specified type. Only the first element of tuples is returned. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - The purpose of this method is to convert a MoonSharp/Lua coroutine to a Unity3D coroutine. - This loops over the coroutine, discarding returned values, and returning null for each invocation. - This means however that the coroutine will be invoked each frame. - Only non-CLR coroutines can be resumed with this method. Use an overload of the Resume method accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - The arguments. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead - - - - Resumes the coroutine. - - The ScriptExecutionContext. - - - - - Resumes the coroutine. - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - The arguments. - - Only non-CLR coroutines can be resumed with this overload of the Resume method. Use the overload accepting a ScriptExecutionContext instead. - - - - Resumes the coroutine - - The ScriptExecutionContext. - The arguments. - - - - - Gets the coroutine stack trace for debug purposes - - The skip. - The entry source reference. - - - - - Gets the type of coroutine - - - - - Gets the coroutine state. - - - - - Gets the script owning this resource. - - - The script owning this resource. - - - - - - Possible types of coroutine - - - - - A valid coroutine - - - - - A CLR callback assigned to a coroutine. - - - - - A CLR callback assigned to a coroutine and already executed. - - - - - Class used to support "tail" continuations - a way for C# / Lua interaction which supports - coroutine yielding (at the expense of a LOT of added complexity in calling code). - - - - - Gets or sets the function to call - - - - - Gets or sets the arguments to the function - - - - - Gets or sets the callback to be used as a continuation. - - - - - Gets or sets the callback to be used in case of errors. - - - - - Gets or sets the error handler to be called before stack unwinding - - - - - Class exposing C# objects as Lua userdata. - For efficiency, a global registry of types is maintained, instead of a per-script one. - - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type for userdata interop - - The type to be registered - The access mode (optional). - Friendly name for the type (optional) - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers a type with a custom userdata descriptor - - The type to be registered - The custom descriptor. - - - - Registers all types marked with a MoonSharpUserDataAttribute that ar contained in an assembly. - - The assembly. - if set to true extension types are registered to the appropriate registry. - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The type to be unregistered - - - - Unregisters a type. - WARNING: unregistering types at runtime is a dangerous practice and may cause unwanted errors. - Use this only for testing purposes or to re-register the same type in a slightly different way. - Additionally, it's a good practice to discard all previous loaded scripts after calling this method. - - The The type to be unregistered - - - - Creates a userdata DynValue from the specified object, using a specific descriptor - - The object - The descriptor. - - - - - Creates a userdata DynValue from the specified object - - The object - - - - - Creates a static userdata DynValue from the specified IUserDataDescriptor - - The IUserDataDescriptor - - - - - Creates a static userdata DynValue from the specified Type - - The type - - - - - Creates a static userdata DynValue from the specified Type - - The Type - - - - - Registers an extension Type (that is a type containing extension methods) - - The type. - The InteropAccessMode. - - - - Gets all the extension methods which can match a given name - - The name. - - - - - Gets a number which gets incremented everytime the extension methods registry changes. - Use this to invalidate caches based on extension methods - - - - - - Gets or sets the "uservalue". See debug.getuservalue and debug.setuservalue. - http://www.lua.org/manual/5.2/manual.html#pdf-debug.setuservalue - - - - - Gets the object associated to this userdata (null for statics) - - - - - Gets the type descriptor of this userdata - - - - - Gets or sets the registration policy to be used in the whole application - - - - - Gets or sets the default access mode to be used in the whole application - - - The default access mode. - - InteropAccessMode is InteropAccessMode.Default - - - - Constants of well known "symbols" in the MoonSharp grammar - - - - - The variadic argument symbol ("...") - - - - - The environment symbol ("_ENV") - - - - - Class wrapping a request to yield a coroutine - - - - - The return values of the coroutine - - - - - Wrapper for a debugger initiated action - - - - - Initializes a new instance of the class. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - The type of action - - - - - Gets the time stamp UTC of this action - - - - - Gets or sets the source identifier this action refers to. - - - - - Gets or sets the source line this action refers to. - - - - - Gets or sets the source column this action refers to. - - - - - Gets the age of this debugger action - - - - - Type of the action - - - - - Step-in at the bytecode level - - - - - Step-over at the bytecode level - - - - - Step-out at the bytecode level - - - - - Step-in at the source level - - - - - Step-over at the source level - - - - - Step-out at the source level - - - - - Continue execution "freely" - - - - - Toggles breakpoint - - - - - Sets a breakpoint - - - - - Clears a breakpoint - - - - - Refresh the data - - - - - Hard refresh of data - - - - - No action - - - - - Interface for debuggers to implement, in order to provide debugging facilities to Scripts. - - - - - Called by the script engine when a source code is added or changed. - - The source code object. - - - - Called by the script engine when the bytecode changes. - - The bytecode source - - - - Called by the script engine at execution time to check if a break has - been requested. Should return pretty fast as it's called A LOT. - - - - - Called by the script engine when a runtime error occurs. - The debugger can return true to signal the engine that it wants to break - into the source of the error. If it does so, it should also return true - to subsequent calls to IsPauseRequested(). - - The runtime exception. - True if this error should break execution. - - - - Called by the script engine to get what action to do next. - - The instruction pointer in bytecode. - The source reference. - T - - - - Called by the script engine when the execution ends. - - - - - Called by the script engine to update watches of a given type. Note - that this method is not called only for watches in the strictest term, - but also for the stack, etc. - - Type of the watch. - The items. - - - - Called by the script engine to get which expressions are active - watches in the debugger. - - A list of watches - - - - Called by the script engine to refresh the breakpoint list. - - - - - Class representing a reference to source code interval - - - - - Gets a value indicating whether this instance is a breakpoint - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets whether the source ref includes the specified location - - Index of the source. - The line. - The column. - - - - - Sets the CannotBreakpoint flag. - - - - - - Formats the location according to script preferences - - The script. - if set to true the classic Lua format is forced. - - - - - Gets a value indicating whether this location is inside CLR . - - - - - Gets the index of the source. - - - - - Gets from which column the source code ref starts - - - - - Gets to which column the source code ref ends - - - - - Gets from which line the source code ref starts - - - - - Gets to which line the source code ref ends - - - - - Gets a value indicating whether this instance is a stop "step" in source mode - - - - - Gets a value indicating whether this instance cannot be set as a breakpoint - - - - - A watch item for the debugger to consume. - Most properties make or not sense depending on the WatchType. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the address of the item - - - - - Gets or sets the base pointer (base value of v-stack at entering the function). - Valid only for call-stack items - - - - - Gets or sets the return address. - Valid only for call-stack items - - - - - Gets or sets the name of the item - - - - - Gets or sets the value of the item - - - - - Gets or sets the symbol reference of the item - - - - - Gets or sets a value indicating whether this instance is generating an error. - - - - - Gets or sets the source location this item refers to. - - - - - Enumeration of the possible watch types - - - - - A real variable watch - - - - - The status of the v-stack - - - - - The call stack - - - - - The list of coroutines - - - - - The maximum value of this enum - - - - - Enumeration of the possible performance counters - - - - - Measures the time spent parsing the source creating the AST - - - - - Measures the time spent converting ASTs in bytecode - - - - - Measures the time spent in executing scripts - - - - - Measures the on the fly creation/compilation of functions in userdata descriptors - - - - - Sentinel value to get the enum size - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Enumeration of unit of measures of the performance counters - - - - - The performance counter is specified in bytes (of memory) - - - - - The performance counter is specified in milliseconds - - - - - A single object of this type exists for every script and gives access to performance statistics. - - - - - Gets the result of the specified performance counter . - - The PerformanceCounter. - - - - - Starts a stopwatch. - - - - - - Starts a stopwatch. - - - - - - Gets a string with a complete performance log. - - - - - - Gets or sets a value indicating whether this collection of performance stats is enabled. - - - true if enabled; otherwise, false. - - - - - The result of a performance counter - - - - - Returns a that represents this instance. - - - - - Converts a PerformanceCounterType to a string. - - The type. - - - - Gets the name of the performance counter which generated this result. - - - - - Gets the quantity monitored - see Type to understand what this field contains - - - - - Gets the number of instances which led to the specified counter being incremented - e.g. the times a specific - code is executed, or object instanced - - - - - Gets a value indicating whether this is global or relative to the resource - for which it's called. - - - - - Gets the unit of measure of the Counter field. - - - - - This class is not *really* IDisposable.. it's just use to have a RAII like pattern. - You are free to reuse this instance after calling Dispose. - - - - - Exception thrown when an inconsistent state is reached in the interpreter - - - - - Exception for all parsing/lexing errors. - - - - - Gets or sets a value indicating whether this exception was caused by premature stream termination (that is, unexpected EOF). - This can be used in REPL interfaces to tell between unrecoverable errors and those which can be recovered by extra input. - - - - - This class is a container for arguments received by a CallbackFunction - - - - - Initializes a new instance of the class. - - The arguments. - if set to true [is method call]. - - - - Gets the at the specified index, or null. - - The index. - if set to true all voids are translated to nils. - - - - - Converts the arguments to an array - - The number of elements to skip (default= 0). - - - - - Gets the specified argument as as an argument of the specified type. If not possible, - an exception is raised. - - The argument number. - Name of the function. - The type desired. - if set to true nil values are allowed. - - - - - Gets the specified argument as as an argument of the specified user data type. If not possible, - an exception is raised. - - The desired userdata type - The argument number. - Name of the function. - if set to true nil values are allowed. - - - - - Gets the specified argument as an integer - - The argument number. - Name of the function. - - - - - Gets the specified argument as a string, calling the __tostring metamethod if needed, in a NON - yield-compatible way. - - The execution context. - The argument number. - Name of the function. - - 'tostring' must return a string to '{0}' - - - - Returns a copy of CallbackArguments where the first ("self") argument is skipped if this was a method call, - otherwise returns itself. - - - - - - Gets the count of arguments - - - - - Gets or sets a value indicating whether this is a method call. - - - - - Gets the at the specified index, or Void if not found - - - - - A class representing a script function - - - - - Shortcut for an empty closure - - - - - Initializes a new instance of the class. - - The script. - The index. - The symbols. - The resolved locals. - - - - Calls this function with the specified args - - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Calls this function with the specified args - - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Gets a delegate wrapping calls to this scripted function - - - - - - Gets a delegate wrapping calls to this scripted function - - The type of return value of the delegate. - - - - - Gets the number of upvalues in this closure - - The number of upvalues in this closure - - - - Gets the name of the specified upvalue. - - The index of the upvalue. - The upvalue name - - - - Gets the value of an upvalue - - The index of the upvalue. - The value of an upvalue - - - - Gets the type of the upvalues contained in this closure - - - - - - Gets the entry point location in bytecode . - - - - - Gets the script owning this function - - - - - The current closure context - - - - - Type of closure based on upvalues - - - - - The closure has no upvalues (thus, technically, it's a function and not a closure!) - - - - - The closure has _ENV as its only upvalue - - - - - The closure is a "real" closure, with multiple upvalues - - - - - This class wraps a CLR function - - - - - Initializes a new instance of the class. - - The callback function to be called. - The callback name, used in stacktraces, debugger, etc.. - - - - Invokes the callback function - - The execution context. - The arguments. - if set to true this is a method call. - - - - - Creates a CallbackFunction from a delegate. - - The script. - The delegate. - The access mode. - - - - - Creates a CallbackFunction from a MethodInfo relative to a function. - - The script. - The MethodInfo object. - The object to which the function applies, or null for static methods. - The access mode. - - The method is not static. - - - - Checks the callback signature of a method is compatible for callbacks - - - - - Gets the name of the function - - - - - Gets the call back. - - - The call back. - - - - - Gets or sets the default access mode used when marshalling delegates - - - The default access mode. Default, HideMembers and BackgroundOptimized are NOT supported. - - Default, HideMembers and BackgroundOptimized are NOT supported. - - - - Gets or sets an object used as additional data to the callback function (available in the execution context). - - - - - A class representing a value in a Lua/MoonSharp script. - - - - - Creates a new writable value initialized to Nil. - - - - - Creates a new writable value initialized to the specified boolean. - - - - - Creates a new writable value initialized to the specified number. - - - - - Creates a new writable value initialized to the specified string. - - - - - Creates a new writable value initialized to the specified StringBuilder. - - - - - Creates a new writable value initialized to the specified string using String.Format like syntax - - - - - Creates a new writable value initialized to the specified coroutine. - Internal use only, for external use, see Script.CoroutineCreate - - The coroutine object. - - - - - Creates a new writable value initialized to the specified closure (function). - - - - - Creates a new writable value initialized to the specified CLR callback. - - - - - Creates a new writable value initialized to the specified CLR callback. - See also CallbackFunction.FromDelegate and CallbackFunction.FromMethodInfo factory methods. - - - - - Creates a new writable value initialized to the specified table. - - - - - Creates a new writable value initialized to an empty table. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The function to be called. - The arguments. - - - - - Creates a new request for a tail call. This is the preferred way to execute Lua/MoonSharp code from a callback, - although it's not always possible to use it. When a function (callback or script closure) returns a - TailCallRequest, the bytecode processor immediately executes the function contained in the request. - By executing script in this way, a callback function ensures it's not on the stack anymore and thus a number - of functionality (state savings, coroutines, etc) keeps working at full power. - - The data for the tail call. - - - - - Creates a new request for a yield of the current coroutine. - - The yield argumenst. - - - - - Creates a new tuple initialized to the specified values. - - - - - Creates a new tuple initialized to the specified values - which can be potentially other tuples - - - - - Creates a new userdata value - - - - - Returns this value as readonly - eventually cloning it in the process if it isn't readonly to start with. - - - - - Clones this instance. - - - - - - Clones this instance, overriding the "readonly" status. - - if set to true the new instance is set as readonly, or writeable otherwise. - - - - - Clones this instance, returning a writable copy. - - Can't clone Symbol values - - - - Returns a string which is what it's expected to be output by the print function applied to this value. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Determines whether the specified , is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Casts this DynValue to string, using coercion if the type is number. - - The string representation, or null if not number, not string. - - - - Casts this DynValue to a double, using coercion if the type is string. - - The string representation, or null if not number, not string or non-convertible-string. - - - - Casts this DynValue to a bool - - False if value is false or nil, true otherwise. - - - - Converts a tuple to a scalar value. If it's already a scalar value, this function returns "this". - - - - - Performs an assignment, overwriting the value with the specified one. - - The value. - If the value is readonly. - - - - Gets the length of a string or table value. - - - Value is not a table or string. - - - - Determines whether this instance is nil or void - - - - - Determines whether this instance is not nil or void - - - - - Determines whether this instance is void - - - - - Determines whether this instance is not void - - - - - Determines whether is nil, void or NaN (and thus unsuitable for using as a table key). - - - - - Changes the numeric value of a number DynValue. - - - - - Creates a new DynValue from a CLR object - - The script. - The object. - - - - - Converts this MoonSharp DynValue to a CLR object. - - - - - Converts this MoonSharp DynValue to a CLR object of the specified type. - - - - - Checks the type of this value corresponds to the desired type. A propert ScriptRuntimeException is thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - Name of the function requesting the value, for error message purposes. - The desired data type. - The argument number, for error message purposes. - The TypeValidationFlags. - - Thrown - if the value is not of the specified type or - considering the TypeValidationFlags - is not convertible - to the specified type. - - - - Checks if the type is a specific userdata type, and returns it or throws. - - - Name of the function. - The argument number. - The flags. - - - - - Gets a unique reference identifier. This is guaranteed to be unique only for dynvalues created in a single thread as it's not thread-safe. - - - - - Gets the type of the value. - - - - - Gets the function (valid only if the is ) - - - - - Gets the numeric value (valid only if the is ) - - - - - Gets the values in the tuple (valid only if the is Tuple). - This field is currently also used to hold arguments in values whose is . - - - - - Gets the coroutine handle. (valid only if the is Thread). - - - - - Gets the table (valid only if the is ) - - - - - Gets the boolean value (valid only if the is ) - - - - - Gets the string value (valid only if the is ) - - - - - Gets the CLR callback (valid only if the is ) - - - - - Gets the tail call data. - - - - - Gets the yield request data. - - - - - Gets the tail call data. - - - - - Returns true if this instance is write protected. - - - - - A preinitialized, readonly instance, equaling Void - - - - - A preinitialized, readonly instance, equaling Nil - - - - - A preinitialized, readonly instance, equaling True - - - - - A preinitialized, readonly instance, equaling False - - - - - A class representing a key/value pair for Table use - - - - - Initializes a new instance of the struct. - - The key. - The value. - - - - Gets the key. - - - - - Gets or sets the value. - - - - - Gets the nil pair - - - - - Class giving access to details of the environment where the script is executing - - - - - Gets the metatable associated with the given value. - - The value. - - - - - Gets the specified metamethod associated with the given value. - - The value. - The metamethod name. - - - - - prepares a tail call request for the specified metamethod, or null if no metamethod is found. - - - - - Gets the metamethod to be used for a binary operation using op1 and op2. - - - - - Gets the script object associated with this request - - - - - - Gets the coroutine which is performing the call - - - - - Calls a callback function implemented in "classic way". - Useful to port C code from Lua, or C# code from UniLua and KopiLua. - Lua : http://www.lua.org/ - UniLua : http://github.com/xebecnan/UniLua - KopiLua : http://github.com/NLua/KopiLua - - The arguments. - Name of the function - for error messages. - The callback. - - - - - Calls the specified function, supporting most cases. The called function must not yield. - - The function; it must be a Function or ClrFunction or have a call metamethod defined. - The arguments. - - If the function yields, returns a tail call request with continuations/handlers or, of course, if it encounters errors. - - - - Tries to get the reference of a symbol in the current execution state - - - - - Tries to get the value of a symbol in the current execution state - - - - - Finds a symbol by name in the current execution state - - - - - Performs a message decoration before unwinding after an error. To be used in the implementation of xpcall like functions. - - The message handler. - The exception. - - - - Gets a value indicating whether this instance is running a dynamic execution. - Under a dynamic execution, most methods of ScriptExecutionContext are not reliable as the - processing engine of the script is not "really" running or is not available. - - - - - Gets the location of the code calling back - - - - - Gets or sets the additional data associated to this CLR function call. - - - - - Gets the current global env, or null if not found. - - - - - Class representing the source code of a given script - - - - - Gets the code snippet represented by a source ref - - The source code reference. - - - - - Gets the name of the source code - - - - - Gets the source code as a string - - - - - Gets the source code lines. - - - - - Gets the script owning this resource. - - - - - Gets the source identifier inside a script - - - - - State of coroutines - - - - - This is the main coroutine - - - - - Coroutine has not started yet - - - - - Coroutine is suspended - - - - - Coroutine is running - - - - - Coroutine has terminated - - - - - Wrappers for enumerables as return types - - - - - LINQ helper methods - - - - - Converts the specified enumerable dynvalues of a given script type to objects of a given type - - The desired type - The enumerable. - The type. - - - - Filters an enumeration for items of the given script type - - The enumerable. - The script type. - - - - Converts the elements to CLR objects - - The enumerable. - - - - Converts the elements to CLR objects of the desired type - - The desired type - The enumerable. - - - - - - - - - Marks a type of automatic registration as userdata (which happens only if UserData.RegisterAssembly is called). - - - - - Initializes a new instance of the class. - - - - - The interop access mode - - - - - Forces a class member visibility to scripts. Can be used to hide public members or to expose non-public ones. - - - - - Initializes a new instance of the class. - - if set to true the member will be exposed to scripts, if false the member will be hidden. - - - - Gets a value indicating whether this is set to "visible". - - - - - Descriptor which acts as a non-containing adapter from IUserDataType to IUserDataDescriptor - - - - - Initializes a new instance of the class. - - The type. - Name of the friendly. - - - - Performs an "index" "get" operation. - - The script originating the request - The object (null if a static request is done) - The index. - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Performs an "index" "set" operation. - - The script originating the request - The object (null if a static request is done) - The index. - The value to be set - If set to true, it's indexed with a name, if false it's indexed through brackets. - - - - - Converts this userdata to string - - The object. - - - - - Gets a "meta" operation on this userdata. If a descriptor does not support this functionality, - it should return "null" (not a nil). - These standard metamethods can be supported (the return value should be a function accepting the - classic parameters of the corresponding metamethod): - __add, __sub, __mul, __div, __div, __pow, __unm, __eq, __lt, __le, __lt, __len, __concat, - __pairs, __ipairs, __iterator, __call - These standard metamethods are supported through other calls for efficiency: - __index, __newindex, __tostring - - The script originating the request - The object (null if a static request is done) - The name of the metamember. - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Gets the name of the descriptor (usually, the name of the type described). - - - - - Gets the type this descriptor refers to - - - - - Determines whether the specified object is compatible with the specified type. - Unless a very specific behaviour is needed, the correct implementation is a - simple " return type.IsInstanceOfType(obj); " - - The type. - The object. - - - - - Standard descriptor for userdata types. - - - - - Initializes a new instance of the class. - - The type this descriptor refers to. - The interop access mode this descriptor uses for members access - A human readable friendly name of the descriptor. - - - - Fills the member list. - - - - - Gets the interop access mode this descriptor uses for members access - - - - - Enumerations of the possible strategies to marshal CLR objects to MoonSharp userdata and functions - when using automatic descriptors. - Note that these are "hints" and MoonSharp is free to ignore the access mode specified (if different from - HideMembers) and downgrade the access mode to "Reflection". - This particularly happens when running on AOT platforms like iOS. - See also : and . - - - - - Optimization is not performed and reflection is used everytime to access members. - This is the slowest approach but saves a lot of memory if members are seldomly used. - - - - - Optimization is done on the fly the first time a member is accessed. - This saves memory for all members that are never accessed, at the cost of an increased script execution time. - - - - - Optimization is done at registration time. - - - - - Optimization is done in a background thread which starts at registration time. - If a member is accessed before optimization is completed, reflection is used. - - - - - No optimization is done, and members are not accessible at all. - - - - - No reflection is allowed, nor code generation. This is used as a safeguard when registering types which should not - use a standard reflection based descriptor - for example for types implementing - - - - - Use the default access mode - - - - - Class providing easier marshalling of CLR functions - - - - - Tries to create a new StandardUserDataMethodDescriptor, returning - null in case the method is not - visible to script code. - - The MethodBase. - The - if set to true forces visibility. - - A new StandardUserDataMethodDescriptor or null. - - - - - Initializes a new instance of the class. - - The MethodBase (MethodInfo or ConstructorInfo) got through reflection. - The interop access mode. - Invalid accessMode - - - - Checks if the method is compatible with a standard descriptor - - The MethodBase. - if set to true an exception with the proper error message is thrown if not compatible. - - - Thrown if throwException is true and one of this applies: - The method contains unresolved generic parameters, or has an unresolved generic return type - or - The method contains pointer parameters, or has a pointer return type - - - - - Gets a callback function as a delegate - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function. - - The script for which the callback must be generated. - The object (null for static). - - - - - Gets the callback function as a DynValue. - - The script for which the callback must be generated. - The object (null for static). - - - - - Creates a callback DynValue starting from a MethodInfo. - - The script. - The mi. - The object. - - - - - The internal callback which actually executes the method - - The script. - The object. - The context. - The arguments. - - - - - Gets the value of this member as a to be exposed to scripts. - - The script. - The object owning this member, or null if static. - - The value of this member as a . - - - - - Sets the value. - - The script. - The object. - The v. - - - - - Gets the method information (can be a MethodInfo or ConstructorInfo) - - - - - Gets the access mode used for interop - - - - - Gets a value indicating whether the described method is static. - - - - - Gets the name of the described method - - - - - Gets a value indicating whether the described method is a constructor - - - - - Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores - - - - - Gets the type of the arguments of the underlying CLR function - - - - - Gets the type which this extension method extends, null if this is not an extension method. - - - - - Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, - null is returned. - - - - - Gets the types of access supported by this member - - - - - Class providing easier marshalling of CLR properties - - - - - Tries to create a new StandardUserDataPropertyDescriptor, returning null in case the property is not - visible to script code. - - The PropertyInfo. - The - A new StandardUserDataPropertyDescriptor or null. - - - - Initializes a new instance of the class. - NOTE: This constructor gives get/set visibility based exclusively on the CLR visibility of the - getter and setter methods. - - The pi. - The access mode. - - - - Initializes a new instance of the class. - - The PropertyInfo. - The - The getter method. Use null to make the property writeonly. - The setter method. Use null to make the property readonly. - - - - Gets the value of the property - - The script. - The object. - - - - - Sets the value of the property - - The script. - The object. - The value to set. - - - - Called by standard descriptors when background optimization or preoptimization needs to be performed. - - - - - Gets the PropertyInfo got by reflection - - - - - Gets the - - - - - Gets a value indicating whether the described property is static. - - - - - Gets the name of the property - - - - - Gets a value indicating whether this instance can be read from - - - true if this instance can be read from; otherwise, false. - - - - - Gets a value indicating whether this instance can be written to. - - - true if this instance can be written to; otherwise, false. - - - - - Gets the types of access supported by this member - - - - - The scope of a closure (container of upvalues) - - - - - Gets the symbols. - - - - - Enumeration of the types of SymbolRef - - - - - The symbol ref of a local variable - - - - - The symbol ref of an upvalue variable - - - - - The symbol ref of a global variable - - - - - The symbol ref of the global environment - - - - - This class stores a possible l-value (that is a potential target of an assignment) - - - - - Creates a new symbol reference pointing to a global var - - The name. - The _ENV symbol. - - - - - Creates a new symbol reference pointing to a local var - - The name. - The index of the var in local scope. - - - - - Creates a new symbol reference pointing to an upvalue var - - The name. - The index of the var in closure scope. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Writes this instance to a binary stream - - - - - Reads a symbolref from a binary stream - - - - - Gets the type of this symbol reference - - - - - Gets the index of this symbol in its scope context - - - - - Gets the name of this symbol - - - - - Gets the environment this symbol refers to (for global symbols only) - - - - - Gets the default _ENV. - - - - - Enumeration of possible data types in MoonSharp - - - - - A nil value, as in Lua - - - - - A place holder for no value - - - - - A Lua boolean - - - - - A Lua number - - - - - A Lua string - - - - - A Lua function - - - - - A Lua table - - - - - A set of multiple values - - - - - A userdata reference - that is a wrapped CLR object - - - - - A coroutine handle - - - - - A callback function - - - - - A request to execute a tail call - - - - - A request to coroutine.yield - - - - - Extension methods to DataType - - - - - Determines whether this data type can have type metatables. - - The type. - - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function, with additional values - to support debuggers - - The type. - - The DataType is not a Lua type - - - - Converts the DataType to the string returned by the "type(...)" Lua function - - The type. - - The DataType is not a Lua type - - - - A script loader loading scripts from an assembly resources - - - - - A base implementation of IScriptLoader, offering resolution of module names. - - - - - Class dictating how requests to read scripts from files are handled. - - It's recommended that no class implement IScriptLoader directly, and rather extend ScriptLoaderBase. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile) - - The modname. - The global context. - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - Resolves the name of a module on a set of paths. - - The modname. - The paths. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable (if and only if - the IgnoreLuaPathGlobal is false), and - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - Unpacks a string path in a form like "?;?.lua" to an array - - - - - Gets the default environment paths. - - - - - Resolves a filename [applying paths, etc.] - - The filename. - The global context. - - - - - Gets or sets the modules paths used by the "require" function. If null, the default paths are used (using - environment variables etc.). - - - - - Gets or sets a value indicating whether the LUA_PATH global is checked or not to get the path where modules are contained. - If true, the LUA_PATH global is NOT checked. - - - - - Initializes a new instance of the class. - - The assembly containing the scripts as embedded resources or null to use the calling assembly. - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - - - - - Checks if a script file exists. - - The script filename. - - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - - - - A script loader used for platforms we cannot initialize in any better way.. - - - - - An implementation of which supports a very basic history of recent input lines. - - - - - This class provides a simple REPL intepreter ready to be reused in a simple way. - - - - - Initializes a new instance of the class. - - The script. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - This method returns the result of the computation, or null if more input is needed for a computation. - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "?" as a - dynamic expression to evaluate instead of script code (likely invalid) - - - - - Gets or sets a value indicating whether this instances handle inputs starting with a "=" as a - non-dynamic expression to evaluate (just like the Lua interpreter does by default). - - - - - Gets a value indicating whether this instance has a pending command - - - - - Gets the current pending command. - - - - - Gets the classic prompt (">" or ">>") given the current state of the interpreter - - - - - Initializes a new instance of the class. - - The script. - Size of the history. - - - - Evaluate a REPL command. - This method returns the result of the computation, or null if more input is needed for having valid code. - In case of errors, exceptions are propagated to the caller. - - The input. - - This method returns the result of the computation, or null if more input is needed for a computation. - - - - - Gets the previous item in history, or null - - - - - Gets the next item in history, or null - - - - - A script loader loading scripts directly from the file system (does not go through platform object) - AND starts with module paths taken from environment variables (again, not going through the platform object). - - The paths are preconstructed using : - * The MOONSHARP_PATH environment variable if it exists - * The LUA_PATH_5_2 environment variable if MOONSHARP_PATH does not exists - * The LUA_PATH environment variable if LUA_PATH_5_2 and MOONSHARP_PATH do not exists - * The "?;?.lua" path if all the above fail - - Also, everytime a module is require(d), the "LUA_PATH" global variable is checked. If it exists, those paths - will be used to load the module instead of the global ones. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of a module to a filename (which will later be passed to OpenScriptFile). - The resolution happens first on paths included in the LUA_PATH global variable, and - - if the variable does not exist - by consulting the - ScriptOptions.ModulesPaths array. Override to provide a different behaviour. - - The modname. - The global context. - - - - - A script loader which can load scripts from assets in Unity3D. - Scripts should be saved as .txt files in a subdirectory of Assets/Resources. - - When MoonSharp is activated on Unity3D and the default script loader is used, - scripts should be saved as .txt files in Assets/Resources/MoonSharp/Scripts. - - - - - The default path where scripts are meant to be stored (if not changed) - - - - - Initializes a new instance of the class. - - The path, relative to Assets/Resources. For example - if your scripts are stored under Assets/Resources/Scripts, you should - pass the value "Scripts". If null, "MoonSharp/Scripts" is used. - - - - Opens a file for reading the script code. - It can return either a string, a byte[] or a Stream. - If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's - assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place. - - The file. - The global context. - - A string, a byte[] or a Stream. - - UnityAssetsScriptLoader.LoadFile : Cannot load + file - - - - Checks if a given file exists - - The file. - - - - - Gets the list of loaded scripts filenames (useful for debugging purposes). - - - - - - In a module type, mark fields with this attribute to have them exposed as a module constant. - - See for more information about modules. - - - - - Gets or sets the name of the constant - if different from the name of the field itself - - - - - Namespace containing all the most commonly used classes for MoonSharp operation. - When in doubt, refer to and classes as starting points. - - - - - Namespace containing the implementation of the Lua standard library, as MoonSharp modules. - There's seldom the need to access these classes directly. - - - - - Namespace containing userdata classes for the 'io' module - - - - - Namespace containing classes used to support debuggers - - - - - Namespace containing classes used to support self diagnostics (e.g. performance counters) - - - - - Namespace containing classes used to customize and support advanced interoperations between - scripts and CLR code. - - - - - Namespace containing classes used to provide a minimal support for porting code based on the classic - "LuaState" model (e.g. code based on KopiLua, UniLua or Lua itself). - - - - - Namespace containing classes used to customized how scripts are loaded from external files. - - - - - Namespace containing classes used to customize how the interfacing with the operative system happens - for the 'os' and 'io' modules, and for future modules/classes which may require OS access. - See and . - - - - - Contains classes useful to implement REPL interpreters. - See : - - - - - Interface to abstract all accesses made to the underlying platform (OS, framework) by the scripting engine. - Can be used both to support "non-standard" platforms (i.e. non-posix, non-windows) and/or to sandbox the behaviour - of the scripting engine. - - It's recommended that no class implement IPlatformAccessor directly, and rather extend . - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - Gets the name of the platform (used for debug purposes). - - The name of the platform (used for debug purposes) - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If a meaningful implementation cannot be provided, this method should return null. - - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - The script. - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - True if the file exists, false otherwise. - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - An abstract class which offers basic services on top of IPlatformAccessor to provide easier implementation of platforms. - - - - - Gets the platform name prefix - - - - - - Gets the name of the platform (used for debug purposes). - - - The name of the platform (used for debug purposes) - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - DEPRECATED. - This is kept for backward compatibility, see the overload taking a prompt as an input parameter. - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - Default handler for interactive line input calls. Can be customized in ScriptOptions. - If an inheriting class whants to give a meaningful implementation, this method MUST be overridden. - - null - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Determines whether the application is running in AOT (ahead-of-time) mode - - - - - A static class offering properties for autodetection of system/platform details - - - - - Gets a value indicating whether this instance is running on mono. - - - - - Gets a value indicating whether this instance is running on a CLR4 compatible implementation - - - - - Gets a value indicating whether this instance is running on Unity-3D - - - - - Gets a value indicating whether this instance has been built as a Portable Class Library - - - - - Gets a value indicating whether this instance is running a system using Ahead-Of-Time compilation - and not supporting JIT. - - - - - A class implementing all the bits needed to have a minimal support of a platform. - This does not support the 'io'/'file' modules and has partial support of the 'os' module. - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - A function used to open files in the 'io' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a standard stream (stdin, stdout, stderr). - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The type. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Exits the process, returning the specified exit code. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The exit code. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Checks if a file exists. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - - True if the file exists, false otherwise. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Deletes the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The file. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Moves the specified file. Used by the 'os' module. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The source. - The DST. - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - LimitedPlatformAccessorBase does NOT offer a meaningful implementation of this method and - thus does not support 'io' and 'os' modules. - - The cmdline. - - The current platform accessor does not support 'io' and 'os' operations. Provide your own implementation of platform to work around this limitation, if needed. - - - - Gets the platform name prefix - - - - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - - Enumeration of standard file handles - - - - - Standard Input - - - - - Standard Output - - - - - Standard Error Output - - - - - Class providing the IPlatformAccessor interface for standard full-feaured implementations. - - - - - Converts a Lua string access mode to a FileAccess enum - - The mode. - - - - - Converts a Lua string access mode to a ParseFileMode enum - - The mode. - - - - - A function used to open files in the 'io' module. - Can have an invalid implementation if 'io' module is filtered out. - It should return a correctly initialized Stream for the given file and access - - - The filename. - The encoding. - The mode (as per Lua usage - e.g. 'w+', 'rb', etc.). - - - - - Gets an environment variable. Must be implemented, but an implementation is allowed - to always return null if a more meaningful implementation cannot be achieved or is - not desired. - - The envvarname. - - The environment variable value, or null if not found - - - - - Gets a standard stream (stdin, stdout, stderr). - - The type. - - type - - - - Default handler for 'print' calls. Can be customized in ScriptOptions - - The content. - - - - Gets a temporary filename. Used in 'io' and 'os' modules. - Can have an invalid implementation if 'io' and 'os' modules are filtered out. - - - - - - Exits the process, returning the specified exit code. - Can have an invalid implementation if the 'os' module is filtered out. - - The exit code. - - - - Checks if a file exists. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - True if the file exists, false otherwise. - - - - - Deletes the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The file. - - - - Moves the specified file. Used by the 'os' module. - Can have an invalid implementation if the 'os' module is filtered out. - - The source. - The DST. - - - - Executes the specified command line, returning the child process exit code and blocking in the meantime. - Can have an invalid implementation if the 'os' module is filtered out. - - The cmdline. - - - - - Filters the CoreModules enumeration to exclude non-supported operations - - The requested modules. - - The requested modules, with unsupported modules filtered out. - - - - - Gets the platform name prefix - - - - - - - This class implements a MoonSharp scripting session. Multiple Script objects can coexist in the same program but cannot share - data among themselves unless some mechanism is put in place. - - - - - The version of the MoonSharp engine - - - - - The Lua version being supported - - - - - Initializes the class. - - - - - Initializes a new instance of the clas.s - - - - - Initializes a new instance of the class. - - The core modules to be pre-registered in the default global table. - - - - Loads a string containing a Lua/MoonSharp function. - - The code. - The global table to bind to this chunk. - Name of the function used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads a Lua/MoonSharp script from a System.IO.Stream. NOTE: This will *NOT* close the stream! - - The stream containing code. - The global table to bind to this chunk. - Name of the code - used to report errors, etc. - - A DynValue containing a function which will execute the loaded code. - - - - - Dumps on the specified stream. - - The function. - The stream. - - function arg is not a function! - or - stream is readonly! - or - function arg has upvalues other than _ENV - - - - - Loads a string containing a Lua/MoonSharp script. - - The code. - The global table to bind to this chunk. - The filename to be used in error messages. - - A DynValue containing a function which will execute the loaded code. - - - - - Loads and executes a string containing a Lua/MoonSharp script. - - The code. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a stream containing a Lua/MoonSharp script. - - The stream. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Loads and executes a file containing a Lua/MoonSharp script. - - The filename. - The global context. - - A DynValue containing the result of the processing of the loaded chunk. - - - - - Runs the specified file with all possible defaults for quick experimenting. - - The filename. - A DynValue containing the result of the processing of the executed script. - - - - Runs the specified code with all possible defaults for quick experimenting. - - The Lua/MoonSharp code. - A DynValue containing the result of the processing of the executed script. - - - - Creates a closure from a bytecode address. - - The address. - The env table to create a 0-upvalue - - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - The return value(s) of the function call. - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - - Thrown if function is not of DataType.Function - - - - Calls the specified function. - - The Lua/MoonSharp function to be called - The arguments to pass to the function. - - Thrown if function is not of DataType.Function - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Creates a coroutine pointing at the specified function. - - The function. - - The coroutine handle. - - Thrown if function is not of DataType.Function or DataType.ClrFunction - - - - Gets the main chunk function. - - A DynValue containing a function which executes the first chunk that has been loaded. - - - - Attaches a debugger. This usually should be called by the debugger itself and not by user code. - - The debugger object. - - - - Gets the source code. - - The source code identifier. - - - - - Loads a module as per the "require" Lua function. http://www.lua.org/pil/8.1.html - - The module name - The global context. - - Raised if module is not found - - - - Gets a type metatable. - - The type. - - - - - Sets a type metatable. - - The type. Must be Nil, Boolean, Number, String or Function - The metatable. - Specified type not supported : + type.ToString() - - - - Warms up the parser/lexer structures so that MoonSharp operations start faster. - - - - - Creates a new dynamic expression. - - The code of the expression. - - - - - Creates a new dynamic expression which is actually quite static, returning always the same constant value. - - The code of the not-so-dynamic expression. - The constant to return. - - - - - Gets an execution context exposing only partial functionality, which should be used for - those cases where the execution engine is not really running - for example for dynamic expression - or calls from CLR to CLR callbacks - - - - - Gets or sets the script loader which will be used as the value of the - ScriptLoader property for all newly created scripts. - - - - - Gets access to the script options. - - - - - Gets the global options, that is options which cannot be customized per-script. - - - - - Gets access to performance statistics. - - - - - Gets the default global table for this script. Unless a different table is intentionally passed (or setfenv has been used) - execution uses this table. - - - - - Gets the source code count. - - - The source code count. - - - - - MoonSharp (like Lua itself) provides a registry, a predefined table that can be used by any CLR code to - store whatever Lua values it needs to store. - Any CLR code can store data into this table, but it should take care to choose keys - that are different from those used by other libraries, to avoid collisions. - Typically, you should use as key a string GUID, a string containing your library name, or a - userdata with the address of a CLR object in your code. - - - - - A class representing a Lua table. - - - - - Initializes a new instance of the class. - - The owner script. - - - - Removes all items from the Table. - - - - - Gets the integral key from a double. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) - - The key. - - - - - Gets the dynvalue associated with the specified key (expressed as a System.Object) as a System.Object. - - The key. - - - - - Sets the dynvalue associated with the specified key. Both expressed as System.Object. - - The key. - The value. - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Gets the value associated with the specified key, without bringing to Nil the non-existant values. - - The key. - - - - - Sets the value associated to the specified key. - - The key. - The value. - - - - Gets the value associated with the specified key. - - The key. - - - - - Collects the dead keys. This frees up memory but invalidates pending iterators. - It's called automatically internally when the semantics of Lua tables allow, but can be forced - externally if it's known that no iterators are pending. - - - - - Returns the next pair from a value - - - - - Gets the script owning this resource. - - - - - Gets or sets the - with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - Multiple keys can be used to access subtables. - - - The . - - The key. - Optional subkeys to access subtables - - - - - Gets or sets the with the specified key(s). - This will marshall CLR and MoonSharp objects in the best possible way. - - - The . - - The key. - - - - - Gets the length of the "array part". - - - - - Gets the meta-table associated with this instance. - - - - - Enumerates the key/value pairs. - - - - - - Enumerates the keys. - - - - - - Enumerates the values - - - - - - A preallocated, non-resizable, stack - - - - - - Enumeration (combinable as flags) of all the standard library modules - - - - - Value used to specify no modules to be loaded (equals 0). - - - - - The basic methods. Includes "assert", "collectgarbage", "error", "print", "select", "type", "tonumber" and "tostring". - - - - - The global constants: "_G", "_VERSION" and "_MOONSHARP". - - - - - The table iterators: "next", "ipairs" and "pairs". - - - - - The metatable methods : "setmetatable", "getmetatable", "rawset", "rawget", "rawequal" and "rawlen". - - - - - The string package - - - - - The load methods: "load", "loadsafe", "loadfile", "loadfilesafe", "dofile" and "require" - - - - - The table package - - - - - The error handling methods: "pcall" and "xpcall" - - - - - The math package - - - - - The coroutine package - - - - - The bit32 package - - - - - The time methods of the "os" package: "clock", "difftime", "date" and "time" - - - - - The methods of "os" package excluding those listed for OS_Time. These are not supported under Unity. - - - - - The methods of "io" and "file" packages. These are not supported under Unity. - - - - - The "debug" package (it has limited support) - - - - - The "dynamic" package (introduced by MoonSharp). - - - - - A sort of "hard" sandbox preset, including string, math, table, bit32 packages, constants and table iterators. - - - - - A softer sandbox preset, adding metatables support, error handling, coroutine, time functions and dynamic evaluations. - - - - - The default preset. Includes everything except "debug" as now. - Beware that using this preset allows scripts unlimited access to the system. - - - - - The complete package. - Beware that using this preset allows scripts unlimited access to the system. - - - - - Class managing modules (mostly as extension methods) - - - - - Register the core modules to a table - - The table. - The modules. - - - - - Registers the standard constants (_G, _VERSION, _MOONSHARP) to a table - - The table. - - - - - Registers a module type to the specified table - - The table. - The type - - If the module contains some incompatibility - - - - Registers a module type to the specified table - - The module type - The table. - - If the module contains some incompatibility - - - - In a module type, mark methods or fields with this attribute to have them exposed as module functions. - Methods must have the signature "public static DynValue ...(ScriptExecutionContextCallbackArguments)". - Fields must be static or const strings, with an anonymous Lua function inside. - - See for more information about modules. - - - - - Gets or sets the name of the function in the module (defaults to member name) - - - - - Marks a CLR type to be a MoonSharp module. - Modules are the fastest way to bring interop between scripts and CLR code, albeit at the cost of a very increased - complexity in writing them. Modules is what's used for the standard library, for maximum efficiency. - - Modules are basically classes containing only static methods, with the callback function signature. - - See and for (extension) methods used to register modules to a - table. - - See for information regarding the standard callback signature along with easier ways - to marshal methods. - - See for easier object marshalling. - - - - - Gets or sets the namespace, that is the name of the table which will contain the defined functions. - Can be null to be in the global table. - - - - - Class containing script global options, that is options which cannot be customized per-script. - - - - - - Gets or sets the custom converters. - - - - - Gets or sets the platform abstraction to use. - - - The current platform abstraction. - - - - - This class contains options to customize behaviour of Script objects. - - - - - Gets or sets the current script-loader. - - - - - Gets or sets the debug print handler - - - - - Gets or sets the debug input handler (takes a prompt as an input, for interactive interpreters, like debug.debug). - - - - - Gets or sets a value indicating whether error messages will use Lua error locations instead of MoonSharp - improved ones. Use this for compatibility with legacy Lua code which parses error messages. - - - - - Gets or sets the stream used as stdin. If null, a default stream is used. - - - - - Gets or sets the stream used as stdout. If null, a default stream is used. - - - - - Gets or sets the stream used as stderr. If null, a default stream is used. - - - - - Gets or sets the stack depth threshold at which MoonSharp starts doing - tail call optimizations. - TCOs can provide the little benefit of avoiding stack overflows in corner case - scenarios, at the expense of losing debug information and error stack traces - in all other, more common scenarios. MoonSharp choice is to start performing - TCOs only after a certain threshold of stack usage is reached - by default - half the current stack depth (128K entries), thus 64K entries, on either - the internal stacks. - Set this to int.MaxValue to disable TCOs entirely, or to 0 to always have - TCOs enabled. - - - - - Gets or sets a value indicating whether the thread check is enabled. - A "lazy" thread check is performed everytime execution is entered to ensure that no two threads - calls MoonSharp execution concurrently. However 1) the check is performed best effort (thus, it might - not detect all issues) and 2) it might trigger in very odd legal situations (like, switching threads - inside a CLR-callback without actually having concurrency. - - Disable this option if the thread check is giving problems in your scenario, but please check that - you are not calling MoonSharp execution concurrently as it is not supported. - - - - - Primaries the exp. - - The lcontext. - - - - - - - - - - Creates a sub tree of binary expressions - - - - diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.Debugger.0.9.4.0/MoonSharp.Debugger.0.9.4.0.nupkg b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.Debugger.0.9.4.0/MoonSharp.Debugger.0.9.4.0.nupkg deleted file mode 100644 index 572aa4a6..00000000 Binary files a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/MoonSharp.Debugger.0.9.4.0/MoonSharp.Debugger.0.9.4.0.nupkg and /dev/null differ diff --git a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/repositories.config b/src/DevTools/Nuget_Tests/NugetTests_net35/packages/repositories.config deleted file mode 100644 index 5c04ec63..00000000 --- a/src/DevTools/Nuget_Tests/NugetTests_net35/packages/repositories.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/DevTools/PerformanceComparison/CallbacksAndForthTests.cs b/src/DevTools/PerformanceComparison/CallbacksAndForthTests.cs deleted file mode 100644 index 9c30894b..00000000 --- a/src/DevTools/PerformanceComparison/CallbacksAndForthTests.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter; -using NLua; - -namespace PerformanceComparison -{ - [MoonSharpUserData] - public class ChampionPropertiesComponent - { - string name; - - internal void SetFirstName(string p) - { - name = p; - } - - internal void SetLastName(string p) - { - name += " " + p; - } - - public string getName() - { - return name; - } - - internal ChampionPropertiesComponent ToInterface() - { - return this; - } - } - - - class CallbacksAndForthTests - { - public static void xxMain() - { - (new CallbacksAndForthTests()).Start(); - //Console.ReadLine(); - } - - private void Start() - { - //UserData.DefaultAccessMode = InteropAccessMode.Preoptimized; - UserData.RegisterAssembly(); - - //var nLuaState = new Lua(); - var moonSharpState = new Script(); - - const string script = @" - a = """" - onUpdate = function(championPropertiesComponent) - a = championPropertiesComponent:getName() - end - "; - - //nLuaState.DoString(script); - moonSharpState.DoString(script); - - var championProperties = new ChampionPropertiesComponent(); - championProperties.SetFirstName("John"); - championProperties.SetLastName("Smith"); - - //var nLuaFunction = (LuaFunction)nLuaState["onUpdate"]; - var moonSharpFunction = (Closure)moonSharpState.Globals["onUpdate"]; - - int startTime, endTime; - - //// Test NLua - //startTime = Environment.TickCount; - //for (int i = 0; i < 100000; i++) nLuaFunction.Call(championProperties.ToInterface()); - //endTime = Environment.TickCount; - //Console.WriteLine("NLua : {0}", endTime - startTime); - - // Test MoonSharp - startTime = Environment.TickCount; - //DynValue v = DynValue.FromObject(moonSharpState, championProperties.ToInterface()); - for (int i = 0; i < 100000; i++) moonSharpFunction.Call(championProperties.ToInterface()); - endTime = Environment.TickCount; - Console.WriteLine("MoonSharp : {0}", endTime - startTime); - } - - } -} diff --git a/src/DevTools/PerformanceComparison/CoroutineTest.cs b/src/DevTools/PerformanceComparison/CoroutineTest.cs deleted file mode 100644 index b3b8becf..00000000 --- a/src/DevTools/PerformanceComparison/CoroutineTest.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices.ComTypes; -using System.Text; -using System.Threading.Tasks; -using MoonSharp.Interpreter; - -namespace PerformanceComparison -{ - class CoroutineTest - { - public static void xMain() - { - string code = @" - return function() - local x = 0 - while true do - x = x + 1 - coroutine.yield(x) - end - end - "; - - // Load the code and get the returned function - Script script = new Script(); - DynValue function = script.DoString(code); - - // Create the coroutine in C# - DynValue coroutine = script.CreateCoroutine(function); - - // Resume the coroutine forever and ever.. - while (true) - { - DynValue x = coroutine.Coroutine.Resume(); - Console.WriteLine("{0}", x); - } - } - - - public static void xxMain() - { - string code = @" - function a() - callback(b) - end - - function b() - coroutine.yield(); - end - - c = coroutine.create(a); - - return coroutine.resume(c); - "; - - // Load the code and get the returned function - Script script = new Script(); - - script.Globals["callback"] = DynValue.NewCallback( - (ctx, args) => args[0].Function.Call() - ); - - DynValue ret = script.DoString(code); - - // false, "attempt to yield from outside a coroutine" - Console.WriteLine(ret); - - - - Console.ReadKey(); - } - - - - - - - } -} diff --git a/src/DevTools/PerformanceComparison/HugeFile.cs b/src/DevTools/PerformanceComparison/HugeFile.cs deleted file mode 100644 index aeabafd4..00000000 --- a/src/DevTools/PerformanceComparison/HugeFile.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter; - - -namespace PerformanceComparison -{ - public class HugeFile - { - static void xxMain(string[] args) - { - Console.WriteLine("Started..."); - Script.WarmUp(); - Console.WriteLine("Warmed-up..."); - - Script s = new Script(CoreModules.None); - // s.LoadFile(@"C:\gr\tsg\mod_assets\scripts\alcoves.lua"); - //s.LoadFile(@"C:\temp\test3.lua"); - - Stopwatch sw = Stopwatch.StartNew(); - - //for (int i = 0; i < 10; i++) - var v = s.LoadFile(@"C:\temp\test3.lua"); - - //for(int i = 0; i < 1000; i++) - // s.Call(v); - - sw.Stop(); - - Console.WriteLine("Ended : {0} ms", sw.ElapsedMilliseconds); - - Console.WriteLine(s.PerformanceStats.GetPerformanceLog()); - Console.ReadLine(); - } - - - - } -} diff --git a/src/DevTools/PerformanceComparison/PerformanceComparison.csproj b/src/DevTools/PerformanceComparison/PerformanceComparison.csproj deleted file mode 100644 index cdd14080..00000000 --- a/src/DevTools/PerformanceComparison/PerformanceComparison.csproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Debug - AnyCPU - {01C3C379-C816-4779-942D-0263763F8EA5} - Exe - Properties - PerformanceComparison - PerformanceComparison - v4.5.1 - 512 - - - - - - - - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 0 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - false - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - false - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - false - prompt - MinimumRecommendedRules.ruleset - false - - - true - bin\Dev\ - DEBUG;TRACE - 0 - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Dev\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - true - bin\Devp4\ - DEBUG;TRACE - 0 - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - true - bin\x86\Devp4\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - - ..\..\..\..\..\prg\NLua\NLua.dll - - - - - - - - - - - - Code - - - - - - - - - {91ea9b9d-fe03-4273-bdaf-8ad42ede1e59} - MoonSharp.Interpreter.net35-client - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/PerformanceComparison/Program.cs b/src/DevTools/PerformanceComparison/Program.cs deleted file mode 100644 index aeb6812f..00000000 --- a/src/DevTools/PerformanceComparison/Program.cs +++ /dev/null @@ -1,197 +0,0 @@ -// This code is a workbench code - it gets commented on the fly, changed, etc. -// Disable warnings for "assigned but value never used" and "unreachable code". -#pragma warning disable 414 -#pragma warning disable 429 - -//#define PROFILER - -using System; -using System.Collections.Generic; -using MoonSharp.Interpreter.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter; -using MoonSharp.Interpreter.Execution; -using NLua; -using System.Diagnostics; - -namespace PerformanceComparison -{ - class Program - { -#if PROFILER - const int ITERATIONS = 10; -#else - const int ITERATIONS = 1; -#endif - - static string scriptText = @" - function move(n, src, dst, via) - if n > 0 then - move(n - 1, src, via, dst) - --check(src, 'to', dst) - move(n - 1, via, dst, src) - end - end - - for i = 1, 10000 do - move(4, 1, 2, 3) - end - "; - static string scriptText22 = @" -N = 8 - -board = {} -for i = 1, N do - board[i] = {} - for j = 1, N do - board[i][j] = false - end -end - -function Allowed( x, y ) - for i = 1, x-1 do - if ( board[i][y] ) or ( i <= y and board[x-i][y-i] ) or ( y+i <= N and board[x-i][y+i] ) then - return false - end - end - return true -end - -function Find_Solution( x ) - for y = 1, N do - if Allowed( x, y ) then - board[x][y] = true - if x == N or Find_Solution( x+1 ) then - return true - end - board[x][y] = false - end - end - return false -end - -if Find_Solution( 1 ) then - for i = 1, N do - for j = 1, N do - if board[i][j] then - --print( 'Q' ) - else - --print( 'x' ) - end - end - --print( '|' ) - end -else - --print( 'NO!' ) -end - - "; - static StringBuilder g_MoonSharpStr = new StringBuilder(); - static StringBuilder g_NLuaStr = new StringBuilder(); - - public static DynValue Check(ScriptExecutionContext executionContext, CallbackArguments values) - { - //foreach (var val in values.GetArray()) - //{ - // g_MoonSharpStr.Append(val.ToPrintString()); - //} - - //g_MoonSharpStr.AppendLine(); - return DynValue.Nil; - } - - - public static void NCheck(params object[] values) - { - //foreach (var val in values) - //{ - // g_NLuaStr.Append(val.ToString()); - //} - //g_NLuaStr.AppendLine(); - } - - public static void XCheck(int from, string mid, int to) - { - g_MoonSharpStr.Append(from); - g_MoonSharpStr.Append(mid); - g_MoonSharpStr.Append(to); - g_MoonSharpStr.AppendLine(); - } - - static Lua lua = new Lua(); - static string testString = "world"; - - static void Main(string[] args) - { - Script.WarmUp(); - - Stopwatch sw; - - sw = Stopwatch.StartNew(); - - var _s = new Script(); - _s.LoadString(scriptText); - - sw.Stop(); - - Console.WriteLine("Build : {0} ms", sw.ElapsedMilliseconds); - - sw = Stopwatch.StartNew(); - - var script = new Script(); - script.Globals.Set("check", DynValue.NewCallback(new CallbackFunction(Check))); - CallbackFunction.DefaultAccessMode = InteropAccessMode.Preoptimized; - - //script.Globals["print"] = (Action)PrintX; - - - DynValue func = script.LoadString(scriptText); - - sw.Stop(); - - Console.WriteLine("Build 2: {0} ms", sw.ElapsedMilliseconds); - - - sw = Stopwatch.StartNew(); - for (int i = 0; i < ITERATIONS; i++) - { - script.Call(func); - } - sw.Stop(); - - Console.WriteLine("MoonSharp : {0} ms", sw.ElapsedMilliseconds); - - - lua.RegisterFunction("check", typeof(Program).GetMethod("NCheck")); - - File.WriteAllText(@"c:\temp\hanoi.lua", scriptText); - -#if !PROFILER - - var fn = lua.LoadFile(@"c:\temp\hanoi.lua"); - - sw = Stopwatch.StartNew(); - for (int i = 0; i < ITERATIONS; i++) - { - fn.Call(); - } - sw.Stop(); - -#endif - - Console.WriteLine("NLua : {0} ms", sw.ElapsedMilliseconds); - - Console.WriteLine("M# == NL ? {0}", g_MoonSharpStr.ToString() == g_NLuaStr.ToString()); - - Console.WriteLine("=== MoonSharp ==="); - //Console.WriteLine(g_MoonSharpStr.ToString()); - Console.WriteLine(""); - Console.WriteLine("=== NLua ==="); - //Console.WriteLine(g_NLuaStr.ToString()); - - Console.ReadKey(); - } - } -} diff --git a/src/DevTools/PerformanceComparison/Properties/AssemblyInfo.cs b/src/DevTools/PerformanceComparison/Properties/AssemblyInfo.cs deleted file mode 100644 index d2e68238..00000000 --- a/src/DevTools/PerformanceComparison/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PerformanceComparison")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PerformanceComparison")] -[assembly: AssemblyCopyright("Copyright © 2014-2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("40bffac0-24eb-4141-815d-f75076bce829")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/PerformanceComparison/Sample.cs b/src/DevTools/PerformanceComparison/Sample.cs deleted file mode 100644 index 56705a8b..00000000 --- a/src/DevTools/PerformanceComparison/Sample.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MoonSharp.Interpreter; - -namespace PerformanceComparison -{ - class Sample - { - - // This prints : - // 3 - // hello world - // 3 - // hello world - // 3 - // hello world - // 3 - // hello world - // Done - public static void xxMain() - { - string code = @" - x = 3 - - function onThis() - print(x) - x = 'hello' - end - - function onThat() - print(x .. ' world') - x = 3 - end - "; - - // Load the code - Script script = new Script(); - script.DoString(code); - - var onThis = script.Globals.Get("onThis").Function.GetDelegate(); - var onThat = script.Globals.Get("onThat").Function.GetDelegate(); - - for (int i = 0; i < 4; i++) - { - onThis(); - onThat(); - } - - Console.WriteLine("Done"); - Console.ReadKey(); - } - } -} diff --git a/src/DevTools/PerformanceComparison/app.config b/src/DevTools/PerformanceComparison/app.config deleted file mode 100644 index 884f9844..00000000 --- a/src/DevTools/PerformanceComparison/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/DevTools/Playground/App.config b/src/DevTools/Playground/App.config deleted file mode 100644 index c1fd8012..00000000 --- a/src/DevTools/Playground/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/DevTools/Playground/Playground.csproj b/src/DevTools/Playground/Playground.csproj deleted file mode 100644 index 304834cf..00000000 --- a/src/DevTools/Playground/Playground.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Debug - AnyCPU - {F039D7BE-0761-4618-BFA4-924E96584219} - Exe - Properties - Playground - Playground - v3.5 - 512 - Client - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - - - {b25a2316-6897-4caa-be0e-e784071d8199} - MoonSharp.Hardwire.net35-client - - - {91ea9b9d-fe03-4273-bdaf-8ad42ede1e59} - MoonSharp.Interpreter.net35-client - - - {43d3ad52-fed5-4305-b0f4-6b991220cd0a} - MoonSharp.RemoteDebugger.net35-client - - - - - - \ No newline at end of file diff --git a/src/DevTools/Playground/Program.cs b/src/DevTools/Playground/Program.cs deleted file mode 100644 index f570edc1..00000000 --- a/src/DevTools/Playground/Program.cs +++ /dev/null @@ -1,39 +0,0 @@ -using MoonSharp.Interpreter; -using System; -using System.Diagnostics; -using System.IO; -using MoonSharp.Interpreter.Loaders; - -namespace Test -{ - class Program - { - static void Main(string[] args) - { - ((ScriptLoaderBase)Script.DefaultOptions.ScriptLoader).ModulePaths = new string[] { "./?", "./?.lua" }; - - try - { - Script S = new Script(); - S.Options.ColonOperatorClrCallbackBehaviour = ColonOperatorBehaviour.TreatAsDotOnUserData; - - S.DoString(@" - -require 'test' -require 'test2' - -"); - - - } - catch (InterpreterException ex) - { - Console.WriteLine(ex.DecoratedMessage); - } - - Console.WriteLine(">> DONE"); - - Console.ReadKey(); - } - } -} \ No newline at end of file diff --git a/src/DevTools/Playground/Properties/AssemblyInfo.cs b/src/DevTools/Playground/Properties/AssemblyInfo.cs deleted file mode 100644 index 34cd00b0..00000000 --- a/src/DevTools/Playground/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Playground")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Playground")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3ca41a0f-4348-475f-87cb-484b3c68c79a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/Playground/Test.cs b/src/DevTools/Playground/Test.cs deleted file mode 100644 index 5f282702..00000000 --- a/src/DevTools/Playground/Test.cs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/DevTools/Playground/core.lua b/src/DevTools/Playground/core.lua deleted file mode 100644 index 450e9a29..00000000 --- a/src/DevTools/Playground/core.lua +++ /dev/null @@ -1,5 +0,0 @@ - -print "in core.lua" - -print(os.date("*t", os.time()).hour) -print(os.date("!*t", os.time()).hour) diff --git a/src/DevTools/Playground/test.lua b/src/DevTools/Playground/test.lua deleted file mode 100644 index 3761ebaf..00000000 --- a/src/DevTools/Playground/test.lua +++ /dev/null @@ -1,2 +0,0 @@ -require "core" -print("in test 1") diff --git a/src/DevTools/Playground/test2.lua b/src/DevTools/Playground/test2.lua deleted file mode 100644 index 1431f0cd..00000000 --- a/src/DevTools/Playground/test2.lua +++ /dev/null @@ -1,2 +0,0 @@ -require "core" -print("in test 2") diff --git a/src/DevTools/SynchProjects/Program.cs b/src/DevTools/SynchProjects/Program.cs deleted file mode 100755 index 5597ec99..00000000 --- a/src/DevTools/SynchProjects/Program.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Xml; - -namespace SynchProjects -{ - class Program - { - static string BASEPATH; - - static void CopyCompileFilesAsLinks(string platformName, string srcCsProj, string platformDest, string pathPrefix) - { - platformName = AdjustBasePath(platformName); - srcCsProj = AdjustBasePath(srcCsProj); - platformDest = AdjustBasePath(platformDest); - pathPrefix = AdjustBasePath(pathPrefix); - - string dstCsProj = string.Format(platformDest, platformName); - try - { - int warningCount = 0; - const string XMLNS = "http://schemas.microsoft.com/developer/msbuild/2003"; - HashSet linksDone = new HashSet(); - - Console.ForegroundColor = ConsoleColor.Gray; - Console.WriteLine("Synch vsproj compiles {0} ...", Path.GetFileNameWithoutExtension(dstCsProj)); - - XmlDocument xsrc = new XmlDocument(); - XmlDocument xdst = new XmlDocument(); - - xsrc.Load(srcCsProj); - xdst.Load(dstCsProj); - - XmlNamespaceManager sxns = new XmlNamespaceManager(xsrc.NameTable); - XmlNamespaceManager dxns = new XmlNamespaceManager(xdst.NameTable); - - sxns.AddNamespace("ms", XMLNS); - dxns.AddNamespace("ms", XMLNS); - - XmlElement srccont = xsrc.SelectSingleNode("/ms:Project/ms:ItemGroup[count(ms:Compile) != 0]", sxns) as XmlElement; - XmlElement dstcont = xdst.SelectSingleNode("/ms:Project/ms:ItemGroup[count(ms:Compile) != 0]", dxns) as XmlElement; - - // dirty hack - dstcont.InnerXml = srccont.InnerXml; - - List toRemove = new List(); - - foreach (XmlElement xe in dstcont.ChildNodes.OfType()) - { - string file = xe.GetAttribute("Include"); - string link = Path.GetFileName(file); - - if (link.Contains(".g4")) - { - toRemove.Add(xe); - continue; - } - - if (!linksDone.Add(link)) - { - ++warningCount; - Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine("\t[WARNING] - Duplicate file: {0}", link); - } - - file = pathPrefix + file; - - xe.SetAttribute("Include", file); - - XmlElement xlink = xe.OwnerDocument.CreateElement("Link", XMLNS); - xlink.InnerText = link; - xe.AppendChild(xlink); - } - - foreach (XmlElement xe in toRemove) - xe.ParentNode.RemoveChild(xe); - - xdst.Save(dstCsProj); - Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine("\t[DONE] ({0} warnings)", warningCount); - } - catch (Exception ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine("\t[ERROR] - {0}", ex.Message); - } - - Console.WriteLine("\n"); - } - - private static string AdjustBasePath(string str) - { - return str.Replace("{BASEPATH}", BASEPATH); - } - - static void Main(string[] args) - { - Console.ForegroundColor = ConsoleColor.Magenta; - Console.WriteLine("********************************************************"); - Console.WriteLine("* !! REMEMBER TO RSYNC UNITY AND .NET CORE PROJECTS !! *"); - Console.WriteLine("********************************************************"); - - - const string INTERPRETER_PROJECT = @"{BASEPATH}\MoonSharp.Interpreter\MoonSharp.Interpreter.net35-client.csproj"; - const string INTERPRETER_SUBPROJECTS_PATHS = @"{BASEPATH}\MoonSharp.Interpreter\_Projects\MoonSharp.Interpreter.{0}\MoonSharp.Interpreter.{0}.csproj"; - const string INTERPRETER_PATH_PREFIX = @"..\..\"; - - const string DEBUGGER_PROJECT = @"{BASEPATH}\MoonSharp.RemoteDebugger\MoonSharp.RemoteDebugger.net35-client.csproj"; - const string DEBUGGER_SUBPROJECTS_PATHS = @"{BASEPATH}\MoonSharp.RemoteDebugger\_Projects\MoonSharp.RemoteDebugger.{0}\MoonSharp.RemoteDebugger.{0}.csproj"; - const string DEBUGGER_PATH_PREFIX = @"..\..\"; - - const string VSCODEDEBUGGER_PROJECT = @"{BASEPATH}\MoonSharp.VsCodeDebugger\MoonSharp.VsCodeDebugger.net35-client.csproj"; - const string VSCODEDEBUGGER_SUBPROJECTS_PATHS = @"{BASEPATH}\MoonSharp.VsCodeDebugger\_Projects\MoonSharp.VsCodeDebugger.{0}\MoonSharp.VsCodeDebugger.{0}.csproj"; - const string VSCODEDEBUGGER_PATH_PREFIX = @"..\..\"; - - const string TESTS_PROJECT = @"{BASEPATH}\MoonSharp.Interpreter.Tests\MoonSharp.Interpreter.Tests.net35-client.csproj"; - const string TESTS_SUBPROJECTS_PATHS = @"{BASEPATH}\MoonSharp.Interpreter.Tests\_Projects\MoonSharp.Interpreter.Tests.{0}\MoonSharp.Interpreter.Tests.{0}.csproj"; - const string TESTS_PATH_PREFIX = @"..\..\"; - - string[] INTERPRETER_PLATFORMS = new string[] { "net40-client", "portable40" }; - string[] DEBUGGER_PLATFORMS = new string[] { "net40-client" }; - string[] VSCODEDEBUGGER_PLATFORMS = new string[] { "net40-client" }; - string[] TESTS_PLATFORMS = new string[] { "net40-client", "portable40", "Embeddable.portable40" }; - - CalcBasePath(); - - foreach (string platform in INTERPRETER_PLATFORMS) - CopyCompileFilesAsLinks(platform, INTERPRETER_PROJECT, INTERPRETER_SUBPROJECTS_PATHS, INTERPRETER_PATH_PREFIX); - - foreach (string platform in DEBUGGER_PLATFORMS) - CopyCompileFilesAsLinks(platform, DEBUGGER_PROJECT, DEBUGGER_SUBPROJECTS_PATHS, DEBUGGER_PATH_PREFIX); - - foreach (string platform in VSCODEDEBUGGER_PLATFORMS) - CopyCompileFilesAsLinks(platform, VSCODEDEBUGGER_PROJECT, VSCODEDEBUGGER_SUBPROJECTS_PATHS, VSCODEDEBUGGER_PATH_PREFIX); - - foreach (string platform in TESTS_PLATFORMS) - CopyCompileFilesAsLinks(platform, TESTS_PROJECT, TESTS_SUBPROJECTS_PATHS, TESTS_PATH_PREFIX); - - - Console.ReadLine(); - } - - private static void CalcBasePath() - { - string path = ""; - string[] dir = AppDomain.CurrentDomain.BaseDirectory.Split('\\'); - - for (int i = 0; i < dir.Length; i++) - { - if (dir[i].ToLower() == "devtools") - break; - - if (path.Length > 0) - path = path + "\\" + dir[i]; - else - path = dir[i]; - } - - BASEPATH = path; - } - } -} diff --git a/src/DevTools/SynchProjects/Properties/AssemblyInfo.cs b/src/DevTools/SynchProjects/Properties/AssemblyInfo.cs deleted file mode 100644 index 89e8f0a7..00000000 --- a/src/DevTools/SynchProjects/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SynchProjects")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SynchProjects")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a4934800-dd77-4047-b402-4eec63bbcf2f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/SynchProjects/SynchProjects.csproj b/src/DevTools/SynchProjects/SynchProjects.csproj deleted file mode 100644 index 596e56c0..00000000 --- a/src/DevTools/SynchProjects/SynchProjects.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Debug - AnyCPU - {321C9CCF-6F9B-4751-AB34-882DEE982A7E} - Exe - Properties - SynchProjects - SynchProjects - v4.0 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\Dev\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - true - bin\Devp4\ - DEBUG;TRACE - full - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/DevTools/VsCodeDebugger_Testbed/Program.cs b/src/DevTools/VsCodeDebugger_Testbed/Program.cs deleted file mode 100755 index 93db7805..00000000 --- a/src/DevTools/VsCodeDebugger_Testbed/Program.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using MoonSharp.Interpreter; -using MoonSharp.VsCodeDebugger; -using MoonSharp.VsCodeDebugger.SDK; - -namespace VsCodeDebugger_Testbed -{ - class Program - { - public static void Main(string[] argv) - { - MoonSharpVsCodeDebugServer server = new MoonSharpVsCodeDebugServer(); - server.Logger = s => Console.WriteLine(s); - server.Start(); - - Script script1 = new Script(); - script1.DoFile(@"Z:/HDD/temp/lua/fact.lua"); - server.AttachToScript(script1, "Script #1"); - Closure func1 = script1.Globals.Get("run").Function; - - Script script2 = new Script(); - script2.DoFile(@"Z:/HDD/temp/lua/fact2.lua"); - server.AttachToScript(script2, "Script #2"); - Closure func2 = script2.Globals.Get("run").Function; - - Console.WriteLine("READY."); - int i = 0; - - server.Current = null; - - while (true)//(Console.ReadKey().Key != ConsoleKey.Escape) - { - if (Console.KeyAvailable) - { - Console.ReadKey(); - server.Detach(script2); - Console.WriteLine("Detached"); - } - - Closure func = ((++i) % 2) == 0 ? func1 : func2; - - try - { - var val = func.Call(5); - Console.ForegroundColor = ConsoleColor.Magenta; - Console.WriteLine(val.Number); - System.Threading.Thread.Sleep(1000); - } - catch (InterpreterException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write(ex.DecoratedMessage); - } - } - } - } -} diff --git a/src/DevTools/VsCodeDebugger_Testbed/Properties/AssemblyInfo.cs b/src/DevTools/VsCodeDebugger_Testbed/Properties/AssemblyInfo.cs deleted file mode 100644 index 3a7bab12..00000000 --- a/src/DevTools/VsCodeDebugger_Testbed/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VsCodeDebugger_Testbed")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VsCodeDebugger_Testbed")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d17dd647-76cf-4d87-bdf7-75e1704e8783")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/DevTools/VsCodeDebugger_Testbed/VsCodeDebugger_Testbed.csproj b/src/DevTools/VsCodeDebugger_Testbed/VsCodeDebugger_Testbed.csproj deleted file mode 100644 index dc30aa4c..00000000 --- a/src/DevTools/VsCodeDebugger_Testbed/VsCodeDebugger_Testbed.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Debug - AnyCPU - {D17DD647-76CF-4D87-BDF7-75E1704E8783} - Exe - Properties - VsCodeDebugger_Testbed - VsCodeDebugger_Testbed - v3.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - {91ea9b9d-fe03-4273-bdaf-8ad42ede1e59} - MoonSharp.Interpreter.net35-client - - - {eb7d4595-299f-489b-90ac-55066a4675f9} - MoonSharp.VsCodeDebugger.net35-client - - - - - \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/.actionScriptProperties b/src/Flash/org.moonsharp.debugger.client/.actionScriptProperties deleted file mode 100644 index b9496357..00000000 --- a/src/Flash/org.moonsharp.debugger.client/.actionScriptProperties +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/.flexProperties b/src/Flash/org.moonsharp.debugger.client/.flexProperties deleted file mode 100644 index f2072112..00000000 --- a/src/Flash/org.moonsharp.debugger.client/.flexProperties +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/Flash/org.moonsharp.debugger.client/.project b/src/Flash/org.moonsharp.debugger.client/.project deleted file mode 100644 index 49bde5e9..00000000 --- a/src/Flash/org.moonsharp.debugger.client/.project +++ /dev/null @@ -1,25 +0,0 @@ - - - org.moonsharp.debugger.client - - - - - - com.adobe.flexbuilder.project.flexbuilder - - - - - - com.adobe.flexbuilder.project.flexnature - com.adobe.flexbuilder.project.actionscriptnature - - - - bin-release1 - 2 - C:/git/moonsharp/src/MoonSharp.RemoteDebugger/Resources - - - diff --git a/src/Flash/org.moonsharp.debugger.client/.settings/org.eclipse.core.resources.prefs b/src/Flash/org.moonsharp.debugger.client/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 0365aaa0..00000000 --- a/src/Flash/org.moonsharp.debugger.client/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Wed Oct 22 15:56:57 CEST 2014 -eclipse.preferences.version=1 -encoding/=utf-8 diff --git a/src/Flash/org.moonsharp.debugger.client/bin-release/Main.html b/src/Flash/org.moonsharp.debugger.client/bin-release/Main.html deleted file mode 100644 index 23738b2a..00000000 --- a/src/Flash/org.moonsharp.debugger.client/bin-release/Main.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - To view this page ensure that Adobe Flash Player version - 11.1.0 or greater is installed. - - - - - - - - - - - - - - - - - - - - - Either scripts and active content are not permitted to run or Adobe Flash Player version - 11.1.0 or greater is not installed. - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/bin-release/Main.swf b/src/Flash/org.moonsharp.debugger.client/bin-release/Main.swf deleted file mode 100644 index f461b470..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/bin-release/Main.swf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/bin-release/playerProductInstall.swf b/src/Flash/org.moonsharp.debugger.client/bin-release/playerProductInstall.swf deleted file mode 100644 index bdc34378..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/bin-release/playerProductInstall.swf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/bin-release/swfobject.js b/src/Flash/org.moonsharp.debugger.client/bin-release/swfobject.js deleted file mode 100644 index bf35c07c..00000000 --- a/src/Flash/org.moonsharp.debugger.client/bin-release/swfobject.js +++ /dev/null @@ -1,777 +0,0 @@ -/*! SWFObject v2.2 - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/src/Flash/org.moonsharp.debugger.client/html-template/index.template.html b/src/Flash/org.moonsharp.debugger.client/html-template/index.template.html deleted file mode 100644 index c3ebcb5a..00000000 --- a/src/Flash/org.moonsharp.debugger.client/html-template/index.template.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - To view this page ensure that Adobe Flash Player version - 11.1.0 or greater is installed. - - - - - - - - - - - - - - - - - - - - - Either scripts and active content are not permitted to run or Adobe Flash Player version - 11.1.0 or greater is not installed. - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/html-template/playerProductInstall.swf b/src/Flash/org.moonsharp.debugger.client/html-template/playerProductInstall.swf deleted file mode 100644 index bdc34378..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/html-template/playerProductInstall.swf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/html-template/swfobject.js b/src/Flash/org.moonsharp.debugger.client/html-template/swfobject.js deleted file mode 100644 index bf35c07c..00000000 --- a/src/Flash/org.moonsharp.debugger.client/html-template/swfobject.js +++ /dev/null @@ -1,777 +0,0 @@ -/*! SWFObject v2.2 - is released under the MIT License -*/ - -var swfobject = function() { - - var UNDEF = "undefined", - OBJECT = "object", - SHOCKWAVE_FLASH = "Shockwave Flash", - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", - FLASH_MIME_TYPE = "application/x-shockwave-flash", - EXPRESS_INSTALL_ID = "SWFObjectExprInst", - ON_READY_STATE_CHANGE = "onreadystatechange", - - win = window, - doc = document, - nav = navigator, - - plugin = false, - domLoadFnArr = [main], - regObjArr = [], - objIdArr = [], - listenersArr = [], - storedAltContent, - storedAltContentId, - storedCallbackFn, - storedCallbackObj, - isDomLoaded = false, - isExpressInstallActive = false, - dynamicStylesheet, - dynamicStylesheetMedia, - autoHideShow = true, - - /* Centralized function for browser feature detection - - User agent string detection is only used when no good alternative is possible - - Is executed directly for optimal performance - */ - ua = function() { - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, - u = nav.userAgent.toLowerCase(), - p = nav.platform.toLowerCase(), - windows = p ? /win/.test(p) : /win/.test(u), - mac = p ? /mac/.test(p) : /mac/.test(u), - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html - playerVersion = [0,0,0], - d = null; - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { - d = nav.plugins[SHOCKWAVE_FLASH].description; - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ - plugin = true; - ie = false; // cascaded feature detection for Internet Explorer - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; - } - } - else if (typeof win.ActiveXObject != UNDEF) { - try { - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); - if (a) { // a will return null when ActiveX is disabled - d = a.GetVariable("$version"); - if (d) { - ie = true; // cascaded feature detection for Internet Explorer - d = d.split(" ")[1].split(","); - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - } - catch(e) {} - } - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; - }(), - - /* Cross-browser onDomLoad - - Will fire an event as soon as the DOM of a web page is loaded - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ - - Regular onload serves as fallback - */ - onDomLoad = function() { - if (!ua.w3) { return; } - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically - callDomLoadFunctions(); - } - if (!isDomLoaded) { - if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); - } - if (ua.ie && ua.win) { - doc.attachEvent(ON_READY_STATE_CHANGE, function() { - if (doc.readyState == "complete") { - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); - callDomLoadFunctions(); - } - }); - if (win == top) { // if not inside an iframe - (function(){ - if (isDomLoaded) { return; } - try { - doc.documentElement.doScroll("left"); - } - catch(e) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - } - if (ua.wk) { - (function(){ - if (isDomLoaded) { return; } - if (!/loaded|complete/.test(doc.readyState)) { - setTimeout(arguments.callee, 0); - return; - } - callDomLoadFunctions(); - })(); - } - addLoadEvent(callDomLoadFunctions); - } - }(); - - function callDomLoadFunctions() { - if (isDomLoaded) { return; } - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); - t.parentNode.removeChild(t); - } - catch (e) { return; } - isDomLoaded = true; - var dl = domLoadFnArr.length; - for (var i = 0; i < dl; i++) { - domLoadFnArr[i](); - } - } - - function addDomLoadEvent(fn) { - if (isDomLoaded) { - fn(); - } - else { - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ - } - } - - /* Cross-browser onload - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ - - Will fire an event as soon as a web page including all of its assets are loaded - */ - function addLoadEvent(fn) { - if (typeof win.addEventListener != UNDEF) { - win.addEventListener("load", fn, false); - } - else if (typeof doc.addEventListener != UNDEF) { - doc.addEventListener("load", fn, false); - } - else if (typeof win.attachEvent != UNDEF) { - addListener(win, "onload", fn); - } - else if (typeof win.onload == "function") { - var fnOld = win.onload; - win.onload = function() { - fnOld(); - fn(); - }; - } - else { - win.onload = fn; - } - } - - /* Main function - - Will preferably execute onDomLoad, otherwise onload (as a fallback) - */ - function main() { - if (plugin) { - testPlayerVersion(); - } - else { - matchVersions(); - } - } - - /* Detect the Flash Player version for non-Internet Explorer browsers - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: - a. Both release and build numbers can be detected - b. Avoid wrong descriptions by corrupt installers provided by Adobe - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available - */ - function testPlayerVersion() { - var b = doc.getElementsByTagName("body")[0]; - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - var t = b.appendChild(o); - if (t) { - var counter = 0; - (function(){ - if (typeof t.GetVariable != UNDEF) { - var d = t.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - } - else if (counter < 10) { - counter++; - setTimeout(arguments.callee, 10); - return; - } - b.removeChild(o); - t = null; - matchVersions(); - })(); - } - else { - matchVersions(); - } - } - - /* Perform Flash Player and SWF version matching; static publishing only - */ - function matchVersions() { - var rl = regObjArr.length; - if (rl > 0) { - for (var i = 0; i < rl; i++) { // for each registered object element - var id = regObjArr[i].id; - var cb = regObjArr[i].callbackFn; - var cbObj = {success:false, id:id}; - if (ua.pv[0] > 0) { - var obj = getElementById(id); - if (obj) { - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! - setVisibility(id, true); - if (cb) { - cbObj.success = true; - cbObj.ref = getObjectById(id); - cb(cbObj); - } - } - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported - var att = {}; - att.data = regObjArr[i].expressInstall; - att.width = obj.getAttribute("width") || "0"; - att.height = obj.getAttribute("height") || "0"; - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } - // parse HTML object param element's name-value pairs - var par = {}; - var p = obj.getElementsByTagName("param"); - var pl = p.length; - for (var j = 0; j < pl; j++) { - if (p[j].getAttribute("name").toLowerCase() != "movie") { - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); - } - } - showExpressInstall(att, par, id, cb); - } - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF - displayAltContent(obj); - if (cb) { cb(cbObj); } - } - } - } - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) - setVisibility(id, true); - if (cb) { - var o = getObjectById(id); // test whether there is an HTML object element or not - if (o && typeof o.SetVariable != UNDEF) { - cbObj.success = true; - cbObj.ref = o; - } - cb(cbObj); - } - } - } - } - } - - function getObjectById(objectIdStr) { - var r = null; - var o = getElementById(objectIdStr); - if (o && o.nodeName == "OBJECT") { - if (typeof o.SetVariable != UNDEF) { - r = o; - } - else { - var n = o.getElementsByTagName(OBJECT)[0]; - if (n) { - r = n; - } - } - } - return r; - } - - /* Requirements for Adobe Express Install - - only one instance can be active at a time - - fp 6.0.65 or higher - - Win/Mac OS only - - no Webkit engines older than version 312 - */ - function canExpressInstall() { - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); - } - - /* Show the Adobe Express Install dialog - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 - */ - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { - isExpressInstallActive = true; - storedCallbackFn = callbackFn || null; - storedCallbackObj = {success:false, id:replaceElemIdStr}; - var obj = getElementById(replaceElemIdStr); - if (obj) { - if (obj.nodeName == "OBJECT") { // static publishing - storedAltContent = abstractAltContent(obj); - storedAltContentId = null; - } - else { // dynamic publishing - storedAltContent = obj; - storedAltContentId = replaceElemIdStr; - } - att.id = EXPRESS_INSTALL_ID; - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + fv; - } - else { - par.flashvars = fv; - } - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - if (ua.ie && ua.win && obj.readyState != 4) { - var newObj = createElement("div"); - replaceElemIdStr += "SWFObjectNew"; - newObj.setAttribute("id", replaceElemIdStr); - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - createSWF(att, par, replaceElemIdStr); - } - } - - /* Functions to abstract and display alternative content - */ - function displayAltContent(obj) { - if (ua.ie && ua.win && obj.readyState != 4) { - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work - var el = createElement("div"); - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content - el.parentNode.replaceChild(abstractAltContent(obj), el); - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - obj.parentNode.removeChild(obj); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.replaceChild(abstractAltContent(obj), obj); - } - } - - function abstractAltContent(obj) { - var ac = createElement("div"); - if (ua.win && ua.ie) { - ac.innerHTML = obj.innerHTML; - } - else { - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; - if (nestedObj) { - var c = nestedObj.childNodes; - if (c) { - var cl = c.length; - for (var i = 0; i < cl; i++) { - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { - ac.appendChild(c[i].cloneNode(true)); - } - } - } - } - } - return ac; - } - - /* Cross-browser dynamic SWF creation - */ - function createSWF(attObj, parObj, id) { - var r, el = getElementById(id); - if (ua.wk && ua.wk < 312) { return r; } - if (el) { - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content - attObj.id = id; - } - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML - var att = ""; - for (var i in attObj) { - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries - if (i.toLowerCase() == "data") { - parObj.movie = attObj[i]; - } - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - att += ' class="' + attObj[i] + '"'; - } - else if (i.toLowerCase() != "classid") { - att += ' ' + i + '="' + attObj[i] + '"'; - } - } - } - var par = ""; - for (var j in parObj) { - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries - par += ''; - } - } - el.outerHTML = '' + par + ''; - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) - r = getElementById(attObj.id); - } - else { // well-behaving browsers - var o = createElement(OBJECT); - o.setAttribute("type", FLASH_MIME_TYPE); - for (var m in attObj) { - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword - o.setAttribute("class", attObj[m]); - } - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute - o.setAttribute(m, attObj[m]); - } - } - } - for (var n in parObj) { - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element - createObjParam(o, n, parObj[n]); - } - } - el.parentNode.replaceChild(o, el); - r = o; - } - } - return r; - } - - function createObjParam(el, pName, pValue) { - var p = createElement("param"); - p.setAttribute("name", pName); - p.setAttribute("value", pValue); - el.appendChild(p); - } - - /* Cross-browser SWF removal - - Especially needed to safely and completely remove a SWF in Internet Explorer - */ - function removeSWF(id) { - var obj = getElementById(id); - if (obj && obj.nodeName == "OBJECT") { - if (ua.ie && ua.win) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - removeObjectInIE(id); - } - else { - setTimeout(arguments.callee, 10); - } - })(); - } - else { - obj.parentNode.removeChild(obj); - } - } - } - - function removeObjectInIE(id) { - var obj = getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - } - - /* Functions to optimize JavaScript compression - */ - function getElementById(id) { - var el = null; - try { - el = doc.getElementById(id); - } - catch (e) {} - return el; - } - - function createElement(el) { - return doc.createElement(el); - } - - /* Updated attachEvent function for Internet Explorer - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks - */ - function addListener(target, eventType, fn) { - target.attachEvent(eventType, fn); - listenersArr[listenersArr.length] = [target, eventType, fn]; - } - - /* Flash Player and SWF content version matching - */ - function hasPlayerVersion(rv) { - var pv = ua.pv, v = rv.split("."); - v[0] = parseInt(v[0], 10); - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" - v[2] = parseInt(v[2], 10) || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - } - - /* Cross-browser dynamic CSS creation - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php - */ - function createCSS(sel, decl, media, newStyle) { - if (ua.ie && ua.mac) { return; } - var h = doc.getElementsByTagName("head")[0]; - if (!h) { return; } // to also support badly authored HTML pages that lack a head element - var m = (media && typeof media == "string") ? media : "screen"; - if (newStyle) { - dynamicStylesheet = null; - dynamicStylesheetMedia = null; - } - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { - // create dynamic stylesheet + get a global reference to it - var s = createElement("style"); - s.setAttribute("type", "text/css"); - s.setAttribute("media", m); - dynamicStylesheet = h.appendChild(s); - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; - } - dynamicStylesheetMedia = m; - } - // add style rule - if (ua.ie && ua.win) { - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { - dynamicStylesheet.addRule(sel, decl); - } - } - else { - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); - } - } - } - - function setVisibility(id, isVisible) { - if (!autoHideShow) { return; } - var v = isVisible ? "visible" : "hidden"; - if (isDomLoaded && getElementById(id)) { - getElementById(id).style.visibility = v; - } - else { - createCSS("#" + id, "visibility:" + v); - } - } - - /* Filter to avoid XSS attacks - */ - function urlEncodeIfNecessary(s) { - var regex = /[\\\"<>\.;]/; - var hasBadChars = regex.exec(s) != null; - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; - } - - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) - */ - var cleanup = function() { - if (ua.ie && ua.win) { - window.attachEvent("onunload", function() { - // remove listeners to avoid memory leaks - var ll = listenersArr.length; - for (var i = 0; i < ll; i++) { - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); - } - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect - var il = objIdArr.length; - for (var j = 0; j < il; j++) { - removeSWF(objIdArr[j]); - } - // cleanup library's main closures to avoid memory leaks - for (var k in ua) { - ua[k] = null; - } - ua = null; - for (var l in swfobject) { - swfobject[l] = null; - } - swfobject = null; - }); - } - }(); - - return { - /* Public API - - Reference: http://code.google.com/p/swfobject/wiki/documentation - */ - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { - if (ua.w3 && objectIdStr && swfVersionStr) { - var regObj = {}; - regObj.id = objectIdStr; - regObj.swfVersion = swfVersionStr; - regObj.expressInstall = xiSwfUrlStr; - regObj.callbackFn = callbackFn; - regObjArr[regObjArr.length] = regObj; - setVisibility(objectIdStr, false); - } - else if (callbackFn) { - callbackFn({success:false, id:objectIdStr}); - } - }, - - getObjectById: function(objectIdStr) { - if (ua.w3) { - return getObjectById(objectIdStr); - } - }, - - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { - var callbackObj = {success:false, id:replaceElemIdStr}; - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { - setVisibility(replaceElemIdStr, false); - addDomLoadEvent(function() { - widthStr += ""; // auto-convert to string - heightStr += ""; - var att = {}; - if (attObj && typeof attObj === OBJECT) { - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs - att[i] = attObj[i]; - } - } - att.data = swfUrlStr; - att.width = widthStr; - att.height = heightStr; - var par = {}; - if (parObj && typeof parObj === OBJECT) { - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs - par[j] = parObj[j]; - } - } - if (flashvarsObj && typeof flashvarsObj === OBJECT) { - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs - if (typeof par.flashvars != UNDEF) { - par.flashvars += "&" + k + "=" + flashvarsObj[k]; - } - else { - par.flashvars = k + "=" + flashvarsObj[k]; - } - } - } - if (hasPlayerVersion(swfVersionStr)) { // create SWF - var obj = createSWF(att, par, replaceElemIdStr); - if (att.id == replaceElemIdStr) { - setVisibility(replaceElemIdStr, true); - } - callbackObj.success = true; - callbackObj.ref = obj; - } - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install - att.data = xiSwfUrlStr; - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - return; - } - else { // show alternative content - setVisibility(replaceElemIdStr, true); - } - if (callbackFn) { callbackFn(callbackObj); } - }); - } - else if (callbackFn) { callbackFn(callbackObj); } - }, - - switchOffAutoHideShow: function() { - autoHideShow = false; - }, - - ua: ua, - - getFlashPlayerVersion: function() { - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; - }, - - hasFlashPlayerVersion: hasPlayerVersion, - - createSWF: function(attObj, parObj, replaceElemIdStr) { - if (ua.w3) { - return createSWF(attObj, parObj, replaceElemIdStr); - } - else { - return undefined; - } - }, - - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { - if (ua.w3 && canExpressInstall()) { - showExpressInstall(att, par, replaceElemIdStr, callbackFn); - } - }, - - removeSWF: function(objElemIdStr) { - if (ua.w3) { - removeSWF(objElemIdStr); - } - }, - - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { - if (ua.w3) { - createCSS(selStr, declStr, mediaStr, newStyleBoolean); - } - }, - - addDomLoadEvent: addDomLoadEvent, - - addLoadEvent: addLoadEvent, - - getQueryParamValue: function(param) { - var q = doc.location.search || doc.location.hash; - if (q) { - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark - if (param == null) { - return urlEncodeIfNecessary(q); - } - var pairs = q.split("&"); - for (var i = 0; i < pairs.length; i++) { - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); - } - } - } - return ""; - }, - - // For internal usage only - expressInstallCallback: function() { - if (isExpressInstallActive) { - var obj = getElementById(EXPRESS_INSTALL_ID); - if (obj && storedAltContent) { - obj.parentNode.replaceChild(storedAltContent, obj); - if (storedAltContentId) { - setVisibility(storedAltContentId, true); - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } - } - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } - } - isExpressInstallActive = false; - } - } - }; -}(); diff --git a/src/Flash/org.moonsharp.debugger.client/org.moonsharp.debugger.client.as3proj b/src/Flash/org.moonsharp.debugger.client/org.moonsharp.debugger.client.as3proj deleted file mode 100644 index 377d886d..00000000 --- a/src/Flash/org.moonsharp.debugger.client/org.moonsharp.debugger.client.as3proj +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/AboutBox.mxml b/src/Flash/org.moonsharp.debugger.client/src/AboutBox.mxml deleted file mode 100644 index c4b1f91f..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/AboutBox.mxml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/CustomButtonSkin.mxml b/src/Flash/org.moonsharp.debugger.client/src/CustomButtonSkin.mxml deleted file mode 100644 index 9068d4b5..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/CustomButtonSkin.mxml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/CustomDataGridSkin.mxml b/src/Flash/org.moonsharp.debugger.client/src/CustomDataGridSkin.mxml deleted file mode 100644 index b12a96ed..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/CustomDataGridSkin.mxml +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - 0)) - { - dataGrid.styleManager.getColorNames(colors); // lazily replace color names with ints - rowBackgroundFillColor.color = colors[rowIndex % colors.length]; - } - else - { - // This should be the same as bgFill.color. - rowBackgroundFillColor.color = 0xFFFFFF; - } - } - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/DebuggerViewLogic.as b/src/Flash/org.moonsharp.debugger.client/src/DebuggerViewLogic.as deleted file mode 100644 index 2697f85a..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/DebuggerViewLogic.as +++ /dev/null @@ -1,299 +0,0 @@ -package -{ - import flash.display.LoaderInfo; - import flash.events.*; - import flash.external.ExternalInterface; - import flash.net.XMLSocket; - import flash.system.Security; - import flash.system.System; - import flash.utils.Dictionary; - - import mx.collections.ArrayList; - import mx.controls.Alert; - import mx.controls.List; - import mx.core.FlexGlobals; - import mx.managers.BrowserManager; - import mx.managers.IBrowserManager; - import mx.utils.URLUtil; - - public class DebuggerViewLogic - { - private var m_View : Main; - private var m_Socket : XMLSocket; - - private var m_Sources : Dictionary = new Dictionary(); - private var m_SourceList : ArrayList = new ArrayList(); - - private var m_InstructionPtrHighlight : Highlight = null; - - private var m_ErrorRx:String; - - - public function DebuggerViewLogic(view : Main, loaderInfo: LoaderInfo) - { - m_View = view; - - var domain:String = getDomain(); - var port:int = 1; - - if (domain == null) - { - domain = "127.0.0.1"; - port = 2006; - logMessage("Running under Flex debugger ? Assuming default host/port."); - } - else - { - var portstr:String = FlexGlobals.topLevelApplication.parameters.port; - - logMessage(portstr); - port = int(portstr); - } - - logMessage("Connecting to: " + domain + ":" + port); - - m_Socket = new XMLSocket(domain, port); - - m_Socket.addEventListener(Event.CLOSE, closeHandler); - m_Socket.addEventListener(Event.CONNECT, connectHandler); - m_Socket.addEventListener(DataEvent.DATA, dataHandler); - m_Socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); - m_Socket.addEventListener(ProgressEvent.PROGRESS, progressHandler); - m_Socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); - } - - public function getDomain():String - { - var domain:String = Security.pageDomain; - if (domain == null) return null; - - return URLUtil.getServerName(domain); - } - - - - private function closeHandler(event:Event):void { - onFatalError("Connection closed."); - } - - private function connectHandler(event:Event):void { - trace("connectHandler: " + event); - logMessage("Connection with host established."); - m_Socket.send(); - } - - private function dataHandler(event:DataEvent):void { - - var xml:XML = new XML(event.data); - - var cmd:String = xml.name(); - var list:ArrayList; - - if (cmd == "welcome") - { - m_View.welcome(xml.@app, xml.@moonsharpver); - refresh(); - } - else if (cmd == "source-code") - { - var s : SourceCode = new SourceCode(xml); - m_Sources[s.getId()] = s; - m_SourceList.addItem(s); - m_View.refreshSourceCode(s, m_SourceList); - } - else if (cmd == "source-loc") - { - m_InstructionPtrHighlight = parseHighlight(xml); - m_View.refreshInstructionPtrHighlight(true); - } - else if (cmd == "execution-completed") - { - m_InstructionPtrHighlight = null; - m_View.refreshInstructionPtrHighlight(true); - logMessage("Execution completed."); - } - else if (cmd == "callstack") - { - list = parseWatchData(xml); - m_View.refreshCallStack(list); - } - else if (cmd == "watches") - { - list = parseWatchData(xml); - m_View.refreshWatches(list); - } - else if (cmd == "message") - { - logMessage(xml.toString()); - } - else if (cmd == "breakpoints") - { - refreshBreakpoints(xml); - } - else if (cmd == "error_rx") - { - m_ErrorRx = xml.@arg; - } - } - - public function getInstructionPtrHighlight():Highlight - { - return m_InstructionPtrHighlight; - } - - private function parseWatchData(xml:XML):ArrayList - { - var list:ArrayList = new ArrayList(); - - var items : XMLList = xml.elements(); - - for each (var item : XML in items) - { - var watch:WatchItem = new WatchItem(item); - list.addItem(watch); - } - - return list; - } - - - private function parseHighlight(xml:XML):Highlight - { - var srcid:int = xml.@srcid; - var cf:int = xml.@cf; - var ct:int = xml.@ct; - var lf:int = xml.@lf; - var lt:int = xml.@lt; - - if (m_Sources.hasOwnProperty(srcid)) - { - var src:SourceCode = m_Sources[srcid] as SourceCode; - - var from:int = src.flattenLocation(lf, cf); - var to:int = src.flattenLocation(lt, ct); - - return new Highlight(src, from, to); - } - else - { - logMessage("ERROR: Highlighted source " + srcid.toString() + " not found in sources list."); - return null; - } - } - - public function logMessage(text : String) : void - { - m_View.appendMessage(text); - } - - - private function onFatalError(text : String) : void - { - logMessage(text); - - Alert.show("An error occurred while communicating with the scripting host.\n\nPress OK to reload and retry.\n\nError was:" + text, "Error", Alert.OK, m_View, function():void - { - ExternalInterface.call("document.location.reload", true); - }); - } - - private function ioErrorHandler(event:IOErrorEvent):void { - onFatalError("IO Error : " + event.text); - } - - private function progressHandler(event:ProgressEvent):void { - // trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal); - } - - private function securityErrorHandler(event:SecurityErrorEvent):void { - onFatalError("IO Error : " + event.text); - } - - private function refreshBreakpoints(xml : XML): void - { - for(var i:int = 0; i < m_SourceList.length; i++) - m_SourceList.getItemAt(i).Breakpoints= new Vector.(); - - for each(var x:XML in xml.elements()) - { - var hl:Highlight = parseHighlight(x); - - if (hl != null) - hl.Source.Breakpoints.push(hl); - } - - m_View.refreshBreakpoints(); - } - - public function refresh() : void - { - m_Socket.send(); - } - - public function stepIn() : void - { - m_Socket.send(); - } - - public function stepOut() : void - { - m_Socket.send(); - } - - public function stepOver() : void - { - m_Socket.send(); - } - - public function run() : void - { - m_Socket.send(); - } - - public function pause() : void - { - m_Socket.send(); - } - - public function addWatch(varNames : String) : void - { - var cmd:XML = ; - cmd.@arg = varNames; - m_Socket.send(cmd); - } - - public function removeWatch(varNames : String) : void - { - var cmd:XML = ; - cmd.@arg = varNames; - m_Socket.send(cmd); - } - - - public function toggleBreakpoint(src:int, line:int, col:int, action:String) : void - { - var cmd:XML = ; - cmd.@arg = action; - cmd.@src = src; - cmd.@line = line; - cmd.@col = col; - m_Socket.send(cmd); - } - - public function getErrorRx():String - { - return m_ErrorRx; - } - - public function setErrorRx(val:String):void - { - m_ErrorRx = val; - var cmd:XML = ; - cmd.@arg = val; - m_Socket.send(cmd); - } - - - - } -} \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/Highlight.as b/src/Flash/org.moonsharp.debugger.client/src/Highlight.as deleted file mode 100644 index 1e15de9c..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/Highlight.as +++ /dev/null @@ -1,17 +0,0 @@ -package -{ - public class Highlight - { - public function Highlight(source:SourceCode, from:int, to:int) - { - Source = source; - From = from; - To = to; - } - - public var From:int; - public var To:int; - public var Source:SourceCode; - - } -} \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/InputBox.mxml b/src/Flash/org.moonsharp.debugger.client/src/InputBox.mxml deleted file mode 100644 index a7d388da..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/InputBox.mxml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - 0); - } - - protected function btnOK_clickHandler(event:MouseEvent):void - { - if (!m_Closed) PopUpManager.removePopUp(this); - m_Closed = true; - m_CallBackFunc(txtText.text); - } - - protected function btnCancel_clickHandler(event:MouseEvent):void - { - if (!m_Closed) PopUpManager.removePopUp(this); - m_Closed = true; - - m_CallBackFunc(null); - } - - protected function onLoaded(event:FlexEvent):void - { - txtText.text = m_Default; - lblHelp.text = m_Label; - btnOK.enabled = (txtText.text.length > 0); - txtText.selectAll(); - focusManager.setFocus(txtText); - } - - ]]> - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/MXFTEText.css b/src/Flash/org.moonsharp.debugger.client/src/MXFTEText.css deleted file mode 100644 index 64b9d7c3..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/MXFTEText.css +++ /dev/null @@ -1,237 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/* - This style sheet configures many -- but not all -- MX components - to use the new Flash Text Engine (FTE) and Text Layout Framework (TLF) - to display and edit text, rather than using the older TextField class. - - If you are using the command-line MXML compiler, you should apply - this style sheet as one of the themes for your application: - - mxmlc -theme+=frameworks/projects/spark/MXFTEText.css MyApp.mxml - - FTE and TLF provide text rendering and editing - with high-quality international typography and layout. - They support displaying left-to-right (ltr) text such as French, - right-to-left (rtl) text such as Arabic, and bidirectional text - such as a French phrase inside of an Arabic sentence. - FTE and TLF are used for all text rendering in Spark components. - - By using this style sheet, your MX and Spark components can use - the same embedded font; otherwise, you have to embed a font twice, - once with embedAsCFF="true" for Spark components using FTE/TLF - and once with embedAsCFF="false" for MX components using TextField. - - Note: The , , and - components are not supported by this style sheet, because the - FTETextField class does not support all the functionality - that TextField supports. - You should use the , , and - components instead if you require FTE/TLF text. - - You should not modify this file. -*/ - -@namespace charts "mx.charts.chartClasses.*"; -@namespace mx "library://ns.adobe.com/flex/mx"; -@namespace mxair "mx.core.windowClasses.*"; -@namespace olap "mx.controls.olapDataGridClasses.*"; -@namespace s "library://ns.adobe.com/flex/spark"; - -mx|AlertForm -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|Button -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|CalendarLayout -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|ColorPicker -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -mx|ComboBox -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -mx|DataGrid -{ - defaultDataGridItemEditor: ClassReference("mx.controls.MXFTETextInput"); - defaultDataGridItemRenderer: ClassReference("mx.controls.dataGridClasses.FTEDataGridItemRenderer"); -} - -mx|DateChooser -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|DateField -{ - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -s|FTEDataGridItemRenderer -{ - paddingLeft: 5 /* to match DataGridItemRenderer in the MX defaults.css */ -} - -mx|Label -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|List -{ - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -mx|ListItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|MenuBarItem -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|MenuItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -s|MXFTETextInput -{ - skinClass: ClassReference("spark.skins.spark.TextInputSkin"); -} - -mx|NumericStepper -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -mx|Panel -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|ProgressBar -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|SwatchPanel -{ - textInputClass: ClassReference("mx.controls.MXFTETextInput"); -} - -mx|TileListItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|TreeItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|ToolTip -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|AdvancedDataGrid -{ - defaultDataGridItemEditor: ClassReference("mx.controls.MXFTETextInput"); - defaultDataGridItemRenderer: ClassReference("mx.controls.advancedDataGridClasses.FTEAdvancedDataGridItemRenderer"); -} - -mx|AdvancedDataGridGroupItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|AdvancedDataGridHeaderRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|AdvancedDataGridSortItemRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mxair|StatusBar -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mxair|TitleBar -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -charts|ChartLabel -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -charts|DataTip -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -charts|DualStyleObject -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -charts|Series -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -mx|LegendItem -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -olap|OLAPDataGridGroupRenderer -{ - textFieldClass: ClassReference("mx.core.UIFTETextField"); -} - -s|FTEAdvancedDataGridItemRenderer -{ - paddingLeft: 5 /* to match AdvancedDataGridItemRenderer in the MX defaults.css */ -} - diff --git a/src/Flash/org.moonsharp.debugger.client/src/Main.css b/src/Flash/org.moonsharp.debugger.client/src/Main.css deleted file mode 100644 index 08dfdfa1..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/Main.css +++ /dev/null @@ -1,154 +0,0 @@ -@namespace s "library://ns.adobe.com/flex/spark"; -@namespace mx "library://ns.adobe.com/flex/mx"; - -@font-face -{ - src: url("assets/Ubuntu-R.ttf"); - fontFamily: Ubuntu; - fontStyle: normal; - fontWeight: normal; - embed-as-cff: true; - advancedAntiAliasing: false; -} - -@font-face -{ - src: url("assets/Ubuntu-B.ttf"); - fontFamily: Ubuntu; - fontStyle: normal; - fontWeight: bold; - embed-as-cff: true; - advancedAntiAliasing: false; -} - -@font-face -{ - src: url("assets/UbuntuMono-R.ttf"); - fontFamily: UbuntuMono; - fontStyle: normal; - fontWeight: normal; - advancedAntiAliasing: true; -} - -global -{ - fontFamily: Ubuntu; - contentBackgroundColor: #555555; - chrome-color: #333333; - color: #EEEEEE; - symbol-color: #000000; - roll-over-color: #777777; - selection-color: #B1AEFA; - accent-color: #8C8C8C; - focus-color: #B1AEFA; - focusAlpha: 1; -} - -mx|Alert, mx|TitleWindow, mx|MenuBar, mx|Panel -{ - /* fontFamily: UbuntuMx; */ -} - - -mx|CheckBox,s|CheckBox -{ - symbolColor: #b1aefa; -} - - -s|List -{ - roll-over-color: #777777; - selection-color: #B1AEFA; -} - -s|Button -{ - cornerRadius: 0; - skinClass:ClassReference("CustomButtonSkin"); - borderWeight: 1; - borderColor: #000000; -} - -s|Button:over -{ - chrome-color: #999999; - borderColor: #b1aefa; - borderWeight: 1; - cornerRadius: 0; -} - -s|Button:down -{ - chrome-color: #222222; - borderColor: #b1aefa; - borderWeight: 1; - cornerRadius: 0; -} - -/* // mx|TabNavigator,mx|SwatchPanel */ - -s|Panel,mx|TitleWindow -{ - background-color: #666666; -} - -s|TextArea -{ - color: #CCCCCC; - background-color: #555555; - contentBackgroundColor: #555555; -} - -s|Panel -{ - chrome-color: #222222; - borderAlpha: 0.5; - borderColor: 0; - cornerRadius: 0; - dropShadowVisible: true; - background-color: #484848; -} - -s|RichEditableText -{ - focusedTextSelectionColor: #777777; - unfocusedTextSelectionColor: #777777; -} - - -mx|Accordion -{ - openDuration: 320; - chrome-color: #222222; -} - -s|DropDownList -{ - borderVisible : false; - contentBackgroundColor: #555555; -} - -s|DataGrid -{ - alternatingRowColors : #505050, #555555; - skinClass: ClassReference("CustomDataGridSkin") -} - -mx|ToolTip -{ - color: #000000; -} - - -mx|MenuBar -{ - selectionColor: #B1AEFA; - leading: 0; - contentBackgroundColor: #777777; - roll-over-color: #B1AEFA; -} - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/Main.mxml b/src/Flash/org.moonsharp.debugger.client/src/Main.mxml deleted file mode 100644 index c438dd6e..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/Main.mxml +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >; - - private function initializeApp():void { - menuBarCollection = new XMLListCollection(menubarXML); - } - - private function menuHandler(evt:MenuEvent):void - { - var cmd : String = evt.item.@data; - - if (cmd != "top") exec(cmd); - } - - - private var m_Debugger : DebuggerViewLogic; - - protected function application_applicationCompleteHandler(event:FlexEvent):void - { - m_Debugger = new DebuggerViewLogic(this, this.loaderInfo); - systemManager.addEventListener(KeyboardEvent.KEY_UP, shortcutListener, true); - } - - private function shortcutListener(e:KeyboardEvent):void - { - if (m_DisableKeys) return; - - switch(e.keyCode) - { - case 73: - exec("stepin"); - break; - case 79: - exec("stepover"); - break; - case 85: - exec("stepout"); - break; - case 82: - exec("run"); - break; - case 80: - exec("pause"); - break; - case 66: - exec("breakpoint"); - break; - case 71: - exec("step_current"); - break; - case 45: - exec("add"); - break; - case 46: - exec("remove"); - break; - case 87: - exec("watch"); - break; - } - - - } - - public function refreshSourceCode(s : SourceCode, l : ArrayList) : void - { - var sel:int = lstSources.selectedIndex; - - lstSources.dataProvider = l; - - if (sel >= 0) - { - lstSources.selectedIndex = sel; - lstSources_changeHandler(null); - } - else - { - lstSources.selectedIndex = 0; - lstSources_changeHandler(null); - } - } - - public function refreshInstructionPtrHighlight(switchToSource:Boolean) : void - { - var hl:Highlight = m_Debugger.getInstructionPtrHighlight(); - - if (switchToSource && hl !== null && hl.Source !== m_CurrentSrc) - { - selectSource(hl.Source); - } - - var tlf:TextLayoutFormat = new TextLayoutFormat(); - tlf.backgroundColor = 0x444444; - - txtCode.setFormatOfRange(tlf, 0, txtCode.text.length - 1); - - if (hl !== null && hl.Source === m_CurrentSrc) - { - var tlf2:TextLayoutFormat = new TextLayoutFormat(); - tlf2.backgroundColor = 0x645ef5; - - txtCode.setFormatOfRange(tlf2, hl.From, hl.To); - moveCaret(hl.To); - } - } - - public function refreshBreakpoints() : void - { - if (m_CurrentSrc == null) return; - - var tlf:TextLayoutFormat = new TextLayoutFormat(); - tlf.color = 0xEEEEEE; - - txtCode.setFormatOfRange(tlf, 0, txtCode.text.length - 1); - - var tlf2:TextLayoutFormat = new TextLayoutFormat(); - tlf2.color = 0xff0000; - - for(var i:int = 0; i < m_CurrentSrc.Breakpoints.length; i++) - { - var hl:Highlight = m_CurrentSrc.Breakpoints[i]; - txtCode.setFormatOfRange(tlf2, hl.From, hl.To); - } - } - - private var m_CurrentSrc:SourceCode = null; - - public function refreshCallStack(l : ArrayList):void - { - gridStack.dataProvider = l; - } - - public function refreshWatches(l : ArrayList):void - { - gridWatches.dataProvider = l; - } - - private function selectSource(S : SourceCode) : void - { - lstSources.selectedItem = S; - lstSources_changeHandler(null); - } - - protected function lstSources_changeHandler(event:IndexChangeEvent):void - { - var S : SourceCode = (SourceCode)(lstSources.selectedItem); - txtCode.text = S.getText(); - m_CurrentSrc = S; - refreshInstructionPtrHighlight(false); - refreshBreakpoints(); - updateCaretLabel(); - } - - protected function getSourceName(o : Object) : String - { - var S : SourceCode = o as SourceCode; - return S.getId() + " : " + S.getName(); - } - - public function welcome(appName : String, ver : String): void - { - titleBar.text = "MoonSharp Remote Debugger - [" + appName + "] - v" + ver; - } - - public function appendMessage(text : String) : void - { - textOutput.text += text + "\n"; - textOutput.scrollToRange(int.MAX_VALUE, int.MAX_VALUE); - } - - protected function txtCode_changingHandler(event:TextOperationEvent):void - { - event.preventDefault(); - } - - protected function toggleBreakpoint(cmdType:String) : void - { - if (m_CurrentSrc == null) return; - - var cursor:int = txtCode.selectionActivePosition; - var line:int = m_CurrentSrc.inflateLocationLine(cursor); - var col:int = m_CurrentSrc.inflateLocationColumn(cursor, line); - - m_Debugger.toggleBreakpoint(m_CurrentSrc.getId(), line, col, cmdType); - } - - protected function moveCaret(where : int) : void - { - txtCode.setFocus(); - txtCode.selectRange(where, where); - txtCode.scrollToRange(where, where); - updateCaretLabel(); - } - - protected function updateCaretLabel() : void - { - if (m_CurrentSrc == null) return; - - var cursor:int = txtCode.selectionActivePosition; - var line:int = m_CurrentSrc.inflateLocationLine(cursor); - var col:int = m_CurrentSrc.inflateLocationColumn(cursor, line); - - txtCaret.text = m_CurrentSrc.getName() + ":" + line.toString() + ","+col.toString(); - } - - - public function exec(cmd:String) : void - { - var wi:WatchItem; - - if (cmd == "about") AboutBox.show(this); - else if (cmd == "stepin") m_Debugger.stepIn(); - else if (cmd == "stepout") m_Debugger.stepOut(); - else if (cmd == "stepover") m_Debugger.stepOver(); - else if (cmd == "run") m_Debugger.run(); - else if (cmd == "pause") m_Debugger.pause(); - else if (cmd == "step_current") refreshInstructionPtrHighlight(true); - else if (cmd == "breakpoint") toggleBreakpoint("toggle"); - else if (cmd == "set_breakpoint") toggleBreakpoint("set"); - else if (cmd == "clear_breakpoint") toggleBreakpoint("clear"); - else if (cmd == "error_rx") - { - m_DisableKeys = true; - - InputBox.show(this, "Error RegEx", - "Insert a regular expression which matches error messages you want to stop on.", m_Debugger.getErrorRx(), - - function(str:String):void - { - m_DisableKeys = false; - - if (str !== null && str !== "") - m_Debugger.setErrorRx(str); - }); - } - else if (cmd == "add") - { - m_DisableKeys = true; - - InputBox.show(this, "Add watch...", "Enter the name of the variables you want to watch, separated by ',' if more than one is desired", "", function(str:String):void - { - m_DisableKeys = false; - - if (str !== null && str !== "") - m_Debugger.addWatch(str); - }); - } - else if (cmd == "remove") - { - var str:String = ""; - - for each(wi in gridWatches.selectedItems) - { - if (str.length > 0) - str += ","; - - str += wi.Name; - } - - if (str.length > 0) - m_Debugger.removeWatch(str); - } - else if (cmd == "watch") - { - wi = gridWatches.selectedItem as WatchItem; - - if (wi != null) - { - Alert.show("Value = " + wi.Value + "\n" + - "Type = " + wi.Type + "\n" + - "Scope = " + wi.LValue, wi.Name); - } - } - else - { - Alert.show("Unknown command " + cmd, "Error", Alert.OK, this); - } - } - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/Resource.as b/src/Flash/org.moonsharp.debugger.client/src/Resource.as deleted file mode 100644 index df153d9a..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/Resource.as +++ /dev/null @@ -1,11 +0,0 @@ -package -{ - public final class Resource - { - public function Resource() - { - } - - - } -} \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/SourceCode.as b/src/Flash/org.moonsharp.debugger.client/src/SourceCode.as deleted file mode 100644 index d328c743..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/SourceCode.as +++ /dev/null @@ -1,83 +0,0 @@ -package -{ - public class SourceCode - { - private var m_Id : int; - private var m_Name : String; - private var m_Lines : Number; - private var m_Text : String; - private var m_CumulativeLength : Vector. = new Vector.(); - - public var Breakpoints : Vector. = new Vector.(); - - public function SourceCode(xml: XML) - { - m_Id = xml.@id; - m_Name = xml.@name.toString(); - - var lines : XMLList = xml.elements(); - - m_Text = ""; - - for each (var line : XML in lines) - { - m_CumulativeLength.push(m_Text.length); - m_Text += line.toString() + "\n"; - m_Lines += 1; - } - } - - public function getId() : int - { - return m_Id; - } - - public function getName() : String - { - return m_Name; - } - - public function getText() : String - { - return m_Text; - } - - public function flattenLocation(line: int, col: int) : int - { - return m_CumulativeLength[line] + col; - } - - - public function inflateLocationLine(pos : int) : int - { - for(var line:int = 0; line < m_CumulativeLength.length; line++) - { - if (pos < m_CumulativeLength[line]) - return line - 1; - } - - return m_CumulativeLength.length - 1; - } - - public function inflateLocationColumn(pos : int, line : int) : int - { - if (line <= 0) return pos; - return pos - m_CumulativeLength[line]; - } - - } -} - - - - - - - - - - - - - - diff --git a/src/Flash/org.moonsharp.debugger.client/src/Version.as b/src/Flash/org.moonsharp.debugger.client/src/Version.as deleted file mode 100644 index 9ba55302..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/Version.as +++ /dev/null @@ -1,12 +0,0 @@ -package -{ - public final class Version - { - public static var Version : String = "0.8.0.0"; - - - public function Version() - { - } - } -} \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/WatchItem.as b/src/Flash/org.moonsharp.debugger.client/src/WatchItem.as deleted file mode 100644 index 1028ca33..00000000 --- a/src/Flash/org.moonsharp.debugger.client/src/WatchItem.as +++ /dev/null @@ -1,34 +0,0 @@ -package -{ - public final class WatchItem - { - [Bindable] - public var Name : String; - [Bindable] - public var Value : String; - [Bindable] - public var Type : String; - [Bindable] - public var Address : String; - [Bindable] - public var BasePtr : String; - [Bindable] - public var RetAddress : String; - [Bindable] - public var LValue : String; - - - public function WatchItem(xml :XML) - { - Name = xml.@name; - Value = xml.@value; - Type = xml.@type; - Address = xml.@address; - BasePtr = xml.@baseptr; - RetAddress = xml.@retaddress; - LValue = xml.@lvalue; - } - - - } -} \ No newline at end of file diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-B.ttf b/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-B.ttf deleted file mode 100644 index c0142fea..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-B.ttf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-R.ttf b/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-R.ttf deleted file mode 100644 index 45a038ba..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/Ubuntu-R.ttf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/UbuntuMono-R.ttf b/src/Flash/org.moonsharp.debugger.client/src/assets/UbuntuMono-R.ttf deleted file mode 100644 index fdd309d7..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/UbuntuMono-R.ttf and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/add.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/add.gif deleted file mode 100644 index 252d7ebc..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/add.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/breakpoint.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/breakpoint.gif deleted file mode 100644 index f529c5a4..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/breakpoint.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/moonsharp.png b/src/Flash/org.moonsharp.debugger.client/src/assets/moonsharp.png deleted file mode 100644 index cceedb3e..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/moonsharp.png and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/pause.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/pause.gif deleted file mode 100644 index d645fa5c..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/pause.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/remove.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/remove.gif deleted file mode 100644 index b6922ac1..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/remove.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/run.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/run.gif deleted file mode 100644 index d6b3bdcc..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/run.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/step_current.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/step_current.gif deleted file mode 100644 index e3a7cc76..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/step_current.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/stepin.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/stepin.gif deleted file mode 100644 index 75d165bc..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/stepin.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/stepout.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/stepout.gif deleted file mode 100644 index 4c2f2193..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/stepout.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/stepover.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/stepover.gif deleted file mode 100644 index 1ec36ae2..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/stepover.gif and /dev/null differ diff --git a/src/Flash/org.moonsharp.debugger.client/src/assets/watch.gif b/src/Flash/org.moonsharp.debugger.client/src/assets/watch.gif deleted file mode 100644 index c55cb584..00000000 Binary files a/src/Flash/org.moonsharp.debugger.client/src/assets/watch.gif and /dev/null differ diff --git a/src/Flash/readme.md b/src/Flash/readme.md deleted file mode 100644 index 5cefbb93..00000000 --- a/src/Flash/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# Flash -This folder contains all things around MoonSharp done in Flash/Flex.. which basically means the remote debugger. - -There's no intention of doing anything else in Flash, and actually it would be good if the debugger could be ported to HTML5, one day. diff --git a/src/MoonSharp.Documentation/Content/VersionHistory/VersionHistory.aml b/src/MoonSharp.Documentation/Content/VersionHistory/VersionHistory.aml deleted file mode 100644 index a4f2fc8f..00000000 --- a/src/MoonSharp.Documentation/Content/VersionHistory/VersionHistory.aml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - The topics in this section describe the various changes made to the [TODO: Project Title] over the -life of the project. - - - - Version History - - Select a version below to see a description of its changes. - - - - - - - - [TODO: Add links to each specific version page] - - - - - - - - - - - - - diff --git a/src/MoonSharp.Documentation/Content/VersionHistory/v1.0.0.0.aml b/src/MoonSharp.Documentation/Content/VersionHistory/v1.0.0.0.aml deleted file mode 100644 index aa75ff17..00000000 --- a/src/MoonSharp.Documentation/Content/VersionHistory/v1.0.0.0.aml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Version [TODO: Version] was released on [TODO: Date]. - - - - - Changes in This Release - - - - - [TODO: Add change items here] - - - - - - - - - - - - - diff --git a/src/MoonSharp.Documentation/Content/Walkthrough.aml b/src/MoonSharp.Documentation/Content/Walkthrough.aml deleted file mode 100644 index 40ae2e3e..00000000 --- a/src/MoonSharp.Documentation/Content/Walkthrough.aml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - Required introduction - - - - - - - Procedure title - - - - First step - - - - - Second step - - - - - - - - - Optional section title - - - Procedure #2 - - - - First step - - - - - Second step - - - - - - - - - - - - - - - diff --git a/src/MoonSharp.Documentation/Content/Welcome.aml b/src/MoonSharp.Documentation/Content/Welcome.aml deleted file mode 100644 index ec88b074..00000000 --- a/src/MoonSharp.Documentation/Content/Welcome.aml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - This is the API reference for the MoonSharp.Interpreter assembly. - To get started, please visit - the MoonSharp homepage - MoonSharp homepage - http://www.moonsharp.org - . - - - diff --git a/src/MoonSharp.Documentation/ContentLayout.content b/src/MoonSharp.Documentation/ContentLayout.content deleted file mode 100644 index 713cbd98..00000000 --- a/src/MoonSharp.Documentation/ContentLayout.content +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/MoonSharp.Documentation/MoonSharp.Documentation.shfbproj b/src/MoonSharp.Documentation/MoonSharp.Documentation.shfbproj deleted file mode 100644 index 74bbce11..00000000 --- a/src/MoonSharp.Documentation/MoonSharp.Documentation.shfbproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - 26b3033c-d1e2-4188-870c-d197e95a7f6b - 2015.6.5.0 - - MoonSharp.Documentation - MoonSharp.Documentation - MoonSharp.Documentation - - .NET Framework 4.5 - .\Help\ - MoonSharp.Reference.Documentation - en-US - - - - - - - - - - OnlyErrors - HtmlHelp1 - False - True - False - False - True - - - - - 2 - False - Standard - Blank - False - VS2013 - False - MemberName - MoonSharp Reference Guide - AboveNamespaces - info%40moonsharp.org - info%40moonsharp.org - Summary, Parameter, AutoDocumentCtors, Namespace, TypeParameter, AutoDocumentDispose - - - - - - - - - - - - - - - - - - - - bin\Dev\ - - - bin\Devp4\ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/MoonSharp.Documentation/icons/Help.png b/src/MoonSharp.Documentation/icons/Help.png deleted file mode 100644 index 945e89fb..00000000 Binary files a/src/MoonSharp.Documentation/icons/Help.png and /dev/null differ diff --git a/src/MoonSharp.Hardwire/Generators/ArrayMemberDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/ArrayMemberDescriptorGenerator.cs index 4dc01a8b..5556a3cd 100644 --- a/src/MoonSharp.Hardwire/Generators/ArrayMemberDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/ArrayMemberDescriptorGenerator.cs @@ -18,10 +18,10 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.ArrayMemberDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members) { - string className = "AIDX_" + Guid.NewGuid().ToString("N"); string name = table.Get("name").String; + string className = "AIDX_" + IdGen.Create($"{parent ?? "null"}:array:{name}"); bool setter = table.Get("setter").Boolean; CodeTypeDeclaration classCode = new CodeTypeDeclaration(className); diff --git a/src/MoonSharp.Hardwire/Generators/Base/AssignableMemberDescriptorGeneratorBase.cs b/src/MoonSharp.Hardwire/Generators/Base/AssignableMemberDescriptorGeneratorBase.cs index 0615214a..befb34a3 100644 --- a/src/MoonSharp.Hardwire/Generators/Base/AssignableMemberDescriptorGeneratorBase.cs +++ b/src/MoonSharp.Hardwire/Generators/Base/AssignableMemberDescriptorGeneratorBase.cs @@ -19,7 +19,7 @@ abstract class AssignableMemberDescriptorGeneratorBase: IHardwireGenerator protected abstract string GetPrefix(); - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { bool isStatic = table.Get("static").Boolean; string memberType = table.Get("type").String; @@ -43,7 +43,7 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene access = access | MemberDescriptorAccess.CanRead; - string className = GetPrefix() + "_" + Guid.NewGuid().ToString("N"); + string className = GetPrefix() + "_" + IdGen.Create($"{parent ?? null}:assignable:{name}:{memberType}:{isStatic}:{decltype}:{declvtype}:{canWrite}:{canRead}"); CodeTypeDeclaration classCode = new CodeTypeDeclaration(className); diff --git a/src/MoonSharp.Hardwire/Generators/DynValueMemberDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/DynValueMemberDescriptorGenerator.cs index 4d4bef35..99d16455 100644 --- a/src/MoonSharp.Hardwire/Generators/DynValueMemberDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/DynValueMemberDescriptorGenerator.cs @@ -16,7 +16,7 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.DynValueMemberDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members) { string className = "DVAL_" + Guid.NewGuid().ToString("N"); DynValue kval = table.Get("value"); diff --git a/src/MoonSharp.Hardwire/Generators/MethodMemberDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/MethodMemberDescriptorGenerator.cs index adcf263f..c585284b 100644 --- a/src/MoonSharp.Hardwire/Generators/MethodMemberDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/MethodMemberDescriptorGenerator.cs @@ -30,7 +30,7 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.MethodMemberDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { bool isArray = table.Get("arraytype").IsNotNil(); string memberName = table.Get("name").String; @@ -42,8 +42,19 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene return null; } + // Create the parameters + List paramDescs = HardwireParameterDescriptor.LoadDescriptorsFromTable(table.Get("params").Table); + + int paramNum = paramDescs.Count; + int optionalNum = paramDescs.Where(p => p.HasDefaultValue).Count(); + // Create the descriptor class - string className = m_Prefix + "_" + Guid.NewGuid().ToString("N"); + var idstr = $"{parent}$method${table.Get("static").Boolean || table.Get("ctor").Boolean}:{memberName}"; + foreach (var p in paramDescs) + { + idstr += $"#{p.ParamType}::{p.IsOut}::{p.IsRef}"; + } + string className = m_Prefix + "_" + IdGen.Create(idstr); CodeTypeDeclaration classCode = new CodeTypeDeclaration(className); classCode.TypeAttributes = System.Reflection.TypeAttributes.NestedPrivate | System.Reflection.TypeAttributes.Sealed; @@ -54,11 +65,7 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene ctor.Attributes = MemberAttributes.Assembly; classCode.Members.Add(ctor); - // Create the parameters - List paramDescs = HardwireParameterDescriptor.LoadDescriptorsFromTable(table.Get("params").Table); - - int paramNum = paramDescs.Count; - int optionalNum = paramDescs.Where(p => p.HasDefaultValue).Count(); + // Add initialize call to ctor List initParams = new List(); diff --git a/src/MoonSharp.Hardwire/Generators/NullGenerator.cs b/src/MoonSharp.Hardwire/Generators/NullGenerator.cs index 3d878a67..07989403 100644 --- a/src/MoonSharp.Hardwire/Generators/NullGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/NullGenerator.cs @@ -25,7 +25,7 @@ public string ManagedType private set; } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { generator.Error("Missing code generator for '{0}'.", ManagedType); diff --git a/src/MoonSharp.Hardwire/Generators/OverloadedMethodMemberDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/OverloadedMethodMemberDescriptorGenerator.cs index 883e9033..d578edd2 100644 --- a/src/MoonSharp.Hardwire/Generators/OverloadedMethodMemberDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/OverloadedMethodMemberDescriptorGenerator.cs @@ -16,12 +16,12 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.OverloadedMethodMemberDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { List initializers = new List(); - generator.DispatchTablePairs(table.Get("overloads").Table, members, exp => + generator.DispatchTablePairs(parent, table.Get("overloads").Table, members, exp => { initializers.Add(exp); }); diff --git a/src/MoonSharp.Hardwire/Generators/StandardUserDataDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/StandardUserDataDescriptorGenerator.cs index 03df313d..af394833 100644 --- a/src/MoonSharp.Hardwire/Generators/StandardUserDataDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/StandardUserDataDescriptorGenerator.cs @@ -16,11 +16,11 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.StandardUserDataDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { string type = (string)table["$key"]; - string className = "TYPE_" + Guid.NewGuid().ToString("N"); + string className = "TYPE_" + IdGen.Create($"TYPE${type}"); CodeTypeDeclaration classCode = new CodeTypeDeclaration(className); @@ -42,7 +42,7 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene classCode.Members.Add(ctor); - generator.DispatchTablePairs(table.Get("members").Table, + generator.DispatchTablePairs(type, table.Get("members").Table, classCode.Members, (key, exp) => { var mname = new CodePrimitiveExpression(key); @@ -51,7 +51,7 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene new CodeThisReferenceExpression(), "AddMember", mname, exp)); }); - generator.DispatchTablePairs(table.Get("metamembers").Table, + generator.DispatchTablePairs(type, table.Get("metamembers").Table, classCode.Members, (key, exp) => { var mname = new CodePrimitiveExpression(key); diff --git a/src/MoonSharp.Hardwire/Generators/ValueTypeDefaultCtorMemberDescriptorGenerator.cs b/src/MoonSharp.Hardwire/Generators/ValueTypeDefaultCtorMemberDescriptorGenerator.cs index e28a5dfd..6912b952 100644 --- a/src/MoonSharp.Hardwire/Generators/ValueTypeDefaultCtorMemberDescriptorGenerator.cs +++ b/src/MoonSharp.Hardwire/Generators/ValueTypeDefaultCtorMemberDescriptorGenerator.cs @@ -16,7 +16,7 @@ public string ManagedType get { return "MoonSharp.Interpreter.Interop.ValueTypeDefaultCtorMemberDescriptor"; } } - public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) + public CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generator, CodeTypeMemberCollection members) { MethodMemberDescriptorGenerator mgen = new MethodMemberDescriptorGenerator("VTDC"); @@ -32,7 +32,7 @@ public CodeExpression[] Generate(Table table, HardwireCodeGenerationContext gene mt["special"] = false; - return mgen.Generate(mt, generator, members); + return mgen.Generate(parent, mt, generator, members); } } } diff --git a/src/MoonSharp.Hardwire/HardwireCodeGenerationContext.cs b/src/MoonSharp.Hardwire/HardwireCodeGenerationContext.cs index ad42f548..8687cf94 100644 --- a/src/MoonSharp.Hardwire/HardwireCodeGenerationContext.cs +++ b/src/MoonSharp.Hardwire/HardwireCodeGenerationContext.cs @@ -47,7 +47,6 @@ internal HardwireCodeGenerationContext(string namespaceName, string entryClassNa CompileUnit.Namespaces.Add(m_Namespace); Comment("----------------------------------------------------------"); - Comment("Generated by MoonSharp.Hardwire v.{0}", Assembly.GetExecutingAssembly().GetName().Version); Comment("Compatible with MoonSharp v.{0} or equivalent", Script.VERSION); Comment("----------------------------------------------------------"); @@ -61,16 +60,8 @@ internal HardwireCodeGenerationContext(string namespaceName, string entryClassNa Comment("----------------------------------------------------------"); } - Comment("Code generated on {0}", DateTime.Now.ToString("O")); Comment("----------------------------------------------------------"); - - - - Comment(""); - Comment(""); - Comment(""); - GenerateKickstarter(entryClassName); } @@ -82,7 +73,7 @@ internal void GenerateCode(Table table) { try { - DispatchTablePairs(table, m_KickstarterClass.Members, + DispatchTablePairs(null, table, m_KickstarterClass.Members, exp => m_InitStatements.Add(new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(typeof(UserData)), "RegisterType", exp))); } catch (Exception ex) @@ -94,12 +85,13 @@ internal void GenerateCode(Table table) /// /// Used by generators to dispatch a table of types /// + /// Parent name (can be null) /// The table. /// The members. /// The action to be performed, or null. - public void DispatchTablePairs(Table table, CodeTypeMemberCollection members, Action action = null) + public void DispatchTablePairs(string parent, Table table, CodeTypeMemberCollection members, Action action = null) { - foreach (var pair in table.Pairs) + foreach (var pair in table.Pairs.OrderBy(x => x.Key.ToString(), StringComparer.Ordinal)) { var key = pair.Key; var value = pair.Value; @@ -122,7 +114,7 @@ public void DispatchTablePairs(Table table, CodeTypeMemberCollection members, Ac continue; } - var exp = DispatchTable(key.String, value.Table, members); + var exp = DispatchTable(parent, key.String, value.Table, members); if (action != null && exp != null) foreach (var e in exp) @@ -153,9 +145,9 @@ public string GetStackTrace() /// The table. /// The members. /// The action to be performed, or null. - public void DispatchTablePairs(Table table, CodeTypeMemberCollection members, Action action) + public void DispatchTablePairs(string parent, Table table, CodeTypeMemberCollection members, Action action) { - DispatchTablePairs(table, members, (_, e) => action(e)); + DispatchTablePairs(parent, table, members, (_, e) => action(e)); } @@ -167,7 +159,7 @@ public void DispatchTablePairs(Table table, CodeTypeMemberCollection members, Ac /// The members. /// /// table cannot be dispatched as it has no class or class of invalid type. - public CodeExpression[] DispatchTable(string key, Table table, CodeTypeMemberCollection members) + public CodeExpression[] DispatchTable(string parent, string key, Table table, CodeTypeMemberCollection members) { DynValue d = table.Get("class"); if (d.Type != DataType.String) @@ -180,7 +172,7 @@ public CodeExpression[] DispatchTable(string key, Table table, CodeTypeMemberCol table.Set("$key", DynValue.NewString(key)); var gen = HardwireGeneratorRegistry.GetGenerator(d.String); - var result = gen.Generate(table, this, members); + var result = gen.Generate(parent, table, this, members); m_NestStack.Pop(); diff --git a/src/MoonSharp.Hardwire/IHardwireGenerator.cs b/src/MoonSharp.Hardwire/IHardwireGenerator.cs index 4bb2db86..4ba0d282 100644 --- a/src/MoonSharp.Hardwire/IHardwireGenerator.cs +++ b/src/MoonSharp.Hardwire/IHardwireGenerator.cs @@ -24,7 +24,7 @@ public interface IHardwireGenerator /// The generator context. /// The CodeTypeMemberCollection which can be used to add newly defined types. /// Zero or more expressions which can be used by the parent generator to use the generated code. - CodeExpression[] Generate(Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members); + CodeExpression[] Generate(string parent, Table table, HardwireCodeGenerationContext generatorContext, CodeTypeMemberCollection members); } } diff --git a/src/MoonSharp.Hardwire/IdGen.cs b/src/MoonSharp.Hardwire/IdGen.cs new file mode 100644 index 00000000..64d7e691 --- /dev/null +++ b/src/MoonSharp.Hardwire/IdGen.cs @@ -0,0 +1,36 @@ +using System; +using System.Linq; +using System.Reflection; +using System.Numerics; +using System.Text; +using System.Security.Cryptography; + +namespace MoonSharp.Hardwire +{ + static class IdGen + { + private const string ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"; + public static string Create(string str) + { + using (MD5 md5Hash = MD5.Create()) + { + var bLen = BitConverter.GetBytes((ushort) str.Length); + byte[] bytes = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(str)); + return Encode(new BigInteger(bLen.Concat(bytes).Append((byte)0).ToArray())); + } + } + static string Encode(BigInteger number) + { + if(number < 0) + throw new ArgumentException(); + var builder = new StringBuilder(); + var divisor = new BigInteger(ALPHABET.Length); + while (number > 0) + { + number = BigInteger.DivRem(number, divisor, out var rem); + builder.Append(ALPHABET[(int) rem]); + } + return new string(builder.ToString().Reverse().ToArray()); + } + } +} \ No newline at end of file diff --git a/src/MoonSharp.Hardwire/MoonSharp.Hardwire.csproj b/src/MoonSharp.Hardwire/MoonSharp.Hardwire.csproj new file mode 100644 index 00000000..e289e07c --- /dev/null +++ b/src/MoonSharp.Hardwire/MoonSharp.Hardwire.csproj @@ -0,0 +1,12 @@ + + + netstandard2.0 + + + + + + + + + diff --git a/src/MoonSharp.Hardwire/MoonSharp.Hardwire.net35-client.csproj b/src/MoonSharp.Hardwire/MoonSharp.Hardwire.net35-client.csproj deleted file mode 100644 index 3c2247b7..00000000 --- a/src/MoonSharp.Hardwire/MoonSharp.Hardwire.net35-client.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Debug - AnyCPU - {B25A2316-6897-4CAA-BE0E-E784071D8199} - Library - Properties - MoonSharp.Hardwire - MoonSharp.Hardwire - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - keypair.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {91ea9b9d-fe03-4273-bdaf-8ad42ede1e59} - MoonSharp.Interpreter.net35-client - - - - - - - - \ No newline at end of file diff --git a/src/MoonSharp.Hardwire/Properties/AssemblyInfo.cs b/src/MoonSharp.Hardwire/Properties/AssemblyInfo.cs deleted file mode 100644 index 8462329d..00000000 --- a/src/MoonSharp.Hardwire/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MoonSharp.Hardwire")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MoonSharp.Hardwire")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("67210a72-3276-46db-b263-96e3197b1f78")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/MoonSharp.Hardwire/keypair.snk b/src/MoonSharp.Hardwire/keypair.snk deleted file mode 100644 index 13c53af5..00000000 Binary files a/src/MoonSharp.Hardwire/keypair.snk and /dev/null differ diff --git a/src/MoonSharp.HardwireGen/ExtraClassList.cs b/src/MoonSharp.HardwireGen/ExtraClassList.cs new file mode 100644 index 00000000..cf873dca --- /dev/null +++ b/src/MoonSharp.HardwireGen/ExtraClassList.cs @@ -0,0 +1,55 @@ +using System; +using System.IO; +using System.Xml.Serialization; + +namespace MoonSharp.HardwireGen +{ + [XmlRoot("MoonSharp")] + public class ExtraClassList + { + [XmlElement] + public string[] ExtraType; + [XmlElement] + public string[] BlacklistType; + private static XmlSerializer cl = new XmlSerializer(typeof(ExtraClassList)); + public static ExtraClassList Get(string file) + { + string text; + if ((text = ReadAllText(file)) != null) + { + try + { + return (ExtraClassList) cl.Deserialize(new StringReader(text)); + } + catch (Exception) + { + return null; + } + } + return null; + } + + static string ReadAllText(string file) + { + try + { + using (var reader = new StreamReader(file)) + { + char[] buffer = new char[256]; + var c = reader.ReadBlock(buffer, 0, buffer.Length); + if (c == -1) return null; + var str = new string(buffer, 0, c); + if (str.TrimStart().StartsWith("<")) + { + return str + reader.ReadToEnd(); + } + } + return null; + } + catch (Exception) + { + return null; + } + } + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/IdGen.cs b/src/MoonSharp.HardwireGen/IdGen.cs new file mode 100644 index 00000000..823a0c5a --- /dev/null +++ b/src/MoonSharp.HardwireGen/IdGen.cs @@ -0,0 +1,36 @@ +using System; +using System.Linq; +using System.Reflection; +using System.Numerics; +using System.Text; +using System.Security.Cryptography; + +namespace MoonSharp.HardwireGen +{ + static class IdGen + { + private const string ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"; + public static string Create(string str) + { + using (MD5 md5Hash = MD5.Create()) + { + var bLen = BitConverter.GetBytes((ushort) str.Length); + byte[] bytes = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(str)); + return Encode(new BigInteger(bLen.Concat(bytes).Append((byte)0).ToArray())); + } + } + static string Encode(BigInteger number) + { + if(number < 0) + throw new ArgumentException(); + var builder = new StringBuilder(); + var divisor = new BigInteger(ALPHABET.Length); + while (number > 0) + { + number = BigInteger.DivRem(number, divisor, out var rem); + builder.Append(ALPHABET[(int) rem]); + } + return new string(builder.ToString().Reverse().ToArray()); + } + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/MoonSharp.HardwireGen.csproj b/src/MoonSharp.HardwireGen/MoonSharp.HardwireGen.csproj new file mode 100644 index 00000000..a5987d27 --- /dev/null +++ b/src/MoonSharp.HardwireGen/MoonSharp.HardwireGen.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + 9 + + + + + + diff --git a/src/MoonSharp.HardwireGen/SourceGenerator.ClassNames.cs b/src/MoonSharp.HardwireGen/SourceGenerator.ClassNames.cs new file mode 100644 index 00000000..001b6d8c --- /dev/null +++ b/src/MoonSharp.HardwireGen/SourceGenerator.ClassNames.cs @@ -0,0 +1,23 @@ +namespace MoonSharp.HardwireGen +{ + public partial class HardwireSourceGenerator + { + private const string CLS_USERDATA = + "MoonSharp.Interpreter.Interop.StandardDescriptors.HardwiredDescriptors.HardwiredUserDataDescriptor"; + + private const string CLS_OVERLOAD = "MoonSharp.Interpreter.Interop.OverloadedMethodMemberDescriptor"; + + private const string CLS_OVERLOAD_MEMBER = + "MoonSharp.Interpreter.Interop.BasicDescriptors.IOverloadableMemberDescriptor"; + + private const string CLS_PROP_FIELD = + "MoonSharp.Interpreter.Interop.StandardDescriptors.HardwiredDescriptors.HardwiredMemberDescriptor"; + + private const string CLS_METHOD = + "MoonSharp.Interpreter.Interop.StandardDescriptors.HardwiredDescriptors.HardwiredMethodMemberDescriptor"; + + private const string CLS_PARAMETER = "MoonSharp.Interpreter.Interop.BasicDescriptors.ParameterDescriptor"; + + + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/SourceGenerator.cs b/src/MoonSharp.HardwireGen/SourceGenerator.cs new file mode 100644 index 00000000..8cf6a55e --- /dev/null +++ b/src/MoonSharp.HardwireGen/SourceGenerator.cs @@ -0,0 +1,657 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; + +namespace MoonSharp.HardwireGen +{ + [Generator] + public partial class HardwireSourceGenerator : ISourceGenerator + { + private static DiagnosticDescriptor ByRefWarning = new("MS1001", + "ByRef parameters can't be generated", + "Method '{0}' has ref/out parameters and won't be described, mark with MoonSharpHiddenAttribute.", + "MoonSharp.HardwireGen", DiagnosticSeverity.Warning, true); + + private static DiagnosticDescriptor NoFilesWarning = new("MS1002", + "AdditionalFiles has no types listed", + "File '{0}' has no additional types listed.", + "MoonSharp.HardwireGen", DiagnosticSeverity.Warning, true); + + private static DiagnosticDescriptor TypeResolveWarning = new("MS1003", + "Type could not be resolved", + "Type '{0}' from AdditionalFile '{1}' could not be resolved.", + "MoonSharp.HardwireGen", DiagnosticSeverity.Warning, true); + + private static DiagnosticDescriptor Timing = new("MS9999", "Generation duration", + "Hardwire generation took '{0}'ms", "MoonSharp.HardwireGen", DiagnosticSeverity.Info, true); + + public void Initialize(GeneratorInitializationContext context) + { + context.RegisterForSyntaxNotifications(() => new UserDataSyntaxReceiver()); + } + + static string Sanitize(string t) + { + return t.Replace(".", "_").Replace(",", "__").Replace("<", "___").Replace(">", "___"); + } + + + private static string[] SkipTypes = + { + "System.Object", "System.Type" + }; + + TypeGenQueue types = new TypeGenQueue(); + private List generatedClasses = new List(); + private HashSet blacklist = new HashSet(); + + static IEnumerable GenericParts(string input) + { + var s = ""; + int bC = 0; + for (int i = 0; i < input.Length; i++) + { + if (input[i] == '<') + bC++; + if (input[i] == '>') + bC--; + if (bC == 0 && input[i] == ',') + { + yield return s; + s = ""; + } + else + { + s += input[i]; + } + } + + if (s != "") + yield return s; + } + + static ITypeSymbol GetTypeFromName(ref GeneratorExecutionContext context, string type) + { + if (string.IsNullOrWhiteSpace(type)) return null; + if (type.Contains("<")) + { + var startIndex = type.IndexOf('<') + 1; + var endIndex = type.LastIndexOf('>'); + if (endIndex == -1) return null; + var generics = type.Substring(startIndex, endIndex - startIndex); + var parts = GenericParts(generics).ToArray(); + var baseName = type.Substring(0, startIndex - 1) + "`" + parts.Length; + INamedTypeSymbol ts = context.Compilation.GetTypeByMetadataName(baseName); + if (ts == null) return null; + ITypeSymbol[] parameters = new ITypeSymbol[parts.Length]; + for (int i = 0; i < parameters.Length; i++) + { + parameters[i] = GetTypeFromName(ref context, parts[i]); + if (parameters[i] == null) return null; + } + + return ts.Construct(parameters); + } + else + { + return context.Compilation.GetTypeByMetadataName(type); + } + } + + void ProcessAdditionalFile(ref GeneratorExecutionContext context, AdditionalText file) + { + ExtraClassList ec; + if ((ec = ExtraClassList.Get(file.Path)) != null) + { + if (ec.ExtraType != null && ec.ExtraType.Length > 0) + { + foreach (var t in ec.ExtraType) + { + var x = t.Trim(); + var ts = GetTypeFromName(ref context, x); + if (ts == null) + { + context.ReportDiagnostic(Diagnostic.Create(TypeResolveWarning, null, x, file.Path)); + } + else + { + types.Enqueue(ts); + } + } + } + else + { + context.ReportDiagnostic(Diagnostic.Create(NoFilesWarning, null, file.Path)); + } + + if (ec.BlacklistType != null && ec.BlacklistType.Length > 0) + { + foreach (var t in ec.BlacklistType) + { + var x = t.Trim(); + var ts = GetTypeFromName(ref context, x); + if (ts == null) + { + context.ReportDiagnostic(Diagnostic.Create(TypeResolveWarning, null, x, file.Path)); + } + else + { + blacklist.Add(ts.TypeName()); + } + } + } + } + } + + public void Execute(GeneratorExecutionContext context) + { + var sw = Stopwatch.StartNew(); + try + { + var receiver = (UserDataSyntaxReceiver) context.SyntaxReceiver; + var name = context.Compilation.Assembly.Name; + if (string.IsNullOrEmpty(name)) + name = IdGen.Create(context.Compilation.Assembly.NamespaceNames.FirstOrDefault() ?? + "_MoonSharp"); + name = "LuaHardwire_" + Sanitize(name); + + foreach (var classDeclaration in receiver.Candidates) + { + var model = context.Compilation.GetSemanticModel(classDeclaration.SyntaxTree, true); + var type = ModelExtensions.GetDeclaredSymbol(model, classDeclaration) as ITypeSymbol; + if (type is null || !IsUserData(type)) + continue; + types.Enqueue(type); + } + + foreach (var file in context.AdditionalFiles) + { + ProcessAdditionalFile(ref context, file); + } + + while (types.Count > 0) + { + TryGenerate(ref context, name, types.Dequeue()); + } + + var writer = new TabbedWriter(); + writer.AppendLine("// "); + writer.Append("partial class ").AppendLine(name); + writer.AppendLine("{").Indent(); + writer.AppendLine("public static void Initialize()"); + writer.AppendLine("{").Indent(); + foreach (var str in generatedClasses) + { + writer.Append("MoonSharp.Interpreter.UserData.RegisterType(new ").Append(str).AppendLine("());"); + } + + writer.UnIndent().AppendLine("}"); + writer.UnIndent().AppendLine("}"); + context.AddSource($"{name}.g.cs", writer.ToString()); + sw.Stop(); + context.ReportDiagnostic(Diagnostic.Create(Timing, null, sw.Elapsed.TotalMilliseconds)); + } + catch (Exception e) + { + sw.Stop(); + throw new Exception(e.Message + "> " + e.StackTrace.Replace('\n', ';')); + } + } + + static bool IsUserData(ITypeSymbol type) + { + return type.GetAttributes() + .Any(a => a.AttributeClass?.ToString() == "MoonSharp.Interpreter.MoonSharpUserDataAttribute"); + } + + static bool IsHidden(ISymbol symbol) + { + foreach (var attr in symbol.GetAttributes()) + { + if (attr.AttributeClass?.ToString() == "MoonSharp.Interpreter.MoonSharpHiddenAttribute") + return true; + if (attr.AttributeClass?.ToString() == "MoonSharp.Interpreter.MoonSharpVisibleAttribute") + { + if (attr.ConstructorArguments[0].Value is false) + return true; + } + } + + return false; + } + + static string TypeName(ITypeSymbol type) + { + return type.ToDisplayString(new SymbolDisplayFormat( + SymbolDisplayGlobalNamespaceStyle.Omitted, + SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + SymbolDisplayGenericsOptions.IncludeTypeParameters, + miscellaneousOptions: SymbolDisplayMiscellaneousOptions.ExpandNullable + )); + } + + + void TryGenerate(ref GeneratorExecutionContext context, string containingName, ITypeSymbol type) + { + //skip blacklisted + if (blacklist.Any(x => x == type.TypeName())) return; + if (SkipTypes.Any(x => x == type.ToString())) return; + //gen + GenerateCode(ref context, containingName, type); + } + + static bool IsUnsupported(ITypeSymbol type) + { + if (type.IsRefLikeType || type.TypeKind == TypeKind.Pointer || + type.TypeKind == TypeKind.FunctionPointer) return true; + return false; + } + + void GenerateCode(ref GeneratorExecutionContext context, string containingName, ITypeSymbol type) + { + var builder = new TabbedWriter(); + var typeName = TypeName(type); + string classname = "T_" + IdGen.Create(typeName); + generatedClasses.Add(classname); + Dictionary methods = new Dictionary(); + Dictionary fields = new Dictionary(); + builder.AppendLine("// "); + builder.Append("// UserData description for: ").AppendLine(typeName); + + builder.Append("internal partial class ").Append(containingName).AppendLine().AppendLine("{").Indent(); + + builder.Append("public sealed class ").Append(classname).Append(" : ").AppendLine(CLS_USERDATA); + builder.AppendLine("{").Indent(); + + foreach (var m in type.GetPublicMembers()) + { + if (IsHidden(m.symbol)) + { + builder.AppendLine("//Hidden Symbol: " + m.symbol.ToDisplayString()); + continue; + } + + if (m.symbol.IsStatic) continue; + if (m.symbol is IMethodSymbol method) + { + if (method.MethodKind == MethodKind.Ordinary || + (method.MethodKind == MethodKind.Constructor && m.level == 0)) + { + if (method.IsGenericMethod) continue; + bool byref = method.ReturnsByRef || method.ReturnsByRefReadonly; + foreach (var p in method.Parameters) + { + if (p.RefKind == RefKind.Ref || p.RefKind == RefKind.Out || + p.RefKind == RefKind.RefReadOnly) + { + byref = true; + break; + } + } + + bool unsupportedTypes = false; + foreach (var p in method.Parameters) + { + if (IsUnsupported(p.Type)) + { + unsupportedTypes = true; + break; + } + } + + if (unsupportedTypes) continue; + if (byref) + { + if (m.level == 0) + context.ReportDiagnostic(Diagnostic.Create(ByRefWarning, + method.Locations.FirstOrDefault(), method.ToString())); + continue; + } + + if (method.MethodKind == MethodKind.Constructor) + { + if (!methods.ContainsKey("__new")) + methods.Add("__new", new TypeMethod() {Constructor = true}); + methods["__new"].AddMethod(0, method); + } + else + { + if (!methods.ContainsKey(method.Name)) methods.Add(method.Name, new TypeMethod()); + methods[method.Name].AddMethod(m.level, method); + } + } + } + + if (m.symbol is IPropertySymbol property) + { + if (IsUnsupported(property.Type)) continue; + if (property.RefKind == RefKind.Ref) + { + continue; + } + + if (property.IsIndexer) + { + continue; //name is this[] + } + + TypeFieldDesc desc = new TypeFieldDesc() {Type = property.Type}; + if (property.GetMethod != null) + { + desc.Read = true; + var name = "get_" + property.Name; + if (!methods.ContainsKey(name)) + methods.Add(name, new TypeMethod() + { + Property = true, + PropertyName = property.Name + }); + methods[name].SetName(name); + methods[name].AddMethod(m.level, property.GetMethod); + } + if (property.SetMethod != null) + { + desc.Write = true; + var name = "set_" + property.Name; + if (!methods.ContainsKey(name)) + methods.Add(name, new TypeMethod() + { + Property = true, + PropertyName = property.Name, + }); + methods[name].SetName(name); + methods[name].AddMethod(m.level, property.SetMethod); + } + if (!fields.ContainsKey(property.Name)) + fields.Add(property.Name, new TypeField() {Name = property.Name}); + fields[property.Name].Set(m.level, desc); + } + + if (m.symbol is IFieldSymbol field) + { + if (IsUnsupported(field.Type)) continue; + TypeFieldDesc desc = new TypeFieldDesc() {Type = field.Type}; + desc.Read = true; + desc.Write = !field.IsReadOnly; + if (!fields.ContainsKey(field.Name)) fields.Add(field.Name, new TypeField() {Name = field.Name}); + fields[field.Name].Set(m.level, desc); + } + } + + foreach (var m in methods.Values) + { + GenerateMethod(builder, typeName, m); + } + foreach(var f in fields.Values) + { + GenerateField(builder, typeName, f); + } + + //Constructor + builder.Append("internal ").Append(classname).Append("() : base(typeof(").Append(typeName).AppendLine("))"); + builder.AppendLine("{").Indent(); + foreach (var kv in methods) + { + builder.Append("this.AddMember("); + builder.Append(kv.Key.ToLiteral()); + //new OverloadedMethodMemberDescriptor(name, typeof(type), new IOverloadableMemberDescriptor[] { classes }); + builder.Append(", new ").Append(CLS_OVERLOAD).Append(" (").Append(kv.Key.ToLiteral()) + .Append(", typeof(").Append(typeName).Append("), new ").Append(CLS_OVERLOAD_MEMBER) + .AppendLine("[] { "); + builder.Indent(); + for (int i = 0; i < kv.Value.Overloads.Count; i++) + { + builder.Append("new ").Append(kv.Value.ClassName(i)).Append("()"); + if (i + 1 < kv.Value.Overloads.Count) + builder.AppendLine(","); + else + builder.AppendLine(); + } + + builder.UnIndent(); + builder.AppendLine("}));"); + } + foreach(var kv in fields) + { + builder.Append("this.AddMember("); + builder.Append(kv.Key.ToLiteral()); + builder.Append(", "); + builder.Append("new ").Append(kv.Value.ClassName()).AppendLine("());"); + } + + builder.UnIndent().AppendLine("}"); + builder.UnIndent().AppendLine("}"); + builder.UnIndent().AppendLine("}"); + context.AddSource($"{classname}.g.cs", builder.ToString()); + } + + void GenerateField(TabbedWriter builder, string typeName, TypeField f) + { + builder.Append("private sealed class ").Append(f.ClassName()).Append(" : ").AppendLine(CLS_PROP_FIELD); + builder.AppendLine("{").Indent(); + builder.Append("internal ").Append(f.ClassName()).AppendLine("() :"); + var access = 0; + if (f.Desc.Read) access += 1; //CanRead + if (f.Desc.Write) access += 2; //CanWrite + builder.Indent().Append("base(typeof(").Append(f.Desc.Type.TypeName()).Append("),") + .Append(f.Name.ToLiteral()).Append(",false,") + .Append("(MoonSharp.Interpreter.Interop.BasicDescriptors.MemberDescriptorAccess)") + .Append(access.ToString()).AppendLine(")").UnIndent(); + builder.AppendLine("{"); + builder.AppendLine("}"); + if (f.Desc.Read) + { + builder.AppendLine( + "protected override object GetValueImpl(MoonSharp.Interpreter.Script script, object obj) {") + .Indent(); + builder.Append("var self = (").Append(typeName).AppendLine(")obj;"); + builder.Append("return (object)self.").Append(f.Name).AppendLine(";"); + builder.UnIndent().AppendLine("}"); + } + if (f.Desc.Write) + { + builder.AppendLine( + "protected override void SetValueImpl(MoonSharp.Interpreter.Script script, object obj, object value) {") + .Indent(); + builder.Append("var self = (").Append(typeName).AppendLine(")obj;"); + builder.Append("self.").Append(f.Name).Append(" = (").Append(f.Desc.Type.TypeName()).AppendLine(")value;"); + builder.UnIndent().AppendLine("}"); + } + builder.UnIndent().AppendLine("}"); + } + void GenerateMethod(TabbedWriter builder, string typeName, TypeMethod m) + { + for (int i = 0; i < m.Overloads.Count; i++) + { + var method = m.Overloads[i]; + builder.Append("private sealed class ").Append(m.ClassName(i)).Append(" : ").AppendLine(CLS_METHOD); + builder.AppendLine("{").Indent(); + //ctor, add descriptors + builder.Append("internal ").Append(m.ClassName(i)).Append("()"); + builder.AppendLine("{").Indent(); + //funcName, isStatic, ParameterDescriptor[], isExtensionMethod + string isStatic = m.Constructor ? "true" : "false"; + builder.Append("this.Initialize(").Append(m.Name.ToLiteral()).Append($", {isStatic}, new ") + .Append(CLS_PARAMETER).AppendLine("[] {"); + builder.Indent(); + int j = 0; + foreach (var p in method.Parameters) + { + j++; + builder.Append("new ").Append(CLS_PARAMETER).Append("("); + builder.Append(p.Name.ToLiteral()).Append(", "); + builder.Append("typeof(").Append(TypeName(p.Type)).Append("), "); + builder.Append("false, "); //hasDefault + builder.Append("null, "); //default + builder.Append("false, "); //out + builder.Append("false, "); //ref + if (p.IsParams) builder.Append("true"); + else builder.Append("false"); + if (j < method.Parameters.Length) builder.AppendLine("),"); + else builder.AppendLine(")"); + } + + builder.UnIndent().AppendLine("}, false);"); + builder.UnIndent().AppendLine("}"); + //invoke + builder.AppendLine( + "protected override object Invoke(MoonSharp.Interpreter.Script script, object obj, object[] pars, int argscount)"); + builder.AppendLine("{").Indent(); + if (!m.Constructor) + builder.Append("var self = (").Append(typeName).AppendLine(")obj;"); + if (!method.ReturnsVoid && !m.Constructor) + { + builder.Append("return (object)"); + } + + if (!m.Constructor) + { + builder.Append("self."); + builder.Append(m.PropertyName ?? method.Name); + } + else + { + builder.Append("return new "); + builder.Append(typeName); + } + + if (!m.Property) + { + builder.Append("("); + for (int k = 0; k < method.Parameters.Length; k++) + { + builder.Append("(").Append(TypeName(method.Parameters[k].Type)).Append(")"); + builder.Append("pars["); + builder.Append(k.ToString()); + builder.Append("]"); + if (k + 1 < method.Parameters.Length) builder.Append(", "); + } + + builder.AppendLine(");"); + } + else + { + if (method.Parameters.Length > 0) + { + builder.Append(" = (").Append(TypeName(method.Parameters[0].Type)).Append(")pars[0]"); + } + + builder.AppendLine(";"); + } + + if (method.ReturnsVoid && !m.Constructor) builder.AppendLine("return null;"); + builder.UnIndent().AppendLine("}"); + builder.UnIndent().AppendLine("}"); + } + } + + class TypeFieldDesc + { + public ITypeSymbol Type; + public bool Read; + public bool Write; + } + + class TypeField + { + public int CurrLevel = 1000; + public TypeFieldDesc Desc; + public string Name; + + public string ClassName() => "F_" + Name; + public void Set(int level, TypeFieldDesc desc) + { + if (level < CurrLevel) + { + CurrLevel = level; + Desc = desc; + } + } + } + + class TypeMethod + { + public List Overloads = new List(); + public int CurrentLevel = 1000; + public bool Constructor = false; + public bool Property = false; + public string PropertyName = null; + private string _name; + + public void SetName(string n) + { + _name = n; + } + + public string Name => _name ?? (Overloads.Count > 0 ? Overloads[0].Name : ""); + + public string ClassName(int overload) + { + return "M" + overload + "_" + Sanitize(Name); + } + + public override string ToString() + { + if (Overloads.Count < 0) return "[empty]"; + return Overloads[0].Name + " (" + + string.Join(";", Overloads.Select(x => x.ToDisplayString())) + ")"; + } + + public void AddMethod(int level, IMethodSymbol symbol) + { + if (level > CurrentLevel) return; + if (level < CurrentLevel) + { + Overloads = new List(); + CurrentLevel = level; + } + Overloads.Add(symbol); + } + } + } + + public class UserDataSyntaxReceiver : ISyntaxReceiver + { + public List Candidates { get; } = new(); + + public void OnVisitSyntaxNode(SyntaxNode syntaxNode) + { + if (syntaxNode is not AttributeSyntax attribute) + return; + + var name = ExtractName(attribute.Name); + + if (name != "MoonSharpUserData" && name != "MoonSharpUserDataAttribute") + return; + + // "attribute.Parent" is "AttributeListSyntax" + // "attribute.Parent.Parent" is a C# fragment the attribute is applied to + if (attribute.Parent?.Parent is ClassDeclarationSyntax classDeclaration) + Candidates.Add(classDeclaration); + } + + private static string ExtractName(TypeSyntax type) + { + while (type != null) + { + switch (type) + { + case IdentifierNameSyntax ins: + return ins.Identifier.Text; + + case QualifiedNameSyntax qns: + type = qns.Right; + break; + + default: + return null; + } + } + + return null; + } + } +} diff --git a/src/MoonSharp.HardwireGen/StringUtils.cs b/src/MoonSharp.HardwireGen/StringUtils.cs new file mode 100644 index 00000000..95316619 --- /dev/null +++ b/src/MoonSharp.HardwireGen/StringUtils.cs @@ -0,0 +1,14 @@ +using System; +using Microsoft.CodeAnalysis.CSharp; + +namespace MoonSharp.HardwireGen +{ + public static class StringUtils + { + public static string ToLiteral(this string input) + { + return SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(input)).ToFullString(); + } + + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/SymbolUtils.cs b/src/MoonSharp.HardwireGen/SymbolUtils.cs new file mode 100644 index 00000000..2e9cfa72 --- /dev/null +++ b/src/MoonSharp.HardwireGen/SymbolUtils.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.CodeAnalysis; + +namespace MoonSharp.HardwireGen +{ + public static class SymbolUtils + { + public static string TypeName(this ITypeSymbol type) + { + return type.ToDisplayString(new SymbolDisplayFormat( + SymbolDisplayGlobalNamespaceStyle.Omitted, + SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + SymbolDisplayGenericsOptions.IncludeTypeParameters, + miscellaneousOptions: SymbolDisplayMiscellaneousOptions.ExpandNullable + )); + } + public static IEnumerable<(int level,ISymbol symbol)> GetPublicMembers(this ITypeSymbol ts) + { + return IterateHierarchy(ts).SelectMany(n => + { + return n.Item2.GetMembers().Where(x => x.DeclaredAccessibility == Accessibility.Public) + .Select(y => (n.Item1, y)); + }); + } + public static IEnumerable<(int level, ITypeSymbol type)> IterateHierarchy(this ITypeSymbol type) + { + int i = 0; + var current = type; + while (current != null) + { + yield return (i++,current); + current = current.BaseType; + } + } + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/TabbedWriter.cs b/src/MoonSharp.HardwireGen/TabbedWriter.cs new file mode 100644 index 00000000..1e09f7b0 --- /dev/null +++ b/src/MoonSharp.HardwireGen/TabbedWriter.cs @@ -0,0 +1,61 @@ +using System; +using System.Text; +namespace MoonSharp.HardwireGen +{ + public class TabbedWriter + { + private StringBuilder builder = new StringBuilder(); + private int tabsCount = 0; + + public TabbedWriter Indent() + { + tabsCount++; + return this; + } + + public TabbedWriter UnIndent() + { + tabsCount--; + return this; + } + + private bool lineStarted = false; + + void StartLine() + { + if (!lineStarted) + { + lineStarted = true; + for (int i = 0; i < tabsCount; i++) builder.Append(" "); + } + } + + public TabbedWriter AppendLine(string line) + { + StartLine(); + builder.AppendLine(line); + lineStarted = false; + return this; + } + + public TabbedWriter AppendLine() + { + builder.AppendLine(); + lineStarted = false; + return this; + } + + + public TabbedWriter Append(string text) + { + StartLine(); + builder.Append(text); + return this; + } + + public override string ToString() + { + return builder.ToString(); + } + } +} \ No newline at end of file diff --git a/src/MoonSharp.HardwireGen/TypeGenQueue.cs b/src/MoonSharp.HardwireGen/TypeGenQueue.cs new file mode 100644 index 00000000..2e67f127 --- /dev/null +++ b/src/MoonSharp.HardwireGen/TypeGenQueue.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using Microsoft.CodeAnalysis; + +namespace MoonSharp.HardwireGen +{ + public class TypeGenQueue + { + private HashSet hs = new HashSet(); + private Queue queue = new Queue(); + + public bool Enqueue(ITypeSymbol item) + { + if (hs.Contains(item.TypeName())) return false; + hs.Add(item.TypeName()); + queue.Enqueue(item); + return true; + } + + public int Count => queue.Count; + + public ITypeSymbol Dequeue() => queue.Dequeue(); + } +} \ No newline at end of file diff --git a/src/MoonSharp.Interpreter.Tests/EmbeddableNUnitWrapper.cs b/src/MoonSharp.Interpreter.Tests/EmbeddableNUnitWrapper.cs deleted file mode 100755 index e4609fa7..00000000 --- a/src/MoonSharp.Interpreter.Tests/EmbeddableNUnitWrapper.cs +++ /dev/null @@ -1,97 +0,0 @@ -#if EMBEDTEST || UNITY_5 - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace NUnit.Framework -{ - public class TestAttribute : Attribute - { } - - public class IgnoreAttribute : Attribute - { } - - public class TestFixtureAttribute : Attribute - { } - - public class ExpectedExceptionAttribute : Attribute - { - public Type ExpectedException { get; set; } - - public ExpectedExceptionAttribute(Type t) - { - ExpectedException = t; - } - } - - public static class Assert - { - public static void AreEqualNum(int expected, double other, string message = null) - { - Assert.IsTrue((double)expected == other, message ?? string.Format("{0} was expected, {1} was returned", expected, other)); - } - - public static void AreEqual(object expected, object other, string message = null) - { - if (expected is int && other is double) - AreEqualNum((int)expected, (double)other, message); - else if (expected != null) - Assert.IsTrue(expected.Equals(other), message ?? string.Format("{0} was expected, {1} was returned", expected, other)); - else - Assert.IsTrue(other == null, message ?? string.Format("null was expected, {0} was returned", other)); - } - - public static void IsTrue(bool condition, string message) - { - if (!condition) - throw new Exception("Test failed : " + message); - } - - public static void IsFalse(bool condition, string message) - { - IsTrue(!condition, message); - } - - internal static void IsNotNull(object o) - { - IsFalse(o == null, "Object is null"); - } - - internal static void IsNotNullOrEmpty(string p) - { - IsFalse(string.IsNullOrEmpty(p), "String is null or empty"); - } - - internal static void IsTrue(bool p) - { - IsTrue(p, "Value not true"); - } - - internal static void Catch(Action a) - { - try - { - a(); - } - catch(Exception e) - { - Assert.IsTrue(e is ET); - } - } - - - - internal static void Fail() - { - Assert.IsTrue(false); - } - } - - - -} - - -#endif \ No newline at end of file diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/BinaryDumpTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/BinaryDumpTests.cs deleted file mode 100644 index da69f091..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/BinaryDumpTests.cs +++ /dev/null @@ -1,335 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class BinaryDumpTests - { - private DynValue Script_RunString(string script) - { - Script s1 = new Script(); - DynValue v1 = s1.LoadString(script); - - using (MemoryStream ms = new MemoryStream()) - { - s1.Dump(v1, ms); - ms.Seek(0, SeekOrigin.Begin); - - Script s2 = new Script(); - DynValue func = s2.LoadStream(ms); - return func.Function.Call(); - } - } - - private DynValue Script_LoadFunc(string script, string funcname) - { - Script s1 = new Script(); - DynValue v1 = s1.DoString(script); - DynValue func = s1.Globals.Get(funcname); - - using (MemoryStream ms = new MemoryStream()) - { - s1.Dump(func, ms); - ms.Seek(0, SeekOrigin.Begin); - - Script s2 = new Script(); - return s2.LoadStream(ms); - } - } - - - [Test] - public void BinDump_ChunkDump() - { - string script = @" - local chunk = load('return 81;'); - local str = string.dump(chunk); - local fn = load(str); - return fn(9); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(81, res.Number); - } - - [Test] - public void BinDump_StringDump() - { - string script = @" - local str = string.dump(function(n) return n * n; end); - local fn = load(str); - return fn(9); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(81, res.Number); - } - - [Test] - public void BinDump_StandardDumpFunc() - { - string script = @" - function fact(n) - return n * 24; - end - - local str = string.dump(fact); - - "; - - DynValue fact = Script_LoadFunc(script, "fact"); - DynValue res = fact.Function.Call(5); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120, res.Number); - } - - - - [Test] - public void BinDump_FactorialDumpFunc() - { - string script = @" - function fact(n) - if (n == 0) then return 1; end - return fact(n - 1) * n; - end - "; - - DynValue fact = Script_LoadFunc(script, "fact"); - fact.Function.OwnerScript.Globals.Set("fact", fact); - DynValue res = fact.Function.Call(5); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120, res.Number); - } - - [Test] - public void BinDump_FactorialDumpFuncGlobal() - { - string script = @" - x = 0 - - function fact(n) - if (n == x) then return 1; end - return fact(n - 1) * n; - end - "; - - DynValue fact = Script_LoadFunc(script, "fact"); - fact.Function.OwnerScript.Globals.Set("fact", fact); - fact.Function.OwnerScript.Globals.Set("x", DynValue.NewNumber(0)); - DynValue res = fact.Function.Call(5); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120, res.Number); - } - - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void BinDump_FactorialDumpFuncUpvalue() - { - string script = @" - local x = 0 - - function fact(n) - if (n == x) then return 1; end - return fact(n - 1) * n; - end - "; - - DynValue fact = Script_LoadFunc(script, "fact"); - fact.Function.OwnerScript.Globals.Set("fact", fact); - fact.Function.OwnerScript.Globals.Set("x", DynValue.NewNumber(0)); - DynValue res = fact.Function.Call(5); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120, res.Number); - } - - - - - - - - - - - - - - - - - - - - - - - - [Test] - public void BinDump_FactorialClosure() - { - string script = @" -local x = 5; - -function fact(n) - if (n == x) then return 1; end - return fact(n - 1) * n; -end - -x = 0; - -y = fact(5); - -x = 3; - -y = y + fact(5); - -return y; -"; - - DynValue res = Script_RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(140, res.Number); - } - - [Test] - public void BinDump_ClosureOnParam() - { - string script = @" - local function g (z) - local function f(a) - return a + z; - end - return f; - end - - return (g(3)(2));"; - - DynValue res = Script_RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(5, res.Number); - } - - [Test] - public void BinDump_NestedUpvalues() - { - string script = @" - local y = y; - - local x = 0; - local m = { }; - - function m:a() - self.t = { - dojob = function() - if (x == 0) then return 1; else return 0; end - end, - }; - end - - m:a(); - - return 10 * m.t.dojob(); - "; - - DynValue res = Script_RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - - [Test] - public void BinDump_NestedOutOfScopeUpvalues() - { - string script = @" - - function X() - local y = y; - - local x = 0; - local m = { }; - - function m:a() - self.t = { - dojob = function() - if (x == 0) then return 1; else return 0; end - end, - }; - end - - return m; - end - - Q = X(); - - Q:a(); - - return 10 * Q.t.dojob(); - "; - - DynValue res = Script_RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - - [Test] - public void Load_ChangeEnvWithDebugSetUpvalue() - { - List list = new List(); - - string script = @" - function print_env() - print(_ENV) - end - - function sandbox() - print(_ENV) -- prints: 'table: 0x100100610' - -- need to keep access to a few globals: - _ENV = { print = print, print_env = print_env, debug = debug, load = load } - print(_ENV) -- prints: 'table: 0x100105140' - print_env() -- prints: 'table: 0x100105140' - local code1 = load('print(_ENV)') - code1() -- prints: 'table: 0x100100610' - debug.setupvalue(code1, 0, _ENV) -- set our modified env - debug.setupvalue(code1, 1, _ENV) -- set our modified env - code1() -- prints: 'table: 0x100105140' - local code2 = load('print(_ENV)', nil, nil, _ENV) -- pass 'env' arg - code2() -- prints: 'table: 0x100105140' - end - - sandbox()"; - - Script S = new Script(CoreModules.Preset_Complete); - - S.Globals["print"] = (Action)(t => list.Add(t)); - - S.DoString(script); - - Assert.AreEqual(6, list.Count); - - int[] eqs = new int[] { 0, 1, 1, 0, 1, 1 }; - - for (int i = 0; i < 6; i++) - Assert.AreEqual(list[eqs[i]], list[i]); - } - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/ConfigPropertyAssignerTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/ConfigPropertyAssignerTests.cs deleted file mode 100644 index b19342d8..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/ConfigPropertyAssignerTests.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter.Interop; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class ConfigPropertyAssignerTests - { - private class MySubclass - { - [MoonSharpProperty] - public string MyString { get; set; } - - [MoonSharpProperty("number")] - public int MyNumber { get; private set; } - } - - private class MyClass - { - [MoonSharpProperty] - public string MyString { get; set; } - - [MoonSharpProperty("number")] - public int MyNumber { get; private set; } - - [MoonSharpProperty] - internal Table SomeTable { get; private set; } - - [MoonSharpProperty] - public DynValue NativeValue { get; private set; } - - [MoonSharpProperty] - public MySubclass SubObj { get; private set; } - } - - private MyClass Test(string tableDef) - { - Script s = new Script(CoreModules.None); - - DynValue table = s.DoString("return " + tableDef); - - Assert.AreEqual(DataType.Table, table.Type); - - PropertyTableAssigner pta = new PropertyTableAssigner("class"); - PropertyTableAssigner pta2 = new PropertyTableAssigner(); - - pta.SetSubassigner(pta2); - - MyClass o = new MyClass(); - - pta.AssignObject(o, table.Table); - - return o; - } - - [Test] - public void ConfigProp_SimpleAssign() - { - MyClass x = Test(@" - { - class = 'oohoh', - myString = 'ciao', - number = 3, - some_table = {}, - nativeValue = function() end, - subObj = { number = 15, myString = 'hi' }, - }"); - - Assert.AreEqual(x.MyNumber, 3); - Assert.AreEqual(x.MyString, "ciao"); - Assert.AreEqual(x.NativeValue.Type, DataType.Function); - Assert.AreEqual(x.SubObj.MyNumber, 15); - Assert.AreEqual(x.SubObj.MyString, "hi"); - Assert.IsNotNull(x.SomeTable); - - } - - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void ConfigProp_ThrowsOnInvalid() - { - MyClass x = Test(@" - { - class = 'oohoh', - myString = 'ciao', - number = 3, - some_table = {}, - invalid = 3, - nativeValue = function() end, - }"); - - Assert.AreEqual(x.MyNumber, 3); - Assert.AreEqual(x.MyString, "ciao"); - Assert.AreEqual(x.NativeValue.Type, DataType.Function); - Assert.IsNotNull(x.SomeTable); - - } - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/CoroutineTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/CoroutineTests.cs deleted file mode 100644 index c8402487..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/CoroutineTests.cs +++ /dev/null @@ -1,293 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - class CoroutineTests - { - [Test] - public void Coroutine_Basic() - { - string script = @" - s = '' - - function foo() - for i = 1, 4 do - s = s .. i; - coroutine.yield(); - end - end - - function bar() - for i = 5, 9 do - s = s .. i; - coroutine.yield(); - end - end - - cf = coroutine.create(foo); - cb = coroutine.create(bar); - - for i = 1, 4 do - coroutine.resume(cf); - s = s .. '-'; - coroutine.resume(cb); - s = s .. ';'; - end - - return s; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1-5;2-6;3-7;4-8;", res.String); - } - - [Test] - public void Coroutine_Wrap() - { - string script = @" - s = '' - - function foo() - for i = 1, 4 do - s = s .. i; - coroutine.yield(); - end - end - - function bar() - for i = 5, 9 do - s = s .. i; - coroutine.yield(); - end - end - - cf = coroutine.wrap(foo); - cb = coroutine.wrap(bar); - - for i = 1, 4 do - cf(); - s = s .. '-'; - cb(); - s = s .. ';'; - end - - return s; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1-5;2-6;3-7;4-8;", res.String); - } - - [Test] - public void Coroutine_ClrBoundaryHandling() - { - string code = @" - function a() - callback(b) - end - - function b() - coroutine.yield(); - end - - c = coroutine.create(a); - - return coroutine.resume(c); - "; - - // Load the code and get the returned function - Script script = new Script(); - - script.Globals["callback"] = DynValue.NewCallback( - (ctx, args) => args[0].Function.Call() - ); - - DynValue ret = script.DoString(code); - - Assert.AreEqual(DataType.Tuple, ret.Type); - Assert.AreEqual(2, ret.Tuple.Length); - Assert.AreEqual(DataType.Boolean, ret.Tuple[0].Type); - Assert.AreEqual(false, ret.Tuple[0].Boolean); - Assert.AreEqual(DataType.String, ret.Tuple[1].Type); - Assert.IsTrue(ret.Tuple[1].String.EndsWith("attempt to yield across a CLR-call boundary")); - } - - [Test] - public void Coroutine_VariousErrorHandling() - { - string last = ""; - string code = @" - -function checkresume(step, ex, ey) - local x, y = coroutine.resume(c) - - assert(x == ex, 'Step ' .. step .. ': ' .. tostring(ex) .. ' was expected, got ' .. tostring(x)); - assert(y:endsWith(ey), 'Step ' .. step .. ': ' .. tostring(ey) .. ' was expected, got ' .. tostring(y)); -end - - -t = { } -m = { __tostring = function() print('2'); coroutine.yield(); print('3'); end } - -setmetatable(t, m); - - -function a() - checkresume(1, false, 'cannot resume non-suspended coroutine'); - coroutine.yield('ok'); - print(t); - coroutine.yield('ok'); -end - -c = coroutine.create(a); - -checkresume(2, true, 'ok'); -checkresume(3, false, 'attempt to yield across a CLR-call boundary'); -checkresume(4, false, 'cannot resume dead coroutine'); -checkresume(5, false, 'cannot resume dead coroutine'); -checkresume(6, false, 'cannot resume dead coroutine'); - - "; - - // Load the code and get the returned function - Script script = new Script(); - - script.Options.DebugPrint = (s) => last = s; - - script.DoString(code); - - Assert.AreEqual(last, "2"); - } - - [Test] - public void Coroutine_Direct_Resume() - { - string code = @" - return function() - local x = 0 - while true do - x = x + 1 - coroutine.yield(x) - if (x > 5) then - return 7 - end - end - end - "; - - // Load the code and get the returned function - Script script = new Script(); - DynValue function = script.DoString(code); - - // Create the coroutine in C# - DynValue coroutine = script.CreateCoroutine(function); - - // Loop the coroutine - string ret = ""; - while (coroutine.Coroutine.State != CoroutineState.Dead) - { - DynValue x = coroutine.Coroutine.Resume(); - ret = ret + x.ToString(); - } - - Assert.AreEqual("1234567", ret); - } - - - [Test] - public void Coroutine_Direct_AsEnumerable() - { - string code = @" - return function() - local x = 0 - while true do - x = x + 1 - coroutine.yield(x) - if (x > 5) then - return 7 - end - end - end - "; - - // Load the code and get the returned function - Script script = new Script(); - DynValue function = script.DoString(code); - - // Create the coroutine in C# - DynValue coroutine = script.CreateCoroutine(function); - - // Loop the coroutine - string ret = ""; - - foreach (DynValue x in coroutine.Coroutine.AsTypedEnumerable()) - { - ret = ret + x.ToString(); - } - - Assert.AreEqual("1234567", ret); - } - - - [Test] - public void Coroutine_AutoYield() - { - string code = @" - function fib(n) - if (n == 0 or n == 1) then - return 1; - else - return fib(n - 1) + fib(n - 2); - end - end - "; - - // Load the code and get the returned function - Script script = new Script(CoreModules.None); - script.DoString(code); - - // get the function - DynValue function = script.Globals.Get("fib"); - - // Create the coroutine in C# - DynValue coroutine = script.CreateCoroutine(function); - - // Set the automatic yield counter every 10 instructions. - // 10 is a too small! Use a much bigger value in your code to avoid interrupting too often! - coroutine.Coroutine.AutoYieldCounter = 10; - - int cycles = 0; - DynValue result = null; - - // Cycle until we get that the coroutine has returned something useful and not an automatic yield.. - for (result = coroutine.Coroutine.Resume(8); - result.Type == DataType.YieldRequest; - result = coroutine.Coroutine.Resume()) - { - cycles += 1; - } - - // Check the values of the operation - Assert.AreEqual(DataType.Number, result.Type); - Assert.AreEqual(34, result.Number); - - // Check the autoyield actually triggered - Assert.IsTrue(cycles > 10); - } - - - - - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/GotoTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/GotoTests.cs deleted file mode 100644 index 932e0b7b..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/GotoTests.cs +++ /dev/null @@ -1,220 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class GotoTests - { - [Test] - public void Goto_Simple_Fwd() - { - string script = @" - function test() - x = 3 - goto skip - x = x + 2; - ::skip:: - return x; - end - - return test(); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - public void Goto_Simple_Bwd() - { - string script = @" - function test() - x = 5; - - ::jump:: - if (x == 3) then return x; end - - x = 3 - goto jump - - x = 4 - return x; - end - - return test(); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void Goto_UndefinedLabel() - { - string script = @" - goto there - "; - - Script.RunString(script); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void Goto_DoubleDefinedLabel() - { - string script = @" - ::label:: - ::label:: - "; - - Script.RunString(script); - } - - [Test] - public void Goto_RedefinedLabel() - { - string script = @" - ::label:: - do - ::label:: - end - "; - - Script.RunString(script); - } - - [Test] - public void Goto_RedefinedLabel_Goto() - { - string script = @" - ::label:: - do - goto label - do return 5 end - ::label:: - return 3 - end - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void Goto_UndefinedLabel_2() - { - string script = @" - goto label - do - do return 5 end - ::label:: - return 3 - end - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void Goto_VarInScope() - { - string script = @" - goto f - local x - ::f:: - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - - [Test] - public void Goto_JumpOutOfBlocks() - { - string script = @" - local u = 4 - - do - local x = 5 - - do - local y = 6 - - do - local z = 7 - end - - goto out - end - end - - do return 5 end - - ::out:: - - return 3 - "; - - DynValue res = Script.RunString(script); - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - public void Goto_JumpOutOfScopes() - { - string script = @" - local u = 4 - - do - local x = 5 - do - local y = 6 - do - goto out - local z = 7 - end - - end - end - - ::out:: - - do - local a - local b = 55 - - if (a == nil) then - b = b + 12 - end - - return b - end - - "; - - DynValue res = Script.RunString(script); - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(67, res.Number); - } - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs deleted file mode 100644 index c99bdd91..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/SimpleTests.cs +++ /dev/null @@ -1,1556 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using MoonSharp.Interpreter.Execution; -using NUnit.Framework; -using MoonSharp.Interpreter.Loaders; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class SimpleTests - { - [Test] - public void EmptyLongComment() - { - Script S = new Script(CoreModules.None); - DynValue res = S.DoString("--[[]]"); - } - - - [Test] - public void EmptyChunk() - { - Script S = new Script(CoreModules.None); - DynValue res = S.DoString(""); - } - - [Test] - public void CSharpStaticFunctionCallStatement() - { - IList args = null; - - string script = "print(\"hello\", \"world\");"; - - Script S = new Script(); - - S.Globals.Set("print", DynValue.NewCallback(new CallbackFunction((x, a) => - { - args = a.GetArray(); - return DynValue.NewNumber(1234.0); - }))); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Void, res.Type); - Assert.AreEqual(2, args.Count); - Assert.AreEqual(DataType.String, args[0].Type); - Assert.AreEqual("hello", args[0].String); - Assert.AreEqual(DataType.String, args[1].Type); - Assert.AreEqual("world", args[1].String); - } - - [Test] - public void CSharpStaticFunctionCallRedef() - { - IList args = null; - - string script = "local print = print; print(\"hello\", \"world\");"; - - var S = new Script(); - S.Globals.Set("print", DynValue.NewCallback(new CallbackFunction((_x, a) => { args = a.GetArray(); return DynValue.NewNumber(1234.0); }))); - - DynValue res = S.DoString(script); - - Assert.AreEqual(2, args.Count); - Assert.AreEqual(DataType.String, args[0].Type); - Assert.AreEqual("hello", args[0].String); - Assert.AreEqual(DataType.String, args[1].Type); - Assert.AreEqual("world", args[1].String); - Assert.AreEqual(DataType.Void, res.Type); - } - - [Test] - public void CSharpStaticFunctionCall4() - { - string script = "return callback()();"; - - var callback2 = DynValue.NewCallback(new CallbackFunction((_x, a) => { return DynValue.NewNumber(1234.0); })); - var callback = DynValue.NewCallback(new CallbackFunction((_x, a) => { return callback2; })); - - var S = new Script(); - S.Globals.Set("callback", callback); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1234.0, res.Number); - } - - [Test] - public void CSharpStaticFunctionCall3() - { - string script = "return callback();"; - - var callback = DynValue.NewCallback(new CallbackFunction((_x, a) => { return DynValue.NewNumber(1234.0); })); - - var S = new Script(); - S.Globals.Set("callback", callback); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1234.0, res.Number); - } - - [Test] - public void CSharpStaticFunctionCall2() - { - IList args = null; - - string script = "return callback 'hello';"; - - var S = new Script(); - S.Globals.Set("callback", DynValue.NewCallback(new CallbackFunction((_x, a) => { args = a.GetArray(); return DynValue.NewNumber(1234.0); }))); - - DynValue res = S.DoString(script); - - Assert.AreEqual(1, args.Count); - Assert.AreEqual(DataType.String, args[0].Type); - Assert.AreEqual("hello", args[0].String); - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1234.0, res.Number); - } - - [Test] - public void CSharpStaticFunctionCall() - { - IList args = null; - - string script = "return print(\"hello\", \"world\");"; - - var S = new Script(); - S.Globals.Set("print", DynValue.NewCallback(new CallbackFunction((_x, a) => { args = a.GetArray(); return DynValue.NewNumber(1234.0); }))); - - DynValue res = S.DoString(script); - - Assert.AreEqual(2, args.Count); - Assert.AreEqual(DataType.String, args[0].Type); - Assert.AreEqual("hello", args[0].String); - Assert.AreEqual(DataType.String, args[1].Type); - Assert.AreEqual("world", args[1].String); - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1234.0, res.Number); - } - - [Test] - //!!! DO NOT REFORMAT THIS METHOD !!! - public void LongStrings() - { - string script = @" - x = [[ - ciao - ]]; - - y = [=[ [[uh]] ]=]; - - z = [===[[==[[=[[[eheh]]=]=]]===] - - return x,y,z"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(3, res.Tuple.Length); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual(DataType.String, res.Tuple[1].Type); - Assert.AreEqual(DataType.String, res.Tuple[2].Type); - Assert.AreEqual("\t\t\t\t\tciao\n\t\t\t\t", res.Tuple[0].String); - Assert.AreEqual(" [[uh]] ", res.Tuple[1].String); - Assert.AreEqual("[==[[=[[[eheh]]=]=]", res.Tuple[2].String); - } - - - [Test] - public void UnicodeEscapeLua53Style() - { - string script = @" - x = 'ciao\u{41}'; - return x;"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("ciaoA", res.String); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void InvalidEscape() - { - string script = @" - x = 'ciao\k{41}'; - return x;"; - - DynValue res = Script.RunString(script); - } - - [Test] - public void KeywordsInStrings() - { - string keywrd = "and break do else elseif end false end for function end goto if ::in:: in local nil not [or][[][==][[]] repeat return { then 0 end return; }; then true (x != 5 or == * 3 - 5) x"; - - string script = string.Format(@" - x = '{0}'; - return x;", keywrd); - - DynValue res = Script.RunString(script); - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual(keywrd, res.String); - } - - - - [Test] - public void ParserErrorMessage() - { - bool caught = false; - string script = @" - return 'It's a wet floor warning saying wheat flour instead. \ - Probably, the cook thought it was funny. \ - He was wrong.'"; - - try - { - DynValue res = Script.RunString(script); - } - catch (SyntaxErrorException ex) - { - caught = true; - Assert.IsNotNullOrEmpty(ex.Message); - } - - Assert.IsTrue(caught); - } - - [Test] - public void StringsWithBackslashLineEndings2() - { - string script = @" - return 'a\ - b\ - c'"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - } - - [Test] - public void StringsWithBackslashLineEndings() - { - string script = @" - return 'It is a wet floor warning saying wheat flour instead. \ - Probably, the cook thought it was funny. \ - He was wrong.'"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - } - - [Test] - public void FunctionCallWrappers() - { - string script = @" - function boh(x) - return 1912 + x; - end - "; - - Script s = new Script(); - s.DoString(script); - - DynValue res = s.Globals.Get("boh").Function.Call(82); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - - [Test] - public void ReturnSimpleUnop() - { - string script = @"return -42"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(-42, res.Number); - } - - [Test] - public void ReturnSimple() - { - string script = @"return 42"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(42, res.Number); - } - - - [Test] - public void OperatorSimple() - { - string script = @"return 6*7"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(42, res.Number); - } - - - [Test] - public void SimpleBoolShortCircuit() - { - string script = @" - x = true or crash(); - y = false and crash(); - "; - - Script S = new Script(); - S.Globals.Set("crash", DynValue.NewCallback(new CallbackFunction((_x, a) => - { - throw new Exception("FAIL!"); - }))); - - S.DoString(script); - } - - [Test] - public void FunctionOrOperator() - { - string script = @" - loadstring = loadstring or load; - - return loadstring; - "; - - Script S = new Script(); - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.ClrFunction, res.Type); - - } - - - [Test] - public void SelectNegativeIndex() - { - string script = @" - return select(-1,'a','b','c'); - "; - - Script S = new Script(); - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("c", res.String); - } - - - - - - [Test] - public void BoolConversionAndShortCircuit() - { - string script = @" - i = 0; - - function f() - i = i + 1; - return '!'; - end - - x = false; - y = true; - - return false or f(), true or f(), false and f(), true and f(), i"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(5, res.Tuple.Length); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual(DataType.Boolean, res.Tuple[1].Type); - Assert.AreEqual(DataType.Boolean, res.Tuple[2].Type); - Assert.AreEqual(DataType.String, res.Tuple[3].Type); - Assert.AreEqual(DataType.Number, res.Tuple[4].Type); - Assert.AreEqual("!", res.Tuple[0].String); - Assert.AreEqual(true, res.Tuple[1].Boolean); - Assert.AreEqual(false, res.Tuple[2].Boolean); - Assert.AreEqual("!", res.Tuple[3].String); - Assert.AreEqual(2, res.Tuple[4].Number); - } - [Test] - public void HanoiTowersDontCrash() - { - string script = @" - function move(n, src, dst, via) - if n > 0 then - move(n - 1, src, via, dst) - move(n - 1, via, dst, src) - end - end - - move(4, 1, 2, 3) - "; - - DynValue res = Script.RunString(script); - } - - [Test] - public void Factorial() - { - string script = @" - -- defines a factorial function - function fact (n) - if (n == 0) then - return 1 - else - return n*fact(n - 1) - end - end - - return fact(5)"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120.0, res.Number); - } - - [Test] - public void IfStatmWithScopeCheck() - { - string script = @" - x = 0 - - if (x == 0) then - local i = 3; - x = i * 2; - end - - return i, x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Nil, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(6, res.Tuple[1].Number); - } - - [Test] - public void ScopeBlockCheck() - { - string script = @" - local x = 6; - - do - local i = 33; - end - - return i, x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Nil, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(6, res.Tuple[1].Number); - } - - [Test] - public void ForLoopWithBreak() - { - string script = @" - x = 0 - - for i = 1, 10 do - x = i - break; - end - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1, res.Number); - } - - - [Test] - public void ForEachLoopWithBreak() - { - string script = @" - x = 0 - y = 0 - - t = { 2, 4, 6, 8, 10, 12 }; - - function iter (a, ii) - ii = ii + 1 - local v = a[ii] - if v then - return ii, v - end - end - - function ipairslua (a) - return iter, a, 0 - end - - for i,j in ipairslua(t) do - x = x + i - y = y + j - - if (i >= 3) then - break - end - end - - return x, y"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(6, res.Tuple[0].Number); - Assert.AreEqual(12, res.Tuple[1].Number); - } - - - [Test] - public void ForEachLoop() - { - string script = @" - x = 0 - y = 0 - - t = { 2, 4, 6, 8, 10, 12 }; - - function iter (a, ii) - ii = ii + 1 - local v = a[ii] - if v then - return ii, v - end - end - - function ipairslua (a) - return iter, a, 0 - end - - for i,j in ipairslua(t) do - x = x + i - y = y + j - end - - return x, y"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(21, res.Tuple[0].Number); - Assert.AreEqual(42, res.Tuple[1].Number); - } - - [Test] - public void LengthOperator() - { - string script = @" - x = 'ciao' - y = { 1, 2, 3 } - - return #x, #y"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(4, res.Tuple[0].Number); - Assert.AreEqual(3, res.Tuple[1].Number); - } - - - [Test] - public void ForLoopWithBreakAndScopeCheck() - { - string script = @" - x = 0 - - for i = 1, 10 do - x = x + i - - if (i == 3) then - break - end - end - - return i, x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Nil, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(6, res.Tuple[1].Number); - } - - [Test] - public void FactorialWithOneReturn() - { - string script = @" - -- defines a factorial function - function fact (n) - if (n == 0) then - return 1 - end - return n*fact(n - 1) - end - - return fact(5)"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120.0, res.Number); - } - - [Test] - public void VeryBasic() - { - string script = @"return 7"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(7, res.Number); - } - - [Test] - public void OperatorPrecedence1() - { - string script = @"return 1+2*3"; - - Script s = new Script(CoreModules.None); - DynValue res = s.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(7, res.Number); - } - [Test] - public void OperatorPrecedence2() - { - string script = @"return 2*3+1"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(7, res.Number); - } - - [Test] - public void OperatorAssociativity() - { - string script = @"return 2^3^2"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(512, res.Number); - } - - [Test] - public void OperatorPrecedence3() - { - string script = @"return 5-3-2"; - Script S = new Script(CoreModules.None); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(0, res.Number); - } - - [Test] - public void OperatorPrecedence4() - { - string script = @"return 3 + -1"; - Script S = new Script(CoreModules.None); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(2, res.Number); - } - - [Test] - public void OperatorPrecedence5() - { - string script = @"return 3 * -1 + 5 * 3"; - Script S = new Script(CoreModules.None); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(12, res.Number); - } - - [Test] - public void OperatorPrecedence6() - { - string script = @"return -2^2"; - Script S = new Script(CoreModules.None); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(-4, res.Number); - } - - [Test] - public void OperatorPrecedence7() - { - string script = @"return -7 / 0.5"; - Script S = new Script(CoreModules.None); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(-14, res.Number); - } - - [Test] - public void OperatorPrecedenceAndAssociativity() - { - string script = @"return 5+3*7-2*5+2^3^2"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(528, res.Number); - } - - [Test] - public void OperatorParenthesis() - { - string script = @"return (5+3)*7-2*5+(2^3)^2"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(110, res.Number); - } - - [Test] - public void GlobalVarAssignment() - { - string script = @"x = 1; return x;"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1, res.Number); - } - [Test] - public void TupleAssignment1() - { - string script = @" - function y() - return 2, 3 - end - - function x() - return 1, y() - end - - w, x, y, z = 0, x() - - return w+x+y+z"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(6, res.Number); - } - - [Test] - public void IterativeFactorialWithWhile() - { - string script = @" - function fact (n) - local result = 1; - while(n > 0) do - result = result * n; - n = n - 1; - end - return result; - end - - return fact(5)"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120.0, res.Number); - } - - - - [Test] - public void IterativeFactorialWithRepeatUntilAndScopeCheck() - { - string script = @" - function fact (n) - local result = 1; - repeat - local checkscope = 1; - result = result * n; - n = n - 1; - until (n == 0 and checkscope == 1) - return result; - end - - return fact(5)"; - - Script s = new Script(CoreModules.None); - DynValue res = s.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120.0, res.Number); - } - - [Test] - - public void SimpleForLoop() - { - string script = @" - x = 0 - for i = 1, 3 do - x = x + i; - end - - return x; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(6.0, res.Number); - } - - [Test] - public void SimpleFunc() - { - string script = @" - function fact (n) - return 3; - end - - return fact(3)"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - public void IterativeFactorialWithFor() - { - string script = @" - -- defines a factorial function - function fact (n) - x = 1 - for i = n, 1, -1 do - x = x * i; - end - - return x; - end - - return fact(5)"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(120.0, res.Number); - } - - - [Test] - public void LocalFunctionsObscureScopeRule() - { - string script = @" - local function fact() - return fact; - end - - return fact(); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Function, res.Type); - } - - [Test] - public void FunctionWithStringArg2() - { - string script = @" - x = 0; - - fact = function(y) - x = y - end - - fact 'ciao'; - - return x; - "; - - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("ciao", res.String); - } - - [Test] - public void FunctionWithStringArg() - { - string script = @" - x = 0; - - function fact(y) - x = y - end - - fact 'ciao'; - - return x; - "; - - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("ciao", res.String); - - } - - [Test] - public void FunctionWithTableArg() - { - string script = @" - x = 0; - - function fact(y) - x = y - end - - fact { 1,2,3 }; - - return x; - "; - - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Table, res.Type); - - } - - - [Test] - public void TupleAssignment2() - { - string script = @" - function boh() - return 1, 2; - end - - x,y,z = boh(), boh() - - return x,y,z; - "; - - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(DataType.Number, res.Tuple[2].Type); - Assert.AreEqual(1, res.Tuple[0].Number); - Assert.AreEqual(1, res.Tuple[1].Number); - Assert.AreEqual(2, res.Tuple[2].Number); - } - [Test] - public void LoopWithReturn() - { - string script = @"function Allowed( ) - for i = 1, 20 do - return false - end - return true - end - Allowed(); - "; - - DynValue res = Script.RunString(script); - - } - [Test] - public void IfWithLongExpr() - { - string script = @"function Allowed( ) - for i = 1, 20 do - if ( false ) or ( true and true ) or ( 7+i <= 9 and false ) then - return false - end - end - return true - end - Allowed(); - "; - - DynValue res = Script.RunString(script); - - } - - [Test] - public void IfWithLongExprTbl() - { - string script = @" - t = { {}, {} } - - function Allowed( ) - for i = 1, 20 do - if ( t[1][3] ) or ( i <= 17 and t[1][1] ) or ( 7+i <= 9 and t[1][1] ) then - return false - end - end - return true - end - Allowed(); - "; - - DynValue res = Script.RunString(script); - - } - - [Test] - public void ExpressionReducesTuples() - { - string script = @" - function x() - return 1,2 - end - - do return (x()); end - do return x(); end - "; - - DynValue res = (new Script(CoreModules.None)).DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1, res.Number); - } - - - [Test] - public void ExpressionReducesTuples2() - { - string script = @" - function x() - return 3,4 - end - - return 1,x(),x() - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(4, res.Tuple.Length); - } - - - [Test] - public void ArgsDoNotChange() - { - string script = @" - local a = 1; - local b = 2; - - function x(c, d) - c = c + 3; - d = d + 4; - return c + d; - end - - return x(a, b+1), a, b; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(3, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(DataType.Number, res.Tuple[2].Type); - Assert.AreEqual(11, res.Tuple[0].Number); - Assert.AreEqual(1, res.Tuple[1].Number); - Assert.AreEqual(2, res.Tuple[2].Number); - } - - - [Test] - public void VarArgsNoError() - { - string script = @" - function x(...) - - end - - function y(a, ...) - - end - - return 1; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1, res.Number); - } - - [Test] - public void VarArgsSum() - { - string script = @" - function x(...) - local t = pack(...); - local sum = 0; - - for i = 1, #t do - sum = sum + t[i]; - end - - return sum; - end - - return x(1,2,3,4); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - [Test] - public void VarArgsSum2() - { - string script = @" - function x(m, ...) - local t = pack(...); - local sum = 0; - - for i = 1, #t do - sum = sum + t[i]; - end - - return sum * m; - end - - return x(5,1,2,3,4); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(50, res.Number); - } - - [Test] - public void VarArgsSumTb() - { - string script = @" - function x(...) - local t = {...}; - local sum = 0; - - for i = 1, #t do - sum = sum + t[i]; - end - - return sum; - end - - return x(1,2,3,4); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - [Test] - public void SwapPattern() - { - string script = @" - local n1 = 1 - local n2 = 2 - local n3 = 3 - local n4 = 4 - n1,n2,n3,n4 = n4,n3,n2,n1 - - return n1,n2,n3,n4; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(4, res.Tuple.Length); - Assert.AreEqual(4, res.Tuple[0].Number); - Assert.AreEqual(3, res.Tuple[1].Number); - Assert.AreEqual(2, res.Tuple[2].Number); - Assert.AreEqual(1, res.Tuple[3].Number); - } - - [Test] - public void SwapPatternGlobal() - { - string script = @" - n1 = 1 - n2 = 2 - n3 = 3 - n4 = 4 - n1,n2,n3,n4 = n4,n3,n2,n1 - - return n1,n2,n3,n4; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(4, res.Tuple.Length); - Assert.AreEqual(4, res.Tuple[0].Number); - Assert.AreEqual(3, res.Tuple[1].Number); - Assert.AreEqual(2, res.Tuple[2].Number); - Assert.AreEqual(1, res.Tuple[3].Number); - } - - [Test] - public void EnvTestSuite() - { - string script = @" - local RES = { } - - RES.T1 = (_ENV == _G) - - a = 1 - - local function f(t) - local _ENV = t - - RES.T2 = (getmetatable == nil) - - a = 2 -- create a new entry in t, doesn't touch the original 'a' global - b = 3 -- create a new entry in t - end - - local t = {} - f(t) - - RES.T3 = a; - RES.T4 = b; - RES.T5 = t.a; - RES.T6 = t.b; - - return RES; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Table, res.Type); - - Table T = res.Table; - - Assert.AreEqual(DataType.Boolean, T.Get("T1").Type, "T1-Type"); - Assert.AreEqual(true, T.Get("T1").Boolean, "T1-Val"); - - Assert.AreEqual(DataType.Boolean, T.Get("T2").Type, "T2-Type"); - Assert.AreEqual(true, T.Get("T2").Boolean, "T2-Val"); - - Assert.AreEqual(DataType.Number, T.Get("T3").Type, "T3-Type"); - Assert.AreEqual(1, T.Get("T3").Number, "T3-Val"); - - Assert.AreEqual(DataType.Nil, T.Get("T4").Type, "T4"); - - Assert.AreEqual(DataType.Number, T.Get("T5").Type, "T5-Type"); - Assert.AreEqual(2, T.Get("T5").Number, "T5-Val"); - - Assert.AreEqual(DataType.Number, T.Get("T6").Type, "T6-Type"); - Assert.AreEqual(3, T.Get("T6").Number, "T6-Val"); - } - - [Test] - public void TupleToOperator() - { - string script = @" - function x() - return 3, 'xx'; - end - - return x() == 3; - "; - - Script S = new Script(CoreModules.None); - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Boolean, res.Type); - Assert.AreEqual(true, res.Boolean); - } - - - [Test] - public void LiteralExpands() - { - string script = @" - x = 'a\65\66\67z'; - return x; - "; - - Script S = new Script(CoreModules.None); - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("aABCz", res.String); - } - - [Test] - public void HomonymArguments() - { - string script = @" - function test(_,value,_) return _; end - - return test(1, 2, 3); - "; - - Script S = new Script(CoreModules.None); - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(3, res.Number); - } - - [Test] - public void VarArgsSumMainChunk() - { - string script = @" - local t = pack(...); - local sum = 0; - - for i = 1, #t do - sum = sum + t[i]; - end - - return sum; - "; - - DynValue fn = new Script().LoadString(script); - - DynValue res = fn.Function.Call(1, 2, 3, 4); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - [Test] - [ExpectedException(typeof(SyntaxErrorException))] - public void VarArgsInNoVarArgsReturnsError() - { - string script = @" - function x() - local t = {...}; - local sum = 0; - - for i = 1, #t do - sum = sum + t[i]; - end - - return sum; - end - - return x(1,2,3,4); - "; - - DynValue res = Script.RunString(script); - } - - [Test] - public void HexFloats_1() - { - string script = "return 0x0.1E"; - DynValue result = Script.RunString(script); - Assert.AreEqual((double)0x1E / (double)0x100, result.Number); - } - - [Test] - public void HexFloats_2() - { - string script = "return 0xA23p-4"; - DynValue result = Script.RunString(script); - Assert.AreEqual((double)0xA23 / 16.0, result.Number); - } - - [Test] - public void HexFloats_3() - { - string script = "return 0X1.921FB54442D18P+1"; - DynValue result = Script.RunString(script); - Assert.AreEqual((1 + (double)0x921FB54442D18 / (double)0x10000000000000) * 2, result.Number); - } - - [Test] - public void Simple_Delegate_Interop_1() - { - int a = 3; - var script = new Script(); - script.Globals["action"] = new Action(() => a = 5); - script.DoString("action()"); - Assert.AreEqual(5, a); - } - - [Test] - public void Simple_Delegate_Interop_2() - { - var oldPolicy = UserData.RegistrationPolicy; - - try - { - UserData.RegistrationPolicy = Interop.InteropRegistrationPolicy.Automatic; - - int a = 3; - var script = new Script(); - script.Globals["action"] = new Action(() => a = 5); - script.DoString("action()"); - Assert.AreEqual(5, a); - } - finally - { - UserData.RegistrationPolicy = oldPolicy; - } - } - - [Test] - public void MissingArgsDefaultToNil() - { - Script S = new Script(CoreModules.None); - DynValue res = S.DoString(@" - function test(a) - return a; - end - - test(); - "); - } - - [Test] - public void ParsingTest() - { - Script S = new Script(CoreModules.None); - DynValue res = S.LoadString(@" - t = {'a', 'b', 'c', ['d'] = 'f', ['e'] = 5, [65] = true, [true] = false} - function myFunc() - return 'one', 'two' - end - - print('Table Test 1:') - for k,v in pairs(t) do - print(tostring(k) .. ' / ' .. tostring(v)) - end - print('Table Test 2:') - for X,X in pairs(t) do - print(tostring(X) .. ' / ' .. tostring(X)) - end - print('Function Test 1:') - v1,v2 = myFunc() - print(v1) - print(v2) - print('Function Test 2:') - v,v = myFunc() - print(v) - print(v) - "); - } - - -// [Test] -// public void TestModulesLoadingWithoutCrash() -// { -//#if !PCL -// var basePath = AppDomain.CurrentDomain.BaseDirectory; -// var scriptPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "scripts\\test"); -// Script script = new Script(); - -// ((ScriptLoaderBase)script.Options.ScriptLoader).ModulePaths = new[] -// { -// System.IO.Path.Combine(basePath, "scripts\\test\\test.lua"), -// }; -// var obj = script.LoadFile(System.IO.Path.Combine(scriptPath, "test.lua")); -// obj.Function.Call(); -//#endif -// } - - [Test] - public void NumericConversionFailsIfOutOfBounds() - { - Script S = new Script(); - - S.Globals["my_function_takes_byte"] = (Action)(p => { }); - - try - { - S.DoString("my_function_takes_byte(2010191) -- a huge number that is definitely not a byte"); - - Assert.Fail(); // ScriptRuntimeException should have been thrown, if it doesn't Assert.Fail should execute - } - catch (ScriptRuntimeException e) - { - //Assert.Pass(e.DecoratedMessage); - } - } - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/StringLibTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/StringLibTests.cs deleted file mode 100644 index e20c93a1..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/StringLibTests.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class StringLibTests - { - [Test] - public void String_GMatch_1() - { - string script = @" - t = ''; - - for word in string.gmatch('Hello Lua user', '%a+') do - t = t .. word; - end - - return (t); - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("HelloLuauser", res.String); - } - - [Test] - public void String_Find_1() - { - string script = @"return string.find('Hello Lua user', 'Lua');"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, 7, 9); - } - - [Test] - public void String_Find_2() - { - string script = @"return string.find('Hello Lua user', 'banana');"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, null); - } - - [Test] - public void String_Find_3() - { - string script = @"return string.find('Hello Lua user', 'Lua', 1);"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, 7, 9); - } - - [Test] - public void String_Find_4() - { - string script = @"return string.find('Hello Lua user', 'Lua', 8);"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, null); - } - - [Test] - public void String_Find_5() - { - string script = @"return string.find('Hello Lua user', 'e', -5);"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, 13, 13); - } - - [Test] - public void String_Find_6() - { - string script = @"return string.find('Hello Lua user', '%su');"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, 10, 11); - } - - [Test] - public void String_Find_7() - { - string script = @"return string.find('Hello Lua user', '%su', 1);"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, 10, 11); - } - - [Test] - public void String_Find_8() - { - string script = @"return string.find('Hello Lua user', '%su', 1, true);"; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, null); - } - [Test] - public void String_Find_9() - { - string script = @" - s = 'Deadline is 30/05/1999, firm' - date = '%d%d/%d%d/%d%d%d%d'; - return s:sub(s:find(date)); - "; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, "30/05/1999"); - } - - [Test] - public void String_Find_10() - { - string script = @" - s = 'Deadline is 30/05/1999, firm' - date = '%f[%S]%d%d/%d%d/%d%d%d%d'; - return s:sub(s:find(date)); - "; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, "30/05/1999"); - } - - [Test] - public void String_Find_11() - { - string script = @" - s = 'Deadline is 30/05/1999, firm' - date = '%f[%s]%d%d/%d%d/%d%d%d%d'; - return s:find(date); - "; - DynValue res = Script.RunString(script); - Assert.IsTrue(res.IsNil()); - } - - [Test] - public void String_Format_1() - { - string script = @" - d = 5; m = 11; y = 1990 - return string.format('%02d/%02d/%04d', d, m, y) - "; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, "05/11/1990"); - } - - [Test] - public void String_GSub_1() - { - string script = @" - s = string.gsub('hello world', '(%w+)', '%1 %1') - return s, s == 'hello hello world world' - "; - DynValue res = Script.RunString(script); - Assert.AreEqual(res.Tuple[0].String, "hello hello world world"); - Assert.AreEqual(res.Tuple[1].Boolean, true); - } - - [Test] - public void PrintTest1() - { - string script = @" - print('ciao', 1); - "; - string printed = null; - - Script S = new Script(); - DynValue main = S.LoadString(script); - - S.Options.DebugPrint = s => - { - printed = s; - }; - - S.Call(main); - - Assert.AreEqual("ciao\t1", printed); - } - - [Test] - public void PrintTest2() - { - string script = @" - t = {}; - m = {}; - - function m.__tostring() - return 'ciao'; - end - - setmetatable(t, m); - - print(t, 1); - "; - string printed = null; - - Script S = new Script(); - DynValue main = S.LoadString(script); - - S.Options.DebugPrint = s => - { - printed = s; - }; - - S.Call(main); - - Assert.AreEqual("ciao\t1", printed); - } - - [Test] - public void ToStringTest() - { - string script = @" - t = {} - mt = {} - a = nil - function mt.__tostring () a = 'yup' end - setmetatable(t, mt) - return tostring(t), a; - "; - DynValue res = Script.RunString(script); - Utils.DynAssert(res, DataType.Void, "yup"); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void String_GSub_2() - { - string script = @" - string.gsub('hello world', '%w+', '%e') - "; - DynValue res = Script.RunString(script); - } - - [Test] - public void String_GSub_3() - { - Script S = new Script(); - S.Globals["a"] = @" 'C:\temp\test.lua:68: bad argument #1 to 'date' (invalid conversion specifier '%Ja')' - doesn't match '^[^:]+:%d+: bad argument #1 to 'date' %(invalid conversion specifier '%%Ja'%)'"; - - string script = @" - string.gsub(a, '\n', '\n #') - "; - DynValue res = S.DoString(script); - } - - [Test] - public void String_Match_1() - { - string s = @"test.lua:185: field 'day' missing in date table"; - string p = @"^[^:]+:%d+: field 'day' missing in date table"; - - TestMatch(s, p, true); - } - - private void TestMatch(string s, string p, bool expected) - { - Script S = new Script(CoreModules.String); - S.Globals["s"] = s; - S.Globals["p"] = p; - DynValue res = S.DoString("return string.match(s, p)"); - - Assert.AreEqual(expected, !res.IsNil()); - } - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/TableTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/TableTests.cs deleted file mode 100644 index 4cdbb9a5..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/TableTests.cs +++ /dev/null @@ -1,567 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using MoonSharp.Interpreter.Execution; -using NUnit.Framework; -using MoonSharp.Interpreter.CoreLib; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class TableTests - { - [Test] - public void TableAccessAndEmptyCtor() - { - string script = @" - a = { } - - a[1] = 1; - - return a[1]"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1, res.Number); - } - - - - [Test] - public void TableAccessAndCtor() - { - string script = @" - a = { 55, 2, 3, aurevoir=6, [false] = 7 } - - a[1] = 1; - a.ciao = 4; - a['hello'] = 5; - - return a[1], a[2], a[3], a['ciao'], a.hello, a.aurevoir, a[false]"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(7, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(DataType.Number, res.Tuple[2].Type); - Assert.AreEqual(DataType.Number, res.Tuple[3].Type); - Assert.AreEqual(DataType.Number, res.Tuple[4].Type); - Assert.AreEqual(DataType.Number, res.Tuple[5].Type); - Assert.AreEqual(DataType.Number, res.Tuple[6].Type); - Assert.AreEqual(1, res.Tuple[0].Number); - Assert.AreEqual(2, res.Tuple[1].Number); - Assert.AreEqual(3, res.Tuple[2].Number); - Assert.AreEqual(4, res.Tuple[3].Number); - Assert.AreEqual(5, res.Tuple[4].Number); - Assert.AreEqual(6, res.Tuple[5].Number); - Assert.AreEqual(7, res.Tuple[6].Number); - } - - [Test] - public void TableMethod1() - { - string script = @" - x = 0 - - a = - { - value = 1912, - - val = function(self, num) - x = self.value + num - end - } - - a.val(a, 82); - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - [Test] - public void TableMethod2() - { - string script = @" - x = 0 - - a = - { - value = 1912, - - val = function(self, num) - x = self.value + num - end - } - - a:val(82); - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - [Test] - public void TableMethod3() - { - string script = @" - x = 0 - - a = - { - value = 1912, - } - - function a.val(self, num) - x = self.value + num - end - - a:val(82); - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - - [Test] - public void TableMethod4() - { - string script = @" - x = 0 - - local a = - { - value = 1912, - } - - function a:val(num) - x = self.value + num - end - - a:val(82); - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - [Test] - public void TableMethod5() - { - string script = @" - x = 0 - - a = - { - value = 1912, - } - - b = { tb = a }; - c = { tb = b }; - - function c.tb.tb:val(num) - x = self.value + num - end - - a:val(82); - - return x"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1994, res.Number); - } - - - [Test] - public void TableMethod6() - { - string script = @" - do - local a = {x=0} - function a:add (x) self.x, a.y = self.x+x, 20; return self end - return (a:add(10):add(20):add(30).x == 60 and a.y == 20) - end"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Boolean, res.Type); - Assert.AreEqual(true, res.CastToBool()); - } - - [Test] - public void TableNextWithChangeInCollection() - { - string script = @" - x = { } - - function copy(k, v) - x[k] = v; - end - - - t = - { - a = 1, - b = 2, - c = 3, - d = 4, - e = 5 - } - - k,v = next(t, nil); - copy(k, v); - - k,v = next(t, k); - copy(k, v); - v = nil; - - k,v = next(t, k); - copy(k, v); - - k,v = next(t, k); - copy(k, v); - - k,v = next(t, k); - copy(k, v); - - s = x.a .. '|' .. x.b .. '|' .. x.c .. '|' .. x.d .. '|' .. x.e - - return s;"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1|2|3|4|5", res.String); - } - - - [Test] - public void TablePairsWithoutMetatable() - { - string script = @" - V = 0 - K = '' - - t = - { - a = 1, - b = 2, - c = 3, - d = 4, - e = 5 - } - - for k, v in pairs(t) do - K = K .. k; - V = V + v; - end - - return K, V;"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(5, res.Tuple[0].String.Length); - Assert.AreEqual(15, res.Tuple[1].Number); - } - - [Test] - public void TableIPairsWithoutMetatable() - { - string script = @" - x = 0 - y = 0 - - t = { 2, 4, 6, 8, 10, 12 }; - - for i,j in ipairs(t) do - x = x + i - y = y + j - - if (i >= 3) then - break - end - end - - return x, y"; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Number, res.Tuple[1].Type); - Assert.AreEqual(6, res.Tuple[0].Number); - Assert.AreEqual(12, res.Tuple[1].Number); - } - - [Test] - public void TestLoadSyntaxError() - { - string script = @" - function reader () - i = i + 1 - return t[i] - end - - - t = { [[?syntax error?]] } - i = 0 - f, msg = load(reader, 'errorchunk') - - return f, msg; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(DataType.Nil, res.Tuple[0].Type); - Assert.AreEqual(DataType.String, res.Tuple[1].Type); - } - - - [Test] - public void TableSimplifiedAccess1() - { - string script = @" - t = { - ciao = 'hello' - } - - return t; - "; - - Script s = new Script(); - DynValue t = s.DoString(script); - - Assert.AreEqual("hello", t.Table["ciao"]); - } - - [Test] - public void TableSimplifiedAccess2() - { - string script = @" - t = { - ciao = x - } - - return t; - "; - - Script s = new Script(); - s.Globals["x"] = "hello"; - DynValue t = s.DoString(script); - - Assert.AreEqual("hello", t.Table["ciao"]); - } - - [Test] - public void TableSimplifiedAccess3() - { - string script = @" - t = { - } - - return t; - "; - - Script s = new Script(); - DynValue t = s.DoString(script); - - s.Globals["t", "ciao"] = "hello"; - - Assert.AreEqual("hello", t.Table["ciao"]); - } - - [Test] - public void TableSimplifiedAccess4() - { - string script = @" - t = { - } - "; - - Script s = new Script(); - s.DoString(script); - - s.Globals["t", "ciao"] = "hello"; - - Assert.AreEqual("hello", s.Globals["t", "ciao"]); - } - - - [Test] - public void TableSimplifiedAccess5() - { - string script = @" - t = { - ciao = 'hello' - } - "; - - Script s = new Script(); - s.DoString(script); - - Assert.AreEqual("hello", s.Globals["t", "ciao"]); - } - - [Test] - public void TableSimplifiedAccess6() - { - string script = @" - t = { - ciao = - { 'hello' } - } - "; - - Script s = new Script(CoreModules.None); - s.DoString(script); - - Assert.AreEqual("hello", s.Globals["t", "ciao", 1]); - } - - - [Test] - public void TestNilRemovesEntryForPairs() - { - string script = @" - str = '' - - function showTable(t) - for i, j in pairs(t) do - str = str .. i; - end - str = str .. '$' - end - - tb = {} - tb['id'] = 3 - - showTable(tb) - - tb['id'] = nil - - showTable(tb) - - return str - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("id$$", res.String); - } - - [Test] - public void TestUnpack() - { - string script = @" - return unpack({3,4}) - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(2, res.Tuple.Length); - Assert.AreEqual(3, res.Tuple[0].Number); - Assert.AreEqual(4, res.Tuple[1].Number); - } - - [Test] - public void PrimeTable_1() - { - string script = @" - t = ${ - ciao = 'hello' - } - "; - - Script s = new Script(); - s.DoString(script); - - Assert.AreEqual("hello", s.Globals["t", "ciao"]); - Assert.IsTrue(s.Globals.Get("t").Table.OwnerScript == null); - } - - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void PrimeTable_2() - { - string script = @" - t = ${ - ciao = function() end - } - "; - - Script s = new Script(); - s.DoString(script); - - Assert.Fail(); - } - - - [Test] - public void Table_Length_Calculations() - { - Table T = new Table(null); - - Assert.AreEqual(0, T.Length, "A"); - - T.Set(1, DynValue.True); - - Assert.AreEqual(1, T.Length, "B"); - - T.Set(2, DynValue.True); - T.Set(3, DynValue.True); - T.Set(4, DynValue.True); - - Assert.AreEqual(4, T.Length, "C"); - - T.Set(3, DynValue.Nil); - - Assert.AreEqual(2, T.Length, "D"); - - T.Set(3, DynValue.True); - - Assert.AreEqual(4, T.Length, "E"); - - T.Set(3, DynValue.Nil); - - Assert.AreEqual(2, T.Length, "F"); - - T.Append(DynValue.True); - - Assert.AreEqual(4, T.Length, "G"); - - T.Append(DynValue.True); - - Assert.AreEqual(5, T.Length, "H"); - - } - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataFieldsTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataFieldsTests.cs deleted file mode 100644 index d7fd9c8c..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataFieldsTests.cs +++ /dev/null @@ -1,589 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ -#pragma warning disable 169 // unused private field - - [TestFixture] - public class UserDataFieldsTests - { - public class SomeClass - { - public int IntProp; - public const int ConstIntProp = 115; - public readonly int RoIntProp = 123; - public int? NIntProp; - public object ObjProp; - public static string StaticProp; - private string PrivateProp; - } - - public void Test_ConstIntFieldGetter(InteropAccessMode opt) - { - string script = @" - x = myobj.ConstIntProp; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(115, res.Number); - } - - public void Test_ReadOnlyIntFieldGetter(InteropAccessMode opt) - { - string script = @" - x = myobj.RoIntProp; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(123, res.Number); - } - - public void Test_ConstIntFieldSetter(InteropAccessMode opt) - { - try - { - string script = @" - myobj.ConstIntProp = 1; - return myobj.ConstIntProp;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(115, res.Number); - } - catch (ScriptRuntimeException) - { - return; - } - - Assert.Fail(); - } - - public void Test_ReadOnlyIntFieldSetter(InteropAccessMode opt) - { - try - { - string script = @" - myobj.RoIntProp = 1; - return myobj.RoIntProp;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(123, res.Number); - } - catch (ScriptRuntimeException) - { - return; - } - - Assert.Fail(); - } - - - - - public void Test_IntFieldGetter(InteropAccessMode opt) - { - string script = @" - x = myobj.IntProp; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(321, res.Number); - } - - public void Test_NIntFieldGetter(InteropAccessMode opt) - { - string script = @" - x = myobj1.NIntProp; - y = myobj2.NIntProp; - return x,y;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { NIntProp = 321 }; - SomeClass obj2 = new SomeClass() { NIntProp = null }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(321.0, res.Tuple[0].Number); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Nil, res.Tuple[1].Type); - } - - public void Test_ObjFieldGetter(InteropAccessMode opt) - { - string script = @" - x = myobj1.ObjProp; - y = myobj2.ObjProp; - z = myobj2.ObjProp.ObjProp; - return x,y,z;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { ObjProp = "ciao" }; - SomeClass obj2 = new SomeClass() { ObjProp = obj1 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual("ciao", res.Tuple[0].String); - Assert.AreEqual(DataType.String, res.Tuple[2].Type); - Assert.AreEqual("ciao", res.Tuple[2].String); - Assert.AreEqual(DataType.UserData, res.Tuple[1].Type); - Assert.AreEqual(obj1, res.Tuple[1].UserData.Object); - } - - public void Test_IntFieldSetter(InteropAccessMode opt) - { - string script = @" - myobj.IntProp = 19;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - Assert.AreEqual(321, obj.IntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(19, obj.IntProp); - } - - public void Test_NIntFieldSetter(InteropAccessMode opt) - { - string script = @" - myobj1.NIntProp = nil; - myobj2.NIntProp = 19;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { NIntProp = 321 }; - SomeClass obj2 = new SomeClass() { NIntProp = null }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - Assert.AreEqual(321, obj1.NIntProp); - Assert.AreEqual(null, obj2.NIntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(null, obj1.NIntProp); - Assert.AreEqual(19, obj2.NIntProp); - } - - public void Test_ObjFieldSetter(InteropAccessMode opt) - { - string script = @" - myobj1.ObjProp = myobj2; - myobj2.ObjProp = 'hello';"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { ObjProp = "ciao" }; - SomeClass obj2 = new SomeClass() { ObjProp = obj1 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - Assert.AreEqual("ciao", obj1.ObjProp); - Assert.AreEqual(obj1, obj2.ObjProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(obj2, obj1.ObjProp); - Assert.AreEqual("hello", obj2.ObjProp); - } - - public void Test_InvalidFieldSetter(InteropAccessMode opt) - { - string script = @" - myobj.IntProp = '19';"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - Assert.AreEqual(321, obj.IntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(19, obj.IntProp); - } - - public void Test_StaticFieldAccess(InteropAccessMode opt) - { - string script = @" - static.StaticProp = 'asdasd' .. static.StaticProp;"; - - Script S = new Script(); - - SomeClass.StaticProp = "qweqwe"; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - - Assert.AreEqual("qweqwe", SomeClass.StaticProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual("asdasdqweqwe", SomeClass.StaticProp); - } - - [Test] - public void Interop_IntFieldGetter_None() - { - Test_IntFieldGetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_IntFieldGetter_Lazy() - { - Test_IntFieldGetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_IntFieldGetter_Precomputed() - { - Test_IntFieldGetter(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_NIntFieldGetter_None() - { - Test_NIntFieldGetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_NIntFieldGetter_Lazy() - { - Test_NIntFieldGetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_NIntFieldGetter_Precomputed() - { - Test_NIntFieldGetter(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ObjFieldGetter_None() - { - Test_ObjFieldGetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ObjFieldGetter_Lazy() - { - Test_ObjFieldGetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ObjFieldGetter_Precomputed() - { - Test_ObjFieldGetter(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_IntFieldSetter_None() - { - Test_IntFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_IntFieldSetter_Lazy() - { - Test_IntFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_IntFieldSetter_Precomputed() - { - Test_IntFieldSetter(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_NIntFieldSetter_None() - { - Test_NIntFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_NIntFieldSetter_Lazy() - { - Test_NIntFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_NIntFieldSetter_Precomputed() - { - Test_NIntFieldSetter(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ObjFieldSetter_None() - { - Test_ObjFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ObjFieldSetter_Lazy() - { - Test_ObjFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ObjFieldSetter_Precomputed() - { - Test_ObjFieldSetter(InteropAccessMode.Preoptimized); - } - - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_InvalidFieldSetter_None() - { - Test_InvalidFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_InvalidFieldSetter_Lazy() - { - Test_InvalidFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_InvalidFieldSetter_Precomputed() - { - Test_InvalidFieldSetter(InteropAccessMode.Preoptimized); - } - - - [Test] - public void Interop_StaticFieldAccess_None() - { - Test_StaticFieldAccess(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_StaticFieldAccess_Lazy() - { - Test_StaticFieldAccess(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_StaticFieldAccess_Precomputed() - { - Test_StaticFieldAccess(InteropAccessMode.Preoptimized); - } - - - - [Test] - public void Interop_IntFieldSetterWithSimplifiedSyntax() - { - string script = @" - myobj.IntProp = 19;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(); - - S.Globals["myobj"] = obj; - - Assert.AreEqual(321, obj.IntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(obj, S.Globals["myobj"]); - Assert.AreEqual(19, obj.IntProp); - } - - - - - [Test] - public void Interop_ConstIntFieldGetter_None() - { - Test_ConstIntFieldGetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConstIntFieldGetter_Lazy() - { - Test_ConstIntFieldGetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConstIntFieldGetter_Precomputed() - { - Test_ConstIntFieldGetter(InteropAccessMode.Preoptimized); - } - - - - [Test] - public void Interop_ConstIntFieldSetter_None() - { - Test_ConstIntFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConstIntFieldSetter_Lazy() - { - Test_ConstIntFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConstIntFieldSetter_Precomputed() - { - Test_ConstIntFieldSetter(InteropAccessMode.Preoptimized); - } - - - - [Test] - public void Interop_ReadOnlyIntFieldGetter_None() - { - Test_ReadOnlyIntFieldGetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ReadOnlyIntFieldGetter_Lazy() - { - Test_ReadOnlyIntFieldGetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ReadOnlyIntFieldGetter_Precomputed() - { - Test_ReadOnlyIntFieldGetter(InteropAccessMode.Preoptimized); - } - - - - [Test] - public void Interop_ReadOnlyIntFieldSetter_None() - { - Test_ReadOnlyIntFieldSetter(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ReadOnlyIntFieldSetter_Lazy() - { - Test_ReadOnlyIntFieldSetter(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ReadOnlyIntFieldSetter_Precomputed() - { - Test_ReadOnlyIntFieldSetter(InteropAccessMode.Preoptimized); - } - - - - - - - - - - - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataIndexerTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataIndexerTests.cs deleted file mode 100644 index 9ad1003e..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataIndexerTests.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class UserDataIndexerTests - { - public class IndexerTestClass - { - Dictionary mymap = new Dictionary(); - - public int this[int idx] - { - get { return mymap[idx]; } - set { mymap[idx] = value; } - } - - public int this[int idx1, int idx2, int idx3] - { - get { int idx = (idx1 + idx2) * idx3; return mymap[idx]; } - set { int idx = (idx1 + idx2) * idx3; mymap[idx] = value; } - } - } - - private void IndexerTest(string code, int expected) - { - Script S = new Script(); - - IndexerTestClass obj = new IndexerTestClass(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.Create(obj)); - - DynValue v = S.DoString(code); - - Assert.AreEqual(DataType.Number, v.Type); - Assert.AreEqual(expected, v.Number); - } - - [Test] - public void Interop_SingleSetterOnly() - { - string script = @"o[1] = 1; return 13"; - IndexerTest(script, 13); - } - - - [Test] - public void Interop_SingleIndexerGetSet() - { - string script = @"o[5] = 19; return o[5];"; - IndexerTest(script, 19); - } - - [Test] - public void Interop_MultiIndexerGetSet() - { - string script = @"o[1,2,3] = 47; return o[1,2,3];"; - IndexerTest(script, 47); - } - - [Test] - public void Interop_MultiIndexerMetatableGetSet() - { - string script = @" - m = { - __index = o, - __newindex = o - } - - t = { } - - setmetatable(t, m); - - t[10,11,12] = 1234; return t[10,11,12];"; - IndexerTest(script, 1234); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_MultiIndexerMetamethodGetSet() - { - string script = @" - m = { - __index = function() end, - __newindex = function() end - } - - t = { } - - setmetatable(t, m); - - t[10,11,12] = 1234; return t[10,11,12];"; - IndexerTest(script, 1234); - } - - - - - - [Test] - public void Interop_MixedIndexerGetSet() - { - string script = @"o[3,2,3] = 119; return o[15];"; - IndexerTest(script, 119); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_ExpListIndexingCompilesButNotRun1() - { - string script = @" - x = { 99, 98, 97, 96 } - return x[2,3]; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(98, res.Number); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_ExpListIndexingCompilesButNotRun2() - { - string script = @" - x = { 99, 98, 97, 96 } - x[2,3] = 5; - "; - - DynValue res = Script.RunString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(98, res.Number); - } - - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataMethodsTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataMethodsTests.cs deleted file mode 100755 index 09d4ebfc..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataMethodsTests.cs +++ /dev/null @@ -1,1080 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter.Compatibility; -using MoonSharp.Interpreter.Interop; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class UserDataMethodsTests - { - public class SomeClass_NoRegister : IComparable - { - public string ManipulateString(string input, ref string tobeconcat, out string lowercase) - { - tobeconcat = input + tobeconcat; - lowercase = input.ToLower(); - return input.ToUpper(); - } - - public string ConcatNums(int p1, int p2) - { - return string.Format("{0}%{1}", p1, p2); - } - - public int SomeMethodWithLongName(int i) - { - return i * 2; - } - - public static StringBuilder SetComplexRecursive(List intList) - { - StringBuilder sb = new StringBuilder(); - - foreach (int[] arr in intList) - { - sb.Append(string.Join(",", arr.Select(s => s.ToString()).ToArray())); - sb.Append("|"); - } - - return sb; - } - - public static StringBuilder SetComplexTypes(List strlist, IList intlist, Dictionary map, - string[] strarray, int[] intarray) - { - StringBuilder sb = new StringBuilder(); - - sb.Append(string.Join(",", strlist.ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", intlist.Select(i => i.ToString()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", map.Keys.OrderBy(x => x).Select(i => i.ToString()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", map.Values.OrderBy(x => x).Select(i => i.ToString()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", strarray)); - - sb.Append("|"); - - sb.Append(string.Join(",", intarray.Select(i => i.ToString()).ToArray())); - - return sb; - } - - - public static StringBuilder ConcatS(int p1, string p2, IComparable p3, bool p4, List p5, IEnumerable p6, - StringBuilder p7, Dictionary p8, SomeClass_NoRegister p9, int p10 = 1994) - { - p7.Append(p1); - p7.Append(p2); - p7.Append(p3); - p7.Append(p4); - - p7.Append("|"); - foreach (var o in p5) p7.Append(o); - p7.Append("|"); - foreach (var o in p6) p7.Append(o); - p7.Append("|"); - foreach (var o in p8.Keys.OrderBy(x => x.ToString())) p7.Append(o); - p7.Append("|"); - foreach (var o in p8.Values.OrderBy(x => x.ToString())) p7.Append(o); - p7.Append("|"); - - p7.Append(p9); - p7.Append(p10); - - return p7; - } - - public string Format(string s, params object[] args) - { - return string.Format(s, args); - } - - public StringBuilder ConcatI(Script s, int p1, string p2, IComparable p3, bool p4, List p5, IEnumerable p6, - StringBuilder p7, Dictionary p8, SomeClass_NoRegister p9, int p10 = 1912) - { - Assert.IsNotNull(s); - return ConcatS(p1, p2, p3, p4, p5, p6, p7, p8, this, p10); - } - - public override string ToString() - { - return "!SOMECLASS!"; - } - - public List MkList(int from, int to) - { - List l = new List(); - for (int i = from; i <= to; i++) - l.Add(i); - return l; - } - - - public int CompareTo(object obj) - { - throw new NotImplementedException(); - } - } - - - public class SomeClass : IComparable - { - public string ManipulateString(string input, ref string tobeconcat, out string lowercase) - { - tobeconcat = input + tobeconcat; - lowercase = input.ToLower(); - return input.ToUpper(); - } - - public string ConcatNums(int p1, int p2) - { - return string.Format("{0}%{1}", p1, p2); - } - - public int SomeMethodWithLongName(int i) - { - return i * 2; - } - - public static StringBuilder SetComplexRecursive(List intList) - { - StringBuilder sb = new StringBuilder(); - - foreach (int[] arr in intList) - { - sb.Append(string.Join(",", arr.Select(s => s.ToString()).ToArray())); - sb.Append("|"); - } - - return sb; - } - - public static StringBuilder SetComplexTypes(List strlist, IList intlist, Dictionary map, - string[] strarray, int[] intarray) - { - StringBuilder sb = new StringBuilder(); - - sb.Append(string.Join(",", strlist.ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", intlist.Select(i => i.ToString()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", map.Keys.OrderBy(x => x.ToUpperInvariant()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", map.Values.OrderBy(x => x).Select(i => i.ToString()).ToArray())); - - sb.Append("|"); - - sb.Append(string.Join(",", strarray)); - - sb.Append("|"); - - sb.Append(string.Join(",", intarray.Select(i => i.ToString()).ToArray())); - - return sb; - } - - - public static StringBuilder ConcatS(int p1, string p2, IComparable p3, bool p4, List p5, IEnumerable p6, - StringBuilder p7, Dictionary p8, SomeClass p9, int p10 = 1994) - { - p7.Append(p1); - p7.Append(p2); - p7.Append(p3); - p7.Append(p4); - - p7.Append("|"); - foreach (var o in p5) p7.Append(o); - p7.Append("|"); - foreach (var o in p6) p7.Append(o); - p7.Append("|"); - foreach (var o in p8.Keys.OrderBy(x => x.ToString().ToUpperInvariant())) p7.Append(o); - p7.Append("|"); - foreach (var o in p8.Values.OrderBy(x => x.ToString().ToUpperInvariant())) p7.Append(o); - p7.Append("|"); - - p7.Append(p9); - p7.Append(p10); - - return p7; - } - - public string Format(string s, params object[] args) - { - return string.Format(s, args); - } - - public StringBuilder ConcatI(Script s, int p1, string p2, IComparable p3, bool p4, List p5, IEnumerable p6, - StringBuilder p7, Dictionary p8, SomeClass p9, int p10 = 1912) - { - Assert.IsNotNull(s); - return ConcatS(p1, p2, p3, p4, p5, p6, p7, p8, this, p10); - } - - public override string ToString() - { - return "!SOMECLASS!"; - } - - public List MkList(int from, int to) - { - List l = new List(); - for (int i = from; i <= to; i++) - l.Add(i); - return l; - } - - - public int CompareTo(object obj) - { - throw new NotImplementedException(); - } - } - - public interface Interface1 - { - string Test1(); - } - - public interface Interface2 - { - string Test2(); - } - - - public class SomeOtherClass - { - public string Test1() - { - return "Test1"; - } - - public string Test2() - { - return "Test2"; - } - } - - - public class SomeOtherClassCustomDescriptor - { - } - - public class CustomDescriptor : IUserDataDescriptor - { - public string Name - { - get { return "ciao"; } - } - - public Type Type - { - get { return typeof(SomeOtherClassCustomDescriptor); } - } - - public DynValue Index(Script script, object obj, DynValue index, bool dummy) - { - return DynValue.NewNumber(index.Number * 4); - } - - public bool SetIndex(Script script, object obj, DynValue index, DynValue value, bool dummy) - { - throw new NotImplementedException(); - } - - public string AsString(object obj) - { - return null; - } - - public DynValue MetaIndex(Script script, object obj, string metaname) - { - return null; - } - - public bool IsTypeCompatible(Type type, object obj) - { - return Framework.Do.IsInstanceOfType(type, obj); - } - } - - - - - public class SelfDescribingClass : IUserDataType - { - public DynValue Index(Script script, DynValue index, bool isNameIndex) - { - return DynValue.NewNumber(index.Number * 3); - } - - public bool SetIndex(Script script, DynValue index, DynValue value, bool isNameIndex) - { - throw new NotImplementedException(); - } - - public DynValue MetaIndex(Script script, string metaname) - { - throw new NotImplementedException(); - } - } - - public class SomeOtherClassWithDualInterfaces : Interface1, Interface2 - { - public string Test1() - { - return "Test1"; - } - - public string Test2() - { - return "Test2"; - } - } - - public void Test_VarArgs(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - return myobj.format('{0}.{1}@{2}:{3}', 1, 2, 'ciao', true);"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1.2@ciao:True", res.String); - } - - - public void Test_ConcatMethodStaticComplexCustomConv(InteropAccessMode opt) - { - try - { - UserData.UnregisterType(); - - string script = @" - strlist = { 'ciao', 'hello', 'aloha' }; - intlist = { }; - dictry = { ciao = 39, hello = 78, aloha = 128 }; - - x = static.SetComplexTypes(strlist, intlist, dictry, strlist, intlist); - - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - Script.GlobalOptions.CustomConverters.Clear(); - - Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(List), - v => null); - - Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(IList), - v => new List() { 42, 77, 125, 13 }); - - Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Table, typeof(int[]), - v => new int[] { 43, 78, 126, 14 }); - - Script.GlobalOptions.CustomConverters.SetClrToScriptCustomConversion( - (_s, v) => DynValue.NewString(v.ToString().ToUpper())); - - - S.Globals.Set("static", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("CIAO,HELLO,ALOHA|42,77,125,13|ALOHA,CIAO,HELLO|39,78,128|CIAO,HELLO,ALOHA|43,78,126,14", res.String); - } - finally - { - Script.GlobalOptions.CustomConverters.Clear(); - } - } - - - public void Test_ConcatMethodStaticComplex(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - strlist = { 'ciao', 'hello', 'aloha' }; - intlist = { 42, 77, 125, 13 }; - dictry = { ciao = 39, hello = 78, aloha = 128 }; - - x = static.SetComplexTypes(strlist, intlist, dictry, strlist, intlist); - - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("ciao,hello,aloha|42,77,125,13|aloha,ciao,hello|39,78,128|ciao,hello,aloha|42,77,125,13", res.String); - } - - public void Test_ConcatMethodStaticComplexRec(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - array = { { 1, 2, 3 }, { 11, 35, 77 }, { 16, 42, 64 }, {99, 76, 17 } }; - - x = static.SetComplexRecursive(array); - - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1,2,3|11,35,77|16,42,64|99,76,17|", res.String); - } - - - public void Test_RefOutParams(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - x, y, z = myobj:manipulateString('CiAo', 'hello'); - return x, y, z;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(3, res.Tuple.Length); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual(DataType.String, res.Tuple[1].Type); - Assert.AreEqual(DataType.String, res.Tuple[2].Type); - Assert.AreEqual("CIAO", res.Tuple[0].String); - Assert.AreEqual("CiAohello", res.Tuple[1].String); - Assert.AreEqual("ciao", res.Tuple[2].String); - } - - - - - public void Test_ConcatMethodStatic(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = static.ConcatS(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("eheh1ciao!SOMECLASS!True|asdqwezxc|asdqwezxc|123xy|asdqweXYzxc|!SOMECLASS!1994", res.String); - } - - public void Test_ConcatMethod(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = myobj.ConcatI(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("eheh1ciao!SOMECLASS!True|asdqwezxc|asdqwezxc|123xy|asdqweXYzxc|!SOMECLASS!1912", res.String); - } - - public void Test_ConcatMethodSemicolon(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = myobj:ConcatI(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("eheh1ciao!SOMECLASS!True|asdqwezxc|asdqwezxc|123xy|asdqweXYzxc|!SOMECLASS!1912", res.String); - } - - public void Test_ConstructorAndConcatMethodSemicolon(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - myobj = mytype.__new(); - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = myobj:ConcatI(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals["mytype"] = typeof(SomeClass); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("eheh1ciao!SOMECLASS!True|asdqwezxc|asdqwezxc|123xy|asdqweXYzxc|!SOMECLASS!1912", res.String); - } - - - - public void Test_ConcatMethodStaticSimplifiedSyntax(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = static.ConcatS(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals["static"] = typeof(SomeClass); - S.Globals["myobj"] = obj; - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("eheh1ciao!SOMECLASS!True|asdqwezxc|asdqwezxc|123xy|asdqweXYzxc|!SOMECLASS!1994", res.String); - } - - public void Test_DelegateMethod(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - x = concat(1, 2); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - S.Globals["concat"] = CallbackFunction.FromDelegate(S, (Func)obj.ConcatNums, opt); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("1%2", res.String); - } - - public void Test_ListMethod(InteropAccessMode opt) - { - UserData.UnregisterType(); - - string script = @" - x = mklist(1, 4); - sum = 0; - - for _, v in ipairs(x) do - sum = sum + v; - end - - return sum;"; - - Script S = new Script(); - - SomeClass_NoRegister obj = new SomeClass_NoRegister(); - - S.Globals["mklist"] = CallbackFunction.FromDelegate(S, (Func>)obj.MkList, opt); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - - [Test] - public void Interop_ConcatMethod_None() - { - Test_ConcatMethod(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethod_Lazy() - { - Test_ConcatMethod(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethod_Precomputed() - { - Test_ConcatMethod(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ConcatMethodSemicolon_None() - { - Test_ConcatMethodSemicolon(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodSemicolon_Lazy() - { - Test_ConcatMethodSemicolon(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodSemicolon_Precomputed() - { - Test_ConcatMethodSemicolon(InteropAccessMode.Preoptimized); - } - - - [Test] - public void Interop_ConstructorAndConcatMethodSemicolon_None() - { - Test_ConstructorAndConcatMethodSemicolon(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConstructorAndConcatMethodSemicolon_Lazy() - { - Test_ConstructorAndConcatMethodSemicolon(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConstructorAndConcatMethodSemicolon_Precomputed() - { - Test_ConstructorAndConcatMethodSemicolon(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplxCustomConv_None() - { - Test_ConcatMethodStaticComplexCustomConv(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodStaticCplxCustomConv_Lazy() - { - Test_ConcatMethodStaticComplexCustomConv(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplxCustomConv_Precomputed() - { - Test_ConcatMethodStaticComplexCustomConv(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplx_None() - { - Test_ConcatMethodStaticComplex(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodStaticCplx_Lazy() - { - Test_ConcatMethodStaticComplex(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplx_Precomputed() - { - Test_ConcatMethodStaticComplex(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplxRec_None() - { - Test_ConcatMethodStaticComplexRec(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodStaticCplxRec_Lazy() - { - Test_ConcatMethodStaticComplexRec(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodStaticCplxRec_Precomputed() - { - Test_ConcatMethodStaticComplexRec(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ConcatMethodStatic_None() - { - Test_ConcatMethodStatic(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodStatic_Lazy() - { - Test_ConcatMethodStatic(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodStatic_Precomputed() - { - Test_ConcatMethodStatic(InteropAccessMode.Preoptimized); - } - - - [Test] - public void Interop_ConcatMethodStaticSimplifiedSyntax_None() - { - Test_ConcatMethodStaticSimplifiedSyntax(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ConcatMethodStaticSimplifiedSyntax_Lazy() - { - Test_ConcatMethodStaticSimplifiedSyntax(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ConcatMethodStaticSimplifiedSyntax_Precomputed() - { - Test_ConcatMethodStaticSimplifiedSyntax(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_VarArgs_None() - { - Test_VarArgs(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_VarArgs_Lazy() - { - Test_VarArgs(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_VarArgs_Precomputed() - { - Test_VarArgs(InteropAccessMode.Preoptimized); - } - - - [Test] - public void Interop_DelegateMethod_None() - { - Test_DelegateMethod(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_DelegateMethod_Lazy() - { - Test_DelegateMethod(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_DelegateMethod_Precomputed() - { - Test_DelegateMethod(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_OutRefParams_None() - { - Test_RefOutParams(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_OutRefParams_Lazy() - { - Test_RefOutParams(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_OutRefParams_Precomputed() - { - Test_RefOutParams(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_ListMethod_None() - { - Test_ListMethod(InteropAccessMode.Reflection); - } - - [Test] - public void Interop_ListMethod_Lazy() - { - Test_ListMethod(InteropAccessMode.LazyOptimized); - } - - [Test] - public void Interop_ListMethod_Precomputed() - { - Test_ListMethod(InteropAccessMode.Preoptimized); - } - - [Test] - public void Interop_TestAutoregisterPolicy() - { - var oldPolicy = UserData.RegistrationPolicy; - - try - { - string script = @"return myobj:Test1()"; - - UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic; - - Script S = new Script(); - - SomeOtherClass obj = new SomeOtherClass(); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Test1", res.String); - } - finally - { - UserData.RegistrationPolicy = oldPolicy; - } - } - - [Test] - public void Interop_DualInterfaces() - { - string script = @"return myobj:Test1() .. myobj:Test2()"; - - Script S = new Script(); - - UserData.UnregisterType(); - UserData.UnregisterType(); - UserData.RegisterType(); - UserData.RegisterType(); - - SomeOtherClassWithDualInterfaces obj = new SomeOtherClassWithDualInterfaces(); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Test1Test2", res.String); - } - - [Test] - public void Interop_TestNamesCamelized() - { - UserData.UnregisterType(); - - string script = @" - a = myobj:SomeMethodWithLongName(1); - b = myobj:someMethodWithLongName(2); - c = myobj:some_method_with_long_name(3); - d = myobj:Some_method_withLong_name(4); - - return a + b + c + d; - "; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(20, res.Number); - - } - - [Test] - public void Interop_TestSelfDescribingType() - { - UserData.UnregisterType(); - - string script = @" - a = myobj[1]; - b = myobj[2]; - c = myobj[3]; - - return a + b + c; - "; - - Script S = new Script(); - - SelfDescribingClass obj = new SelfDescribingClass(); - - UserData.UnregisterType(); - UserData.RegisterType(); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(18, res.Number); - } - - [Test] - public void Interop_TestCustomDescribedType() - { - UserData.UnregisterType(); - - string script = @" - a = myobj[1]; - b = myobj[2]; - c = myobj[3]; - - return a + b + c; - "; - - Script S = new Script(); - - SomeOtherClassCustomDescriptor obj = new SomeOtherClassCustomDescriptor(); - - UserData.RegisterType(new CustomDescriptor()); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(24, res.Number); - } - - - [Test] - public void Interop_StaticInstanceAccessRaisesError() - { - try - { - UserData.UnregisterType(); - - string script = @" - t = { 'asd', 'qwe', 'zxc', ['x'] = 'X', ['y'] = 'Y' }; - x = mystatic.ConcatI(1, 'ciao', myobj, true, t, t, 'eheh', t, myobj); - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(); - - S.Globals.Set("mystatic", UserData.CreateStatic()); - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.Fail(); - } - catch (Exception ex) - { - Assert.IsTrue(ex.Message.Contains("attempt to access instance member")); - } - } - - } -} - diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataNestedTypesTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataNestedTypesTests.cs deleted file mode 100644 index c5755854..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataNestedTypesTests.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class UserDataNestedTypesTests - { - public class SomeType - { - public enum SomeNestedEnum - { - Asdasdasd, - } - - public static SomeNestedEnum Get() - { - return SomeNestedEnum.Asdasdasd; - } - - public class SomeNestedType - { - public static string Get() - { - return "Ciao from SomeNestedType"; - } - } - - [MoonSharpUserData] - private class SomeNestedTypePrivate - { - public static string Get() - { - return "Ciao from SomeNestedTypePrivate"; - } - } - - private class SomeNestedTypePrivate2 - { - public static string Get() - { - return "Ciao from SomeNestedTypePrivate2"; - } - } - - } - - public struct VSomeType - { - public struct SomeNestedType - { - public static string Get() - { - return "Ciao from SomeNestedType"; - } - } - - [MoonSharpUserData] - private struct SomeNestedTypePrivate - { - public static string Get() - { - return "Ciao from SomeNestedTypePrivate"; - } - } - - private struct SomeNestedTypePrivate2 - { - public static string Get() - { - return "Ciao from SomeNestedTypePrivate2"; - } - } - - } - - [Test] - public void Interop_NestedTypes_Public_Enum() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o:Get()"); - - Assert.AreEqual(DataType.UserData, res.Type); - } - - - [Test] - public void Interop_NestedTypes_Public_Ref() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedType:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedType", res.String); - } - - - [Test] - public void Interop_NestedTypes_Private_Ref() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedTypePrivate:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedTypePrivate", res.String); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_NestedTypes_Private_Ref_2() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedTypePrivate2:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedTypePrivate2", res.String); - } - - [Test] - public void Interop_NestedTypes_Public_Val() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedType:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedType", res.String); - } - - - [Test] - public void Interop_NestedTypes_Private_Val() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedTypePrivate:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedTypePrivate", res.String); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_NestedTypes_Private_Val_2() - { - Script S = new Script(); - - UserData.RegisterType(); - - S.Globals.Set("o", UserData.CreateStatic()); - - DynValue res = S.DoString("return o.SomeNestedTypePrivate2:Get()"); - - Assert.AreEqual(DataType.String, res.Type); - Assert.AreEqual("Ciao from SomeNestedTypePrivate2", res.String); - } - - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs deleted file mode 100755 index d55b5b9e..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataOverloadsTests.cs +++ /dev/null @@ -1,326 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter.Compatibility; -using MoonSharp.Interpreter.Interop; -using MoonSharp.Interpreter.Loaders; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - public static class OverloadsExtMethods - { - public static string Method1(this UserDataOverloadsTests.OverloadsTestClass obj, string x, bool b) - { - return "X" + obj.Method1(); - } - - public static string Method3(this UserDataOverloadsTests.OverloadsTestClass obj) - { - obj.Method1(); - return "X3"; - } - } - public static class OverloadsExtMethods2 - { - public static string MethodXXX(this UserDataOverloadsTests.OverloadsTestClass obj, string x, bool b) - { - return "X!"; - } - } - - - [TestFixture] - public class UserDataOverloadsTests - { - public class OverloadsTestClass - { - public string MethodV(string fmt, params object[] args) - { - return "varargs:" + string.Format(fmt, args); - } - - public string MethodV(string fmt, int a, bool b) - { - return "exact:" + string.Format(fmt, a, b); - } - - public string Method1() - { - return "1"; - } - - public static string Method1(bool b) - { - return "s"; - } - - public string Method1(int a) - { - return "2"; - } - - public string Method1(double d) - { - return "3"; - } - - public string Method1(double d, string x = null) - { - return "4"; - } - - public string Method1(double d, string x, int y = 5) - { - return "5"; - } - - public string Method2(string x, string y) - { - return "v"; - } - - public string Method2(string x, ref string y) - { - return "r"; - } - - public string Method2(string x, ref string y, int z) - { - return "R"; - } - } - - private void RunTestOverload(string code, string expected, bool tupleExpected = false) - { - Script S = new Script(); - - OverloadsTestClass obj = new OverloadsTestClass(); - - UserData.RegisterType(); - - S.Globals.Set("s", UserData.CreateStatic()); - S.Globals.Set("o", UserData.Create(obj)); - - DynValue v = S.DoString("return " + code); - - if (tupleExpected) - { - Assert.AreEqual(DataType.Tuple, v.Type); - v = v.Tuple[0]; - } - - Assert.AreEqual(DataType.String, v.Type); - Assert.AreEqual(expected, v.String); - } - - - [Test] - public void Interop_OutParamInOverloadResolution() - { - UserData.RegisterType>(); - UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); - - try - { - var lua = new Script(); - lua.Globals["DictionaryIntInt"] = typeof(Dictionary); - - var script = @"local dict = DictionaryIntInt.__new(); local res, v = dict.TryGetValue(0)"; - lua.DoString(script); - lua.DoString(script); - } - finally - { - UserData.UnregisterType>(); - } - } - - [Test] - public void Interop_Overloads_Varargs1() - { - RunTestOverload("o:methodV('{0}-{1}', 15, true)", "exact:15-True"); - } - - [Test] - public void Interop_Overloads_Varargs2() - { - RunTestOverload("o:methodV('{0}-{1}-{2}', 15, true, false)", "varargs:15-True-False"); - } - - - [Test] - public void Interop_Overloads_ByRef() - { - RunTestOverload("o:method2('x', 'y')", "v"); - } - - [Test] - public void Interop_Overloads_ByRef2() - { - RunTestOverload("o:method2('x', 'y', 5)", "R", true); - } - - [Test] - public void Interop_Overloads_NoParams() - { - RunTestOverload("o:method1()", "1"); - } - - [Test] - public void Interop_Overloads_NumDowncast() - { - RunTestOverload("o:method1(5)", "3"); - } - - [Test] - public void Interop_Overloads_NilSelectsNonOptional() - { - RunTestOverload("o:method1(5, nil)", "4"); - } - - [Test] - public void Interop_Overloads_FullDecl() - { - RunTestOverload("o:method1(5, nil, 0)", "5"); - } - - [Test] - public void Interop_Overloads_Static1() - { - RunTestOverload("s:method1(true)", "s"); - } - - [Test] - public void Interop_Overloads_ExtMethods() - { - UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); - - RunTestOverload("o:method1('xx', true)", "X1"); - RunTestOverload("o:method3()", "X3"); - } - - [Test] - public void Interop_Overloads_Twice_ExtMethods1() - { - UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); - - RunTestOverload("o:method1('xx', true)", "X1"); - - UserData.RegisterExtensionType(typeof(OverloadsExtMethods2)); - - RunTestOverload("o:methodXXX('xx', true)", "X!"); - } - - [Test] - public void Interop_Overloads_Twice_ExtMethods2() - { - UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); - UserData.RegisterExtensionType(typeof(OverloadsExtMethods2)); - - RunTestOverload("o:method1('xx', true)", "X1"); - RunTestOverload("o:methodXXX('xx', true)", "X!"); - } - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_Overloads_ExtMethods2() - { - UserData.RegisterExtensionType(typeof(OverloadsExtMethods)); - RunTestOverload("s:method3()", "X3"); - } - - - - [Test] - [ExpectedException(typeof(ScriptRuntimeException))] - public void Interop_Overloads_Static2() - { - // pollute cache - RunTestOverload("o:method1(5)", "3"); - // exec non static on static - RunTestOverload("s:method1(5)", "s"); - } - - [Test] - public void Interop_Overloads_Cache1() - { - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5)", "3"); - } - - [Test] - public void Interop_Overloads_Cache2() - { - RunTestOverload("o:method1()", "1"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5, nil)", "4"); - RunTestOverload("o:method1(5, nil, 0)", "5"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("s:method1(true)", "s"); - RunTestOverload("o:method1(5, nil, 0)", "5"); - RunTestOverload("o:method1(5, 'x')", "4"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5, 'x', 0)", "5"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5, nil, 0)", "5"); - RunTestOverload("s:method1(true)", "s"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5, 5)", "4"); - RunTestOverload("o:method1(5, nil, 0)", "5"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("s:method1(true)", "s"); - RunTestOverload("o:method1(5)", "3"); - RunTestOverload("o:method1(5, 5, 0)", "5"); - RunTestOverload("s:method1(true)", "s"); - } - - private int Method1() - { - return 1; - } - - private int Method1(int a) - { - return 5 + a; - } - -#if !DOTNET_CORE - [Test] - public void OverloadTest_WithoutObjects() - { - Script s = new Script(); - - // Create an instance of the overload resolver - var ov = new OverloadedMethodMemberDescriptor("Method1", this.GetType()); - - // Iterate over the two methods through reflection - foreach(var method in Framework.Do.GetMethods(this.GetType()) - .Where(mi => mi.Name == "Method1" && mi.IsPrivate && !mi.IsStatic)) - { - ov.AddOverload(new MethodMemberDescriptor(method)); - } - - // Creates the callback over the 'this' object - DynValue callback = DynValue.NewCallback(ov.GetCallbackFunction(s, this)); - s.Globals.Set("func", callback); - - // Execute and check the results. - DynValue result = s.DoString("return func(), func(17)"); - - Assert.AreEqual(DataType.Tuple, result.Type); - Assert.AreEqual(DataType.Number, result.Tuple[0].Type); - Assert.AreEqual(DataType.Number, result.Tuple[1].Type); - Assert.AreEqual(1, result.Tuple[0].Number); - Assert.AreEqual(22, result.Tuple[1].Number); - } -#endif - - - - } -} diff --git a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataPropertiesTests.cs b/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataPropertiesTests.cs deleted file mode 100644 index 7a84aa72..00000000 --- a/src/MoonSharp.Interpreter.Tests/EndToEnd/UserDataPropertiesTests.cs +++ /dev/null @@ -1,865 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using MoonSharp.Interpreter.Interop; -using NUnit.Framework; - -namespace MoonSharp.Interpreter.Tests.EndToEnd -{ - [TestFixture] - public class UserDataPropertiesTests - { - public class SomeClass - { - public int IntProp { get; set; } - public int? NIntProp { get; set; } - public object ObjProp { get; set; } - public static string StaticProp { get; set; } - - public int RoIntProp { get { return 5; } } - public int RoIntProp2 { get; private set; } - - public int WoIntProp { set { IntProp = value; } } - public int WoIntProp2 { internal get; set; } - - [MoonSharpVisible(false)] - internal int AccessOverrProp - { - get; - [MoonSharpVisible(true)] - set; - } - - - public SomeClass() - { - RoIntProp2 = 1234; - WoIntProp2 = 1235; - } - - public static IEnumerable Numbers - { - get - { - for (int i = 1; i <= 4; i++) - yield return i; - } - } - } - - public void Test_IntPropertyGetter(InteropAccessMode opt) - { - string script = @" - x = myobj.IntProp; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(321, res.Number); - } - - public void Test_NIntPropertyGetter(InteropAccessMode opt) - { - string script = @" - x = myobj1.NIntProp; - y = myobj2.NIntProp; - return x,y;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { NIntProp = 321 }; - SomeClass obj2 = new SomeClass() { NIntProp = null }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(321.0, res.Tuple[0].Number); - Assert.AreEqual(DataType.Number, res.Tuple[0].Type); - Assert.AreEqual(DataType.Nil, res.Tuple[1].Type); - } - - public void Test_ObjPropertyGetter(InteropAccessMode opt) - { - string script = @" - x = myobj1.ObjProp; - y = myobj2.ObjProp; - z = myobj2.ObjProp.ObjProp; - return x,y,z;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { ObjProp = "ciao" }; - SomeClass obj2 = new SomeClass() { ObjProp = obj1 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Tuple, res.Type); - Assert.AreEqual(DataType.String, res.Tuple[0].Type); - Assert.AreEqual("ciao", res.Tuple[0].String); - Assert.AreEqual(DataType.String, res.Tuple[2].Type); - Assert.AreEqual("ciao", res.Tuple[2].String); - Assert.AreEqual(DataType.UserData, res.Tuple[1].Type); - Assert.AreEqual(obj1, res.Tuple[1].UserData.Object); - } - - public void Test_IntPropertySetter(InteropAccessMode opt) - { - string script = @" - myobj.IntProp = 19;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - Assert.AreEqual(321, obj.IntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(19, obj.IntProp); - } - - public void Test_NIntPropertySetter(InteropAccessMode opt) - { - string script = @" - myobj1.NIntProp = nil; - myobj2.NIntProp = 19;"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { NIntProp = 321 }; - SomeClass obj2 = new SomeClass() { NIntProp = null }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - Assert.AreEqual(321, obj1.NIntProp); - Assert.AreEqual(null, obj2.NIntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(null, obj1.NIntProp); - Assert.AreEqual(19, obj2.NIntProp); - } - - public void Test_ObjPropertySetter(InteropAccessMode opt) - { - string script = @" - myobj1.ObjProp = myobj2; - myobj2.ObjProp = 'hello';"; - - Script S = new Script(); - - SomeClass obj1 = new SomeClass() { ObjProp = "ciao" }; - SomeClass obj2 = new SomeClass() { ObjProp = obj1 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj1", UserData.Create(obj1)); - S.Globals.Set("myobj2", UserData.Create(obj2)); - - Assert.AreEqual("ciao", obj1.ObjProp); - Assert.AreEqual(obj1, obj2.ObjProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(obj2, obj1.ObjProp); - Assert.AreEqual("hello", obj2.ObjProp); - } - - public void Test_InvalidPropertySetter(InteropAccessMode opt) - { - string script = @" - myobj.IntProp = '19';"; - - Script S = new Script(); - - SomeClass obj = new SomeClass() { IntProp = 321 }; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - Assert.AreEqual(321, obj.IntProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual(19, obj.IntProp); - } - - public void Test_StaticPropertyAccess(InteropAccessMode opt) - { - string script = @" - static.StaticProp = 'asdasd' .. static.StaticProp;"; - - Script S = new Script(); - - SomeClass.StaticProp = "qweqwe"; - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("static", UserData.CreateStatic()); - - Assert.AreEqual("qweqwe", SomeClass.StaticProp); - - DynValue res = S.DoString(script); - - Assert.AreEqual("asdasdqweqwe", SomeClass.StaticProp); - } - - public void Test_IteratorPropertyGetter(InteropAccessMode opt) - { - string script = @" - x = 0; - for i in myobj.Numbers do - x = x + i; - end - - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(10, res.Number); - } - - public void Test_RoIntPropertyGetter(InteropAccessMode opt) - { - string script = @" - x = myobj.RoIntProp; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(5, res.Number); - } - - public void Test_RoIntProperty2Getter(InteropAccessMode opt) - { - string script = @" - x = myobj.RoIntProp2; - return x;"; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - - Assert.AreEqual(DataType.Number, res.Type); - Assert.AreEqual(1234, res.Number); - } - - public void Test_RoIntPropertySetter(InteropAccessMode opt) - { - try - { - string script = @" - myobj.RoIntProp = 19; - return myobj.RoIntProp; - "; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType(); - UserData.RegisterType(opt); - - S.Globals.Set("myobj", UserData.Create(obj)); - - DynValue res = S.DoString(script); - } - catch (ScriptRuntimeException) - { - return; - } - - Assert.Fail(); - } - - public void Test_RoIntProperty2Setter(InteropAccessMode opt) - { - try - { - string script = @" - myobj.RoIntProp2 = 19; - return myobj.RoIntProp2; - "; - - Script S = new Script(); - - SomeClass obj = new SomeClass(); - - UserData.UnregisterType
- To view this page ensure that Adobe Flash Player version - 11.1.0 or greater is installed. -
- Either scripts and active content are not permitted to run or Adobe Flash Player version - 11.1.0 or greater is not installed. -