Skip to content

Commit a36a93e

Browse files
committed
Fix spaces
1 parent b373fee commit a36a93e

2 files changed

Lines changed: 56 additions & 57 deletions

File tree

src/Export/Scripts/bases.lua

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@ local s_format = string.format
77

88
-- Add cleanAndSplit function
99
local function cleanAndSplit(str)
10-
-- Normalize newlines
11-
str = str:gsub("\r\n", "\n")
10+
-- Normalize newlines
11+
str = str:gsub("\r\n", "\n")
1212

13-
-- Replace <default> with a newline and ^8
14-
str = str:gsub("<default>", "\n^8")
13+
-- Replace <default> with a newline and ^8
14+
str = str:gsub("<default>", "\n^8")
1515

16-
local lines = {}
17-
for line in str:gmatch("[^\n]+") do
18-
-- trim
19-
line = line:match("^%s*(.-)%s*$")
16+
local lines = {}
17+
for line in str:gmatch("[^\n]+") do
18+
-- trim
19+
line = line:match("^%s*(.-)%s*$")
2020

21-
if line ~= "" then
22-
-- Remove braces but keep contents
23-
line = line:gsub("%{(.-)%}", "%1")
21+
if line ~= "" then
22+
-- Remove braces but keep contents
23+
line = line:gsub("%{(.-)%}", "%1")
2424

25-
-- Remove any <<...>> sequences (non-greedy)
26-
line = line:gsub("<<(.-)>>", "")
25+
-- Remove any <<...>> sequences (non-greedy)
26+
line = line:gsub("<<(.-)>>", "")
2727

28-
-- trim again in case removal left surrounding spaces
29-
line = line:match("^%s*(.-)%s*$")
28+
-- trim again in case removal left surrounding spaces
29+
line = line:match("^%s*(.-)%s*$")
3030

31-
-- Escape quotes
32-
line = line:gsub('"', '\\"')
31+
-- Escape quotes
32+
line = line:gsub('"', '\\"')
3333

34-
-- Insert a blank line before any ^8 line
35-
if line:match("^%^8") and (#lines == 0 or lines[#lines] ~= "") then
36-
table.insert(lines, "")
37-
end
34+
-- Insert a blank line before any ^8 line
35+
if line:match("^%^8") and (#lines == 0 or lines[#lines] ~= "") then
36+
table.insert(lines, "")
37+
end
3838

39-
-- Only add non-empty lines
40-
if line ~= "" then
41-
table.insert(lines, line)
42-
end
43-
end
44-
end
39+
-- Only add non-empty lines
40+
if line ~= "" then
41+
table.insert(lines, line)
42+
end
43+
end
44+
end
4545

46-
return lines
46+
return lines
4747
end
4848

4949
local directiveTable = { }

src/Export/Scripts/skills.lua

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,45 @@ local fullNameGems = {
99
}
1010

1111
local function cleanAndSplit(str)
12-
-- Normalize newlines
13-
str = str:gsub("\r\n", "\n")
12+
-- Normalize newlines
13+
str = str:gsub("\r\n", "\n")
1414

15-
-- Replace <default> with a newline and ^8
16-
str = str:gsub("<default>", "\n^8")
15+
-- Replace <default> with a newline and ^8
16+
str = str:gsub("<default>", "\n^8")
1717

18-
local lines = {}
19-
for line in str:gmatch("[^\n]+") do
20-
-- trim
21-
line = line:match("^%s*(.-)%s*$")
18+
local lines = {}
19+
for line in str:gmatch("[^\n]+") do
20+
-- trim
21+
line = line:match("^%s*(.-)%s*$")
2222

23-
if line ~= "" then
24-
-- Remove braces but keep contents
25-
line = line:gsub("%{(.-)%}", "%1")
23+
if line ~= "" then
24+
-- Remove braces but keep contents
25+
line = line:gsub("%{(.-)%}", "%1")
2626

27-
-- Remove any <<...>> sequences (non-greedy)
28-
line = line:gsub("<<(.-)>>", "")
27+
-- Remove any <<...>> sequences (non-greedy)
28+
line = line:gsub("<<(.-)>>", "")
2929

30-
-- trim again in case removal left surrounding spaces
31-
line = line:match("^%s*(.-)%s*$")
30+
-- trim again in case removal left surrounding spaces
31+
line = line:match("^%s*(.-)%s*$")
3232

33-
-- Escape quotes
34-
line = line:gsub('"', '\\"')
33+
-- Escape quotes
34+
line = line:gsub('"', '\\"')
3535

36-
-- Insert a blank line before any ^8 line
37-
if line:match("^%^8") and (#lines == 0 or lines[#lines] ~= "") then
38-
table.insert(lines, "")
39-
end
36+
-- Insert a blank line before any ^8 line
37+
if line:match("^%^8") and (#lines == 0 or lines[#lines] ~= "") then
38+
table.insert(lines, "")
39+
end
4040

41-
-- Only add non-empty lines
42-
if line ~= "" then
43-
table.insert(lines, line)
44-
end
45-
end
46-
end
41+
-- Only add non-empty lines
42+
if line ~= "" then
43+
table.insert(lines, line)
44+
end
45+
end
46+
end
4747

48-
return lines
48+
return lines
4949
end
5050

51-
5251
local function mapAST(ast)
5352
return "SkillType."..(skillTypeMap[ast._rowIndex] or ("Unknown"..ast._rowIndex))
5453
end

0 commit comments

Comments
 (0)