language_xml.lua 893 B

123456789101112131415161718192021
  1. local syntax = require "core.syntax"
  2. syntax.add {
  3. files = { "%.xml$", "%.html?$" },
  4. patterns = {
  5. { pattern = { "<!%-%-", "%-%->" }, type = "comment" },
  6. { pattern = { '%f[^>][^<]', '%f[<]' }, type = "normal" },
  7. { pattern = { '"', '"', '\\' }, type = "string" },
  8. { pattern = { "'", "'", '\\' }, type = "string" },
  9. { pattern = "0x[%da-fA-F]+", type = "number" },
  10. { pattern = "-?%d+[%d%.]*f?", type = "number" },
  11. { pattern = "-?%.?%d+f?", type = "number" },
  12. { pattern = "%f[^<]![%a_][%w_]*", type = "keyword2" },
  13. { pattern = "%f[^<][%a_][%w_]*", type = "function" },
  14. { pattern = "%f[^<]/[%a_][%w_]*", type = "function" },
  15. { pattern = "[%a_][%w_]*", type = "keyword" },
  16. { pattern = "[/<>=]", type = "operator" },
  17. },
  18. symbols = {},
  19. }