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