mirror of
https://github.com/omltcat/dcs-lua-runner.git
synced 2025-11-10 15:49:49 +00:00
Release 1.1.3
This commit is contained in:
@@ -52,10 +52,11 @@ async function runLua(lua: string, outputChannel: vscode.OutputChannel, filename
|
||||
}
|
||||
|
||||
let luaString = jsonString;
|
||||
// Replace JSON syntax with Lua syntax
|
||||
// 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]+)":/g, '[$1] ='); // Replace "_n": with [n] =
|
||||
luaString = luaString.replace(/null/g, 'nil'); // Replace null with nil
|
||||
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
|
||||
luaString = luaString.replace(/],/g, '},'); // Replace ], with },
|
||||
|
||||
Reference in New Issue
Block a user