pascal.tmLanguage.json 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {
  2. "name": "Pascal",
  3. "scopeName": "source.pascal",
  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.pascal",
  29. "begin": "\\(\\*",
  30. "end": "\\*\\)"
  31. },
  32. {
  33. "name": "comment.block.pascal",
  34. "begin": "\\{",
  35. "end": "\\}"
  36. }
  37. ]
  38. },
  39. "strings": {
  40. "patterns": [
  41. {
  42. "name": "string.quoted.single.pascal",
  43. "begin": "'",
  44. "end": "'",
  45. "patterns": [
  46. {
  47. "name": "constant.character.escape.pascal",
  48. "match": "''"
  49. }
  50. ]
  51. }
  52. ]
  53. },
  54. "numbers": {
  55. "patterns": [
  56. {
  57. "name": "constant.numeric.pascal",
  58. "match": "(?<!\\w)(?:\\$[0-9A-Fa-f]+|&[0-7]+|%[01]+|\\d+\\.\\d+(?:[Ee][+-]?\\d+)?|\\d+)(?!\\w)"
  59. }
  60. ]
  61. },
  62. "keywords": {
  63. "patterns": [
  64. {
  65. "name": "keyword.control.pascal",
  66. "match": "(?i)\\b(?:AND|ARRAY|BEGIN|CASE|CONST|DIV|DO|DOWNTO|ELSE|END|FILE|FOR|FORWARD|FUNCTION|GOTO|IF|IN|LABEL|MOD|NIL|NOT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|WHILE|WITH)\\b"
  67. }
  68. ]
  69. },
  70. "types": {
  71. "patterns": [
  72. {
  73. "name": "storage.type.pascal",
  74. "match": "(?i)\\b(?:INTEGER|SHORTINT|LONGINT|CARDINAL|REAL|CHAR|BOOLEAN|STRING|TEXT)\\b"
  75. }
  76. ]
  77. },
  78. "operators": {
  79. "patterns": [
  80. {
  81. "name": "keyword.operator.pascal",
  82. "match": ":=|<=|>=|<>|=|<|>|\\+|-|\\*|/|\\.\\.|@|\\^"
  83. }
  84. ]
  85. }
  86. }
  87. }