@@ -9,46 +9,45 @@ local fullNameGems = {
99}
1010
1111local 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
4949end
5050
51-
5251local function mapAST (ast )
5352 return " SkillType." .. (skillTypeMap [ast ._rowIndex ] or (" Unknown" .. ast ._rowIndex ))
5453end
0 commit comments