modula2.tmLanguage.json 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. {
  2. "name": "Modula-2",
  3. "scopeName": "source.modula2",
  4. "patterns": [
  5. {"include": "#comments"}, {"include": "#strings"},
  6. {"include": "#numbers"}, {"include": "#keywords"},
  7. {"include": "#types"}, {"include": "#operators"}
  8. ],
  9. "repository": {
  10. "comments": {"patterns": [
  11. {"name": "comment.block.modula2", "begin": "\\(\\*", "end": "\\*\\)"}
  12. ]},
  13. "strings": {"patterns": [
  14. {"name": "string.quoted.double.modula2", "begin": "\"", "end": "\"",
  15. "patterns": [{"name": "constant.character.escape.modula2", "match": "\\\\."}]}
  16. ]},
  17. "numbers": {"patterns": [
  18. {"name": "constant.numeric.modula2", "match": "\\b(?:[0-9]+|[0-9A-Fa-f]+H)\\b"}
  19. ]},
  20. "keywords": {"patterns": [
  21. {"name": "keyword.control.modula2",
  22. "match": "\\b(?:AND|ARRAY|BEGIN|BY|CASE|CONST|DEFINITION|DIV|DO|ELSE|ELSIF|END|EXIT|EXPORT|FOR|FROM|IF|IMPLEMENTATION|IMPORT|IN|LOOP|MOD|MODULE|NOT|OF|OR|POINTER|PROCEDURE|QUALIFIED|RECORD|REPEAT|RETURN|SET|THEN|TO|TYPE|UNTIL|VAR|WHILE|WITH)\\b"}
  23. ]},
  24. "types": {"patterns": [
  25. {"name": "storage.type.modula2",
  26. "match": "\\b(?:INTEGER|CARDINAL|REAL|LONGREAL|CHAR|BOOLEAN|BITSET|ADDRESS)\\b"}
  27. ]},
  28. "operators": {"patterns": [
  29. {"name": "keyword.operator.modula2", "match": ":=|<=|>=|<>|=|<|>|\\+|-|\\*|/|\\.\\."}
  30. ]}
  31. }
  32. }