oberon.tmLanguage.json 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. "name": "Oberon",
  3. "scopeName": "source.oberon",
  4. "patterns": [
  5. {
  6. "include": "#comments"
  7. },
  8. {
  9. "include": "#strings"
  10. },
  11. {
  12. "include": "#numbers"
  13. },
  14. {
  15. "include": "#keywords"
  16. },
  17. {
  18. "include": "#types"
  19. },
  20. {
  21. "include": "#operators"
  22. }
  23. ],
  24. "repository": {
  25. "comments": {
  26. "patterns": [
  27. {
  28. "name": "comment.block.oberon",
  29. "begin": "\\(\\*",
  30. "end": "\\*\\)",
  31. "patterns": [
  32. {
  33. "include": "#comments"
  34. }
  35. ]
  36. }
  37. ]
  38. },
  39. "strings": {
  40. "patterns": [
  41. {
  42. "name": "string.quoted.double.oberon",
  43. "begin": "\"",
  44. "end": "\""
  45. },
  46. {
  47. "name": "string.quoted.single.oberon",
  48. "begin": "'",
  49. "end": "'",
  50. "patterns": [
  51. {
  52. "name": "constant.character.escape.oberon",
  53. "match": "''"
  54. }
  55. ]
  56. }
  57. ]
  58. },
  59. "numbers": {
  60. "patterns": [
  61. {
  62. "name": "constant.numeric.oberon",
  63. "match": "\\b(?:[0-9A-Fa-f]+H|[0-9A-Fa-f]+X|\\d+\\.\\d+(?:[ED][+-]?\\d+)?|\\d+)(?!\\w)"
  64. }
  65. ]
  66. },
  67. "keywords": {
  68. "patterns": [
  69. {
  70. "name": "keyword.control.oberon",
  71. "match": "(?i)\\b(?:AND|ARRAY|BEGIN|BY|CASE|CONST|DEFINITION|DIV|DO|ELSE|ELSIF|END|EXIT|FOR|IF|IMPORT|IN|IS|LOOP|MOD|MODULE|NIL|NOT|OF|OR|POINTER|PROCEDURE|RECORD|REPEAT|RETURN|THEN|TO|TYPE|UNTIL|VAR|WHILE|WITH)\\b"
  72. }
  73. ]
  74. },
  75. "types": {
  76. "patterns": [
  77. {
  78. "name": "storage.type.oberon",
  79. "match": "(?i)\\b(?:INTEGER|SHORTINT|LONGINT|REAL|LONGREAL|CHAR|BOOLEAN|SET)\\b"
  80. }
  81. ]
  82. },
  83. "operators": {
  84. "patterns": [
  85. {
  86. "name": "keyword.operator.oberon",
  87. "match": ":=|<=|>=|<>|=|<|>|#|\\+|-|\\*|/|\\.\\.|&|~|\\^"
  88. }
  89. ]
  90. }
  91. }
  92. }