Index: 残局文料/lib_lua/ipml_mj_ysaf.lua ================================================================== --- 残局文料/lib_lua/ipml_mj_ysaf.lua +++ 残局文料/lib_lua/ipml_mj_ysaf.lua @@ -48,10 +48,21 @@ end d_5.写件(o1, k1, o2) end function d_5.删制表符(o1) return o1:gsub("\t", "") + end +function d_5.删空格与制表符(o1) + o1 = d_5.删空格(o1) + return d_5.删制表符(o1) + end +function d_5.文转排(text) + local lines = {} + for line in text:gmatch("[^\n]+") do + table.insert(lines, line) + end + return lines end function d_5.删前缀(o1, o2) if o1:find(o2, 1, true) then return o1:sub(#o2 + 1) end @@ -59,15 +70,15 @@ function d_5.删后缀(o1, o2) if o1:find(o2, -1, true) then return o1:sub(1, #o1 - #o2) end end -function d_5.删空行_快态(o1) +function d_5.删空行_不虑首末态(o1) return o1:gsub("\n+", "\n") end -function d_5.删空行_慢态(o1) - o1 = o1:gsub("\n+", "\n") +function d_5.删空行(o1) + o1 = d_5.删空行_不虑首末态(o1) o1 = d_5.删前缀(o1, "\n") return d_5.删后缀(o1, "\n") end function d_5.删空格(o1) return o1:gsub(" ", "") @@ -104,15 +115,11 @@ function d_5.加后缀(o1, o2) return o1 .. o2 end function d_5.filterLinesWithCharacter(text, character) local result = {} - -- 将文本按行拆分为一个行的数组 - local lines = {} - for line in text:gmatch("[^\n]+") do - table.insert(lines, line) - end + local lines = d_5.文转排(text) -- 遍历每一行,检查是否包含目标字符 for i, line in ipairs(lines) do if line:find(character, 1, true) then table.insert(result, line) end @@ -120,7 +127,15 @@ return result end function d_5.办并说(o1) print(o1) os.execute(o1) + end +function d_5.筛单行等式_左右值态(o1) + local k1_11 + k1_11 = {} + for o2 in 11:gmatch("[^\n= \t]+") do + table.insert(k1_11, o2) + end + return o2 end return d_5 Index: 残局文料/产常量件.lua ================================================================== --- 残局文料/产常量件.lua +++ 残局文料/产常量件.lua @@ -6,15 +6,19 @@ local d_2 = {} function d_2.产常量件(o1) local k1 k1 = 常用库.读件(o1 .. "/script/constant.lua", "rb") k1 = 删注库_月程语态_不虑字串态.事启(k1) - k1 = 常用库.删制表符(k1) - k1 = 常用库.删空行(k1) - k1 = 常用库.删空格(k1) - --~ print(1) - print(k1:gsub("\n", "猪")) + --~ k1 = 常用库.删空格与制表符(k1) + for o1 in k1:gmatch("[^\n= \t]+") do + print(o1) + end + --~ k1 = 常用库.删空行(k1) + --~ k1 = "local k1_11 = {}\n" .. k1 .. "" + --~ k1 = 常用库.筛排(k1, print) + --~ print(k1) + --~ print(k1:gsub("\n", "猪")) end function d_2.筛凡常量() end function d_2.筛字段量()