From 8d6b35dade2b1fe7766506292ee96df4fc47ffc7 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 16 Oct 2017 14:55:51 +0200 Subject: [PATCH] Lot's of bug fixes and features --- trunk/EditForm.cs | 11 +- trunk/Helpers/LSL2CSharp.cs | 25 --- trunk/Helpers/LSLIConverter.cs | 259 ++++++++++++++++++++++++++----- trunk/LSLEditorForm.Designer.cs | 47 +++--- trunk/LSLEditorForm.cs | 56 ++++++- trunk/Properties/AssemblyInfo.cs | 4 +- trunk/Resource/ConfLSL.xml | 4 + trunk/RuntimeConsole.cs | 32 ++-- 8 files changed, 332 insertions(+), 106 deletions(-) diff --git a/trunk/EditForm.cs b/trunk/EditForm.cs index 452e73a..4a01e13 100644 --- a/trunk/EditForm.cs +++ b/trunk/EditForm.cs @@ -419,8 +419,17 @@ namespace LSLEditor // return false; if (this.IsScript) { + string lsl = SourceCode; + + // If it is LSLI, it needs to import scripts first, before it recognizes imported functions + if (LSLIConverter.IsLSLI(this.FullPathName)) + { + LSLIConverter converter = new LSLIConverter(); + lsl = converter.ExpandToLSL(this); + } + LSL2CSharp translator = new LSL2CSharp(ConfLSL); - string strCSharp = translator.Parse(SourceCode); + string strCSharp = translator.Parse(lsl); if (System.Diagnostics.Debugger.IsAttached) { for (int intI = this.tabControl1.TabPages.Count - 1; intI > 0; intI--) { diff --git a/trunk/Helpers/LSL2CSharp.cs b/trunk/Helpers/LSL2CSharp.cs index ac6b40f..e4a8350 100644 --- a/trunk/Helpers/LSL2CSharp.cs +++ b/trunk/Helpers/LSL2CSharp.cs @@ -109,29 +109,6 @@ namespace LSLEditor return regex.Replace(strC, new MatchEvaluator(CorrectGlobalEvaluator)); } - /// - /// WORDT NIET MEER GEBRUIKT - /// Imports scripts that are imported using //@include() syntax. - /// - /// - /// - private string ImportScripts(string strC) - { - StringBuilder sb = new StringBuilder(strC); - for (int i = strC.IndexOf("\n//@include"); i > -1; i = strC.IndexOf("\n//@include" + 1)) - { - string line = Regex.Match(strC.Substring(i + 1), "^//@include\\(\".*?\"\\)").ToString(); - - if (line.Length > 0) { - // Found an include statement - string path = Regex.Match(line, "\".*?\"").ToString(); - sb.Insert(i, "\n\tpublic void bla() { }\n"); - } - } - - return sb.ToString(); - } - private string RemoveComments(string strC) { if (Properties.Settings.Default.CommentCStyle) @@ -634,8 +611,6 @@ namespace LSLEditor strC = PreCorrectReservedWords(strC); // Experimental - //strC = ImportScripts(strC); - strC = MakeGlobalAndLocal(strC); strC = CorrectJump(strC); diff --git a/trunk/Helpers/LSLIConverter.cs b/trunk/Helpers/LSLIConverter.cs index 0304ca2..ca0564e 100644 --- a/trunk/Helpers/LSLIConverter.cs +++ b/trunk/Helpers/LSLIConverter.cs @@ -50,27 +50,150 @@ namespace LSLEditor.Helpers private EditForm editForm; private const string BEGIN = "//@BEGIN"; private const string END = "//@END"; - private static List validExtensions = new List(3) { "lsl", "lsli", "LSL", "LSLI" }; + private static List validExtensions = new List() { "lsl", "lsli", ".lsl", ".lsli" }; public const string EXPANDED_SUBEXT = ".expanded"; public const string LSL_EXT = ".lsl"; public const string LSLI_EXT = ".lsli"; + // NEW INCLUDE REGEX MATCHES ONLY FIRST OCCURENCE OF LINE ( OLD: ([\n]|^)+//@include\\(\".*?\"\\)(\\s\\w)? ) + // LAST NEW: ([\n]|^)+//@include\\(\".*?\"\\)(\\s)? + private const string INCLUDE_REGEX = "(\n|^)//@include\\(\".*?\"\\)"; // EVEN MORE SIMPLIFIED + private const string BEGIN_REGEX = "(\n|^)//@BEGIN"; // OLD: (\n|^)+//@BEGIN(\\s)*(\r|$) + private const string END_REGEX = "(\n|^)//@END"; //OLD: ([\n]|^)+//@END(\\s)*(\r|$) + + private List implementedIncludes = new List(); + public LSLIConverter() { } + /// + /// Checks if a filename is LSLI + /// + /// + /// + public static bool IsLSLI(string fileName) + { + return GetExtension(fileName) == LSLI_EXT; + } + /// /// Creates a new path and name from the original path and name based on the editForm. /// E.g. turns path/to/file.lsli into path/to/file.expanded.lsl /// - /// New path and scriptname + /// public string CreateExpandedPathAndScriptName() { - string nameExpanded = editForm.Text.Remove(editForm.ScriptName.Length - 4, 4).TrimEnd(' ') + EXPANDED_SUBEXT + LSL_EXT; + return RemoveExtension(editForm.FullPathName) + EXPANDED_SUBEXT + LSL_EXT; + } + + /// + /// Creates an expanded scriptname out of the current scriptname. + /// + /// + public string CreateExpandedScriptName(string filename = null) + { + string nameExpanded = ""; + if (filename != null) + { + nameExpanded = RemoveExtension(filename) + EXPANDED_SUBEXT + LSL_EXT; + } else + { + nameExpanded = RemoveExtension(editForm.Text) + EXPANDED_SUBEXT + LSL_EXT; + } + nameExpanded = nameExpanded.IndexOf('*') > -1 ? nameExpanded.Remove(nameExpanded.IndexOf('*'), 1) : nameExpanded; - return editForm.FullPathName.Remove(editForm.FullPathName.Length - 4, 4) + EXPANDED_SUBEXT + LSL_EXT; + return nameExpanded; + } + + /// + /// Creates a new path and name from the original path and name based on the editForm. + /// E.g. turns path/to/file.expanded.lsl into path/to/file.lsli + /// + /// + public string CreateCollapsedPathAndScriptName() + { + return RemoveExtension(editForm.FullPathName) + LSLI_EXT; + } + + /// + /// Creates a LSLI scriptname out of the current scriptname. + /// + /// + public string CreateCollapsedScriptName() + { + string nameExpanded = RemoveExtension(editForm.Text) + LSLI_EXT; + nameExpanded = nameExpanded.IndexOf('*') > -1 ? nameExpanded.Remove(nameExpanded.IndexOf('*'), 1) : nameExpanded; + return nameExpanded; + } + + /// + /// Gets the extension from a string, includes '.' + /// Only returns the last extension + /// Returns empty string if the extension cannot be found + /// + /// + /// + private static string GetExtension(string filename) + { + int lastIndexOfDirectorySeperator = -1; + + // If '.' after last index of \\ or / + if (filename.Contains('/') || filename.Contains('\\')) + { + lastIndexOfDirectorySeperator = filename.LastIndexOf('/') > filename.LastIndexOf('\\') ? filename.LastIndexOf('/') : filename.LastIndexOf('\\'); + } + if(lastIndexOfDirectorySeperator != -1 && filename.Contains('.') && lastIndexOfDirectorySeperator < filename.LastIndexOf('.')) + { + return filename.Substring(filename.LastIndexOf('.')).TrimEnd(' '); + } + + return ""; + } + + /// + /// Removes the extension and possible expanded subextension from a filename + /// + /// + /// + private static string RemoveExtension(string filename) + { + filename = filename.Contains(EXPANDED_SUBEXT) ? filename.Replace(EXPANDED_SUBEXT, "") : filename; + return filename.Remove(filename.LastIndexOf(GetExtension(filename))); + } + + /// + /// Searches for a file with one of the validExtensions based on a name or path. + /// + /// + /// File path + private string SearchFile(string file) + { + // TODO: Check of settings IncludeFromFolder aanstaat + + if (File.Exists(file)) + { + return file; + } + + if (GetExtension(file) == "") + { + List extensions = validExtensions.Where(e => e[0] == '.').ToList(); + string pFile = ""; + + foreach (string extension in extensions) + { + pFile = file + extension; + + if (File.Exists(pFile)) { + return pFile; + } + } + } + + return ""; } /// @@ -81,14 +204,14 @@ namespace LSLEditor.Helpers /// private string GetRelativePath(string filespec, string folder) { - filespec = Path.GetFullPath(filespec); + filespec = Path.GetFullPath(filespec).ToLower(); if(validExtensions.Contains(filespec.Substring(filespec.LastIndexOf(".") + 1))) { int lastIndexOfSeperator = filespec.LastIndexOf('\\') > filespec.LastIndexOf('/') ? filespec.LastIndexOf('\\') : filespec.LastIndexOf('/'); filespec = filespec.Remove(lastIndexOfSeperator); } Uri pathUri = new Uri(filespec); - // Folders must end in a slash + if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString())) { folder += Path.DirectorySeparatorChar; @@ -113,7 +236,9 @@ namespace LSLEditor.Helpers /// Context with the new line private StringBuilder WriteAfterLine(StringBuilder context, string newLine, string lineBefore) { - int includeIndex = context.ToString().LastIndexOf(lineBefore) + lineBefore.Length; + string ctx = context.ToString(); + int lastIndexOfLineBefore = ctx.LastIndexOf(lineBefore); + int includeIndex = lastIndexOfLineBefore + lineBefore.Length; string hasSeperator = lineBefore.Substring(lineBefore.Length - 1, 1); if (hasSeperator != "\n") @@ -128,70 +253,71 @@ namespace LSLEditor.Helpers } context.Insert(includeIndex, newLine); + string test = context.ToString(); return context; } /// /// Imports scripts from //@include statements /// - /// Sourcecode to work with + /// Sourcecode /// Path of the source code of the script /// Sourcecode with imported scripts private string ImportScripts(string strC, string pathOfScript) { + if(GetExtension(pathOfScript).ToLower() != LSLI_EXT) + { + // If it's not LSLI extension it can't import a script + return strC; + } StringBuilder sb = new StringBuilder(strC); - string includeMatch = "([\n]|^)+//@include\\(\".*?\"\\)(\\s\\w)?"; // OLD (\n|^)+//@include\\(\".*?\"\\)(\\s?)+(\n|$) MATCHES ONLY 1 INCLUDE - MatchCollection mIncludes = Regex.Matches(strC, includeMatch); // Find includes + MatchCollection mIncludes = Regex.Matches(strC, INCLUDE_REGEX); // Find includes + foreach (Match m in mIncludes) { - string line = m.Value; + string contentAfterMatchValue = strC.Substring(m.Index + m.Value.Length); + int indexOfNewLine = contentAfterMatchValue.IndexOf('\n') + m.Index + m.Value.Length + 1; // Index of the first occurence of \n after this match + string line = strC.Substring(m.Index, indexOfNewLine - m.Index); // Get full line string pathOfInclude = Regex.Match(line, "\".*?\"").Value.Trim('"'); - int lastIndexOfLine = line.LastIndexOf("\n") > -1 && line.LastIndexOf("\n") > line.LastIndexOf(")") - ? line.LastIndexOf("\n") + 1 : line.Length; - - // Trim end of string if - if (line.Substring(line.Length - 1, 1) != "\n" && line.Substring(line.Length - 1, 1) != ")") - { - line = line.Remove(line.Length - 1); - } + string ext = GetExtension(pathOfInclude).ToLower(); - string ext = pathOfInclude.Substring(pathOfInclude.LastIndexOf(".") + 1); - - if (validExtensions.Contains(ext)) + if ((validExtensions.Contains(ext) || ext == "") && !this.CreateExpandedScriptName(pathOfScript).Contains(pathOfInclude) + && !pathOfScript.Contains(pathOfInclude)) { // If path is relative - if(!Path.IsPathRooted(pathOfInclude)) + if (!Path.IsPathRooted(pathOfInclude)) { pathOfInclude = GetRelativePath(pathOfScript, Environment.CurrentDirectory) + pathOfInclude; } - sb = this.WriteAfterLine(sb, BEGIN, line); - - string script = ""; - if (File.Exists(pathOfInclude)) + pathOfInclude = SearchFile(pathOfInclude); + if (pathOfInclude != "" && !this.implementedIncludes.Contains(Path.GetFullPath(pathOfInclude))) { + sb = this.WriteAfterLine(sb, BEGIN, line); + // Insert included script + string script = "// Empty script\n"; using (StreamReader sr = new StreamReader(pathOfInclude)) { + this.implementedIncludes.Add(Path.GetFullPath(pathOfInclude)); string scriptRaw = sr.ReadToEnd(); // If there are includes in the included script - if (Regex.IsMatch(strC, includeMatch)) + if (Regex.IsMatch(scriptRaw, INCLUDE_REGEX)) { - // TODO: Kijk voor alle matches, niet alleen 1 match AT: VOLGENS MIJ GEBEURD DIT AL? - //Match mInclude = Regex.Match(strC, includeMatch); // Find includes - //string IncludePath = Regex.Match(mInclude.ToString(), "\".*?\"").Value.Trim('"'); - // Then import these scripts too script = "\n" + ImportScripts(scriptRaw, pathOfInclude) + "\n"; + } else if(scriptRaw != "" && scriptRaw != " ") + { + script = scriptRaw + "\n"; } } - } - this.WriteAfterLine(sb, script, BEGIN + "\n"); + this.WriteAfterLine(sb, script, BEGIN + "\n"); - this.WriteAfterLine(sb, END, script); + this.WriteAfterLine(sb, END, script); + } } } @@ -199,7 +325,68 @@ namespace LSLEditor.Helpers } /// - /// Main function of the class. Call this to expand LSLI to LSL + /// Removes included scripts + /// + /// Sourcecode + /// Sourcecode without imported scripts + private string RemoveScripts(string strC) // TODO: DIT VALT MISS NOG TE OPTIMALISEREN MET STRINGBUILDER IPV STRING + { + //StringBuilder sb = new StringBuilder(strC); + + string result = strC; + int indexOfFirstBeginStatement = -1; + uint depth = 0; + int readIndex = 0; + + using(StringReader sr = new StringReader(strC)) + { + int amountOfLines = strC.Split('\n').Length; + for (int i = 1; i < amountOfLines; i++) + { + string line = sr.ReadLine(); + + if (Regex.IsMatch(line, BEGIN_REGEX)) + { + if(depth == 0) + { + indexOfFirstBeginStatement = readIndex; + } + depth++; + } + + readIndex += line.Length + 1; + + if (Regex.IsMatch(line, END_REGEX)) + { + depth--; + + if (depth == 0) + { + result = result.Remove(indexOfFirstBeginStatement, (readIndex - indexOfFirstBeginStatement)); + readIndex -= readIndex - indexOfFirstBeginStatement; + indexOfFirstBeginStatement = -1; + } + } + } + } + + return result; + } + + /// + /// Call this to collapse LSL to LSLI + /// + /// + /// LSLI + public string CollapseToLSLI(EditForm editform) + { + this.editForm = editform; + string sourceCode = RemoveScripts(editForm.SourceCode); + return sourceCode; + } + + /// + /// Call this to expand LSLI to LSL /// /// /// LSL diff --git a/trunk/LSLEditorForm.Designer.cs b/trunk/LSLEditorForm.Designer.cs index d6762d4..a6b48cd 100644 --- a/trunk/LSLEditorForm.Designer.cs +++ b/trunk/LSLEditorForm.Designer.cs @@ -103,6 +103,9 @@ namespace LSLEditor this.formatSelectedTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.commentInToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.uncommentingSelectedTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); + this.CollapseToLSLIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.expandToLSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewlStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.solutionExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.outlineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -144,9 +147,6 @@ namespace LSLEditor this.openSolutionFilesDialog = new System.Windows.Forms.OpenFileDialog(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.dockPanel = new LSLEditor.Docking.DockPanel(); - this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); - this.CollapseToLSLIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.expandToLSLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout(); @@ -652,6 +652,27 @@ namespace LSLEditor this.uncommentingSelectedTextToolStripMenuItem.Text = "Uncommenting selected text"; this.uncommentingSelectedTextToolStripMenuItem.Click += new System.EventHandler(this.uncommentingSelectedTextToolStripMenuItem_Click); // + // toolStripSeparator10 + // + this.toolStripSeparator10.Name = "toolStripSeparator10"; + this.toolStripSeparator10.Size = new System.Drawing.Size(222, 6); + // + // CollapseToLSLIToolStripMenuItem + // + this.CollapseToLSLIToolStripMenuItem.Name = "CollapseToLSLIToolStripMenuItem"; + this.CollapseToLSLIToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F10; + this.CollapseToLSLIToolStripMenuItem.Size = new System.Drawing.Size(225, 22); + this.CollapseToLSLIToolStripMenuItem.Text = "Collapse to LSLI"; + this.CollapseToLSLIToolStripMenuItem.Click += new System.EventHandler(this.CollapseToLSLIToolStripMenuItem_Click); + // + // expandToLSLToolStripMenuItem + // + this.expandToLSLToolStripMenuItem.Name = "expandToLSLToolStripMenuItem"; + this.expandToLSLToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F11; + this.expandToLSLToolStripMenuItem.Size = new System.Drawing.Size(225, 22); + this.expandToLSLToolStripMenuItem.Text = "Expand to LSL"; + this.expandToLSLToolStripMenuItem.Click += new System.EventHandler(this.expandToLSLToolStripMenuItem_Click); + // // viewlStripMenuItem // this.viewlStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -756,7 +777,7 @@ namespace LSLEditor // optionsToolStripMenuItem // this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(125, 22); this.optionsToolStripMenuItem.Text = "Options..."; this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click); // @@ -972,24 +993,6 @@ namespace LSLEditor this.dockPanel.Skin = dockPanelSkin1; this.dockPanel.TabIndex = 10; // - // toolStripSeparator10 - // - this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(222, 6); - // - // CollapseToLSLIToolStripMenuItem - // - this.CollapseToLSLIToolStripMenuItem.Name = "CollapseToLSLIToolStripMenuItem"; - this.CollapseToLSLIToolStripMenuItem.Size = new System.Drawing.Size(225, 22); - this.CollapseToLSLIToolStripMenuItem.Text = "Collapse to LSLI"; - // - // expandToLSLToolStripMenuItem - // - this.expandToLSLToolStripMenuItem.Name = "expandToLSLToolStripMenuItem"; - this.expandToLSLToolStripMenuItem.Size = new System.Drawing.Size(225, 22); - this.expandToLSLToolStripMenuItem.Text = "Expand to LSL"; - this.expandToLSLToolStripMenuItem.Click += new System.EventHandler(this.expandToLSLToolStripMenuItem_Click); - // // LSLEditorForm // this.AllowDrop = true; diff --git a/trunk/LSLEditorForm.cs b/trunk/LSLEditorForm.cs index 1afeef0..bf227e7 100644 --- a/trunk/LSLEditorForm.cs +++ b/trunk/LSLEditorForm.cs @@ -279,7 +279,7 @@ namespace LSLEditor private void Start(string[] args) { string fileFilterNotes = "Notecard files (*.txt)|*.txt|All files (*.*)|*.*"; - string fileFilterScripts = "Secondlife script files (*.lsl)|*.lsl|All files (*.*)|*.*"; + string fileFilterScripts = "Secondlife script files (*.lsl;*.lsli)|*.lsl;*.lsli|All files (*.*)|*.*"; string fileFilterSolutions = "LSLEditor Solution File (*.sol)|*.sol|All Files (*.*)|*.*"; this.ConfLSL = GetXmlFromResource(Properties.Settings.Default.ConfLSL); @@ -1802,9 +1802,8 @@ namespace LSLEditor private void expandToLSLToolStripMenuItem_Click(object sender, EventArgs e) { - // TODO: DE EXPAND FUNCTIE MAKEN. HIERVOOR MOET DE RUNTIMECONSOLE WORDEN GEIMPORTEERD EditForm editForm = this.ActiveMdiForm as EditForm; - if (editForm != null && editForm.FullPathName.IndexOf(Helpers.LSLIConverter.EXPANDED_SUBEXT) < 0) // TODO: && editForm.FullPathName.IndexOf(".lsli") > -1) + if (editForm != null && editForm.FullPathName.IndexOf(Helpers.LSLIConverter.LSLI_EXT) > -1) { Helpers.LSLIConverter converter = new Helpers.LSLIConverter(); string lsl = converter.ExpandToLSL(editForm); @@ -1814,9 +1813,58 @@ namespace LSLEditor { sw.Write(lsl); } + + EditForm expandedForm = null; + for (int i = 0; i < Application.OpenForms.Count; i++) + { + Form form = Application.OpenForms[i]; + if (form.Text.TrimEnd(' ') == converter.CreateExpandedScriptName()) + { + expandedForm = (EditForm)form; + } + } + if (expandedForm != null) + { + expandedForm.Close(); + } + editForm.Close(); + OpenFile(file); + } + } + + private void CollapseToLSLIToolStripMenuItem_Click(object sender, EventArgs e) + { + EditForm editForm = this.ActiveMdiForm as EditForm; + + // NOTE: This checks only if there's an LSL file, not if there's a extended subextension + if (editForm != null && editForm.FullPathName.IndexOf(Helpers.LSLIConverter.LSL_EXT) > -1) + { + Helpers.LSLIConverter converter = new Helpers.LSLIConverter(); + string lsli = converter.CollapseToLSLI(editForm); + string file = converter.CreateCollapsedPathAndScriptName(); + + using (StreamWriter sw = new StreamWriter(file)) + { + sw.Write(lsli); + } + + EditForm collapsedForm = null; + for (int i = 0; i < Application.OpenForms.Count; i++) + { + Form form = Application.OpenForms[i]; + if (form.Text.TrimEnd(' ') == converter.CreateCollapsedScriptName()) + { + collapsedForm = (EditForm)form; + } + } + + if (collapsedForm != null) + { + collapsedForm.Close(); + } + editForm.Close(); OpenFile(file); - //ActivateMdiForm(); } } } diff --git a/trunk/Properties/AssemblyInfo.cs b/trunk/Properties/AssemblyInfo.cs index 595ff3e..ac83f41 100644 --- a/trunk/Properties/AssemblyInfo.cs +++ b/trunk/Properties/AssemblyInfo.cs @@ -70,7 +70,7 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: // -[assembly: AssemblyVersion("2.55.0.236")] +[assembly: AssemblyVersion("2.55.0.378")] // // In order to sign your assembly you must specify a key to use. Refer to the @@ -100,4 +100,4 @@ using System.Runtime.InteropServices; [assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyName("")] [assembly: ComVisibleAttribute(false)] -[assembly: AssemblyFileVersionAttribute("2.55.0.236")] +[assembly: AssemblyFileVersionAttribute("2.55.0.378")] diff --git a/trunk/Resource/ConfLSL.xml b/trunk/Resource/ConfLSL.xml index 40ad9a1..cfaf548 100644 --- a/trunk/Resource/ConfLSL.xml +++ b/trunk/Resource/ConfLSL.xml @@ -8,6 +8,10 @@ "[^"\\]* (?>\\.[^"\\]*)*" + + + + diff --git a/trunk/RuntimeConsole.cs b/trunk/RuntimeConsole.cs index bbf16b9..a778594 100644 --- a/trunk/RuntimeConsole.cs +++ b/trunk/RuntimeConsole.cs @@ -115,8 +115,7 @@ namespace LSLEditor { LSLIConverter lsliConverter = new LSLIConverter(); lsl = lsliConverter.ExpandToLSL(editForm); - string nameExpanded = editForm.Text.Remove(editForm.ScriptName.Length - 4, 4).TrimEnd(' ') - + LSLIConverter.EXPANDED_SUBEXT + LSLIConverter.LSL_EXT; // TODO: Dit is nog niet perfect + string nameExpanded = lsliConverter.CreateExpandedScriptName(); string path = lsliConverter.CreateExpandedPathAndScriptName(); using (StreamWriter sw = new StreamWriter(path)) @@ -124,21 +123,22 @@ namespace LSLEditor sw.Write(lsl); } - EditForm expandedForm = null; - for (int i = 0; i < Application.OpenForms.Count; i++) - { - Form form = Application.OpenForms[i]; - if(form.Text.TrimEnd(' ') == nameExpanded) - { - expandedForm = (EditForm)form; - } - } + // NOTE: DE EXPANDED LSL WORDT NU IN DE ACHTERGROND GERUNT EN NIET MEER LATEN ZIEN OP 2 TABS + //EditForm expandedForm = null; + //for (int i = 0; i < Application.OpenForms.Count; i++) + //{ + // Form form = Application.OpenForms[i]; + // if(form.Text.TrimEnd(' ') == nameExpanded) + // { + // expandedForm = (EditForm)form; + // } + //} - // Open the expanded file if not already open - if(expandedForm == null) - { - mainForm.OpenFile(path, Guid.NewGuid(), true); // TODO: MOET AUTOMATISCH GAAN RUNNEN - } + //// Open the expanded file if not already open + //if(expandedForm == null) + //{ + // mainForm.OpenFile(path, Guid.NewGuid(), true); // TODO: MOET AUTOMATISCH GAAN RUNNEN + //} }