b0e744e1e3 2024-02-12 1: local 字集库 = require("u8_to_a")
b0e744e1e3 2024-02-12 2: local 文库 = require(字集库.u8_to_a("算机_程语_月_基类_文"))
b0e744e1e3 2024-02-12 3: local string = string
5b9fb5e09f 2024-02-13 4: local s = {}
5b9fb5e09f 2024-02-13 5: -- 单行注与多行注
5b9fb5e09f 2024-02-13 6: --~ 文
a4c0b3bd26 2024-02-13 7: function s.删注(u1)
a4c0b3bd26 2024-02-13 8: u1 = s.删多行注(u1)
a4c0b3bd26 2024-02-13 9: return s.删单行注(u1)
5b9fb5e09f 2024-02-13 10: end
5b9fb5e09f 2024-02-13 11: do
89f423ff38 2024-02-13 12: local h1
5b9fb5e09f 2024-02-13 13: --~ 模
89f423ff38 2024-02-13 14: h1 = 文库.连("%-%-", "%[", "(=*)", "%[", ".-", "%]", "%1", "%]")
5b9fb5e09f 2024-02-13 15: --~ 文
a4c0b3bd26 2024-02-13 16: function s.删多行注(u1)
89f423ff38 2024-02-13 17: return string.gsub(u1, h1, "")
5b9fb5e09f 2024-02-13 18: end
5b9fb5e09f 2024-02-13 19: end
5b9fb5e09f 2024-02-13 20: do
89f423ff38 2024-02-13 21: local h1
5b9fb5e09f 2024-02-13 22: --~ 模
89f423ff38 2024-02-13 23: h1 = 文库.连("%-%-", "[^\n]*")
5b9fb5e09f 2024-02-13 24: --~ 文
a4c0b3bd26 2024-02-13 25: function s.删单行注(u1)
89f423ff38 2024-02-13 26: return string.gsub(u1, h1, "")
5b9fb5e09f 2024-02-13 27: end
5b9fb5e09f 2024-02-13 28: end
5b9fb5e09f 2024-02-13 29: return s