From 6c2b61d3dcaa25cfcff43ac16d6fb9c069acb09a Mon Sep 17 00:00:00 2001 From: omltcat <6239696+omltcat@users.noreply.github.com> Date: Sat, 19 Oct 2024 23:28:01 -0400 Subject: [PATCH] Release 1.2.3 --- CHANGELOG.md | 5 +++++ package.json | 2 +- src/extension.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68fb6b7..7ba29d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,3 +117,8 @@ All notable changes to the "dcs-lua-runner" extension will be documented in this ### Fixed - Handling of decimal number keys + +## [1.2.3] - 2024-10-19 + +### Fixed +- Handling of Lua table keys with more than one dot diff --git a/package.json b/package.json index 87dad85..1d461dd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Quickly run lua code in DCS World (local or remote server). A reimplementation of the DCS Fiddle lua console in VS Code.", "license": "MIT", "publisher": "omltcat", - "version": "1.2.2", + "version": "1.2.3", "icon": "docs/img/icon.png", "repository": { "type": "git", diff --git a/src/extension.ts b/src/extension.ts index 532449c..179b0b1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -65,8 +65,8 @@ async function runLua(lua: string, outputChannel: vscode.OutputChannel, filename // Replace JSON syntax with Lua syntax luaString = luaString.replace(/null/g, 'nil'); // Replace null with nil luaString = luaString.replace(/"((?:[^"\\]|\\.)+)":/g, '["$1"] ='); // Replace "key": with ["key"] = - luaString = luaString.replace(/\["_([0-9.]+)"\]\s*=/g, '[$1] ='); // Replace ["_n"] or ["_n.m"] = with [n] or [n.m] = - luaString = luaString.replace(/\["([0-9.]+)"\]\s*=/g, '[$1] ='); // Replace ["n"] or ["n.m"] = with [n] or [n.m] = + luaString = luaString.replace(/\["_([0-9]+(?:\.[0-9]+)?)"\]\s*=/g, '[$1] ='); // Replace ["_n"] or ["_n.m"] = with [n] or [n.m] = + luaString = luaString.replace(/\["([0-9]+(?:\.[0-9]+)?)"\]\s*=/g, '[$1] ='); // Replace ["n"] or ["n.m"] = with [n] or [n.m] = luaString = luaString.replace(/\[\]/g, '{}'); // Replace [] with {} luaString = luaString.replace(/\[\n/g, '{\n'); // Replace [ followed by a line break with { followed by a line break luaString = luaString.replace(/]\n/g, '}\n'); // Replace ] followed by a line break with } followed by a line break