numbat.sublime-syntax 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. %YAML 1.2
  2. ---
  3. # See http://www.sublimetext.com/docs/3/syntax.html
  4. name: Numbat
  5. file_extensions:
  6. - nbt
  7. scope: source.nbt
  8. contexts:
  9. main:
  10. - match: \b(per|to|let|fn|where|and|dimension|unit|use|struct|long|short|both|none|if|then|else|true|false|print|assert|assert_eq|type)\b
  11. scope: keyword.control.nbt
  12. - match: '#(.*)'
  13. scope: comment.line.nbt
  14. - match: \b([0-9][0-9_]*(\.[0-9][0-9_]*)?(e[+\-]?[0-9]+)?|0b[01]+|0o[0-7]+|0x[0-9a-fA-F]+|NaN|inf)\b
  15. scope: constant.numeric.nbt
  16. - match: \b([A-Z][a-zA-Z]*)\b
  17. scope: storage.type.nbt
  18. - match: \b([a-z][a-zA-Z_0-9]*)\b
  19. scope: variable.other.nbt
  20. - match: '(@aliases|@metric_prefixes|@binary_prefixes|@name|@url)'
  21. scope: meta.annotation.attribute.nbt
  22. - match: '[+\-/*=\^:<>·×÷²³]'
  23. scope: keyword.operator.nbt
  24. - match: '[\(\)]'
  25. scope: punctuation.definition.parenthesis.nbt
  26. - match: ','
  27. scope: punctuation.separator.comma.nbt
  28. - match: '"'
  29. scope: punctuation.definition.string.begin.nbt
  30. push:
  31. - meta_scope: string.quoted.double.nbt
  32. - match: '"'
  33. scope: punctuation.definition.string.end.nbt
  34. pop: true