| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- {
- "name": "GNU Modula-2 Definition",
- "scopeName": "source.modula2.definition",
- "patterns": [
- {
- "include": "#comments"
- },
- {
- "include": "#strings"
- },
- {
- "include": "#numbers"
- },
- {
- "include": "#header"
- },
- {
- "include": "#imports"
- },
- {
- "include": "#exports"
- },
- {
- "include": "#declarations"
- },
- {
- "include": "#procedure"
- },
- {
- "include": "#attributes"
- },
- {
- "include": "#types"
- },
- {
- "include": "#operators"
- },
- {
- "include": "#keywords"
- }
- ],
- "repository": {
- "comments": {
- "patterns": [
- {
- "name": "comment.block.modula2",
- "begin": "\\(\\*",
- "end": "\\*\\)"
- }
- ]
- },
- "strings": {
- "patterns": [
- {
- "name": "string.quoted.double.modula2",
- "begin": "\"",
- "end": "\"",
- "patterns": [
- {
- "name": "constant.character.escape.modula2",
- "match": "\\\\."
- }
- ]
- }
- ]
- },
- "numbers": {
- "patterns": [
- {
- "name": "constant.numeric.modula2",
- "match": "\\b(?:[0-9]+|[0-9A-Fa-f]+H)\\b"
- }
- ]
- },
- "header": {
- "patterns": [
- {
- "name": "meta.module.definition.modula2",
- "match": "\\b(DEFINITION)\\s+(MODULE)\\s+([A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "keyword.control.module.modula2"
- },
- "2": {
- "name": "keyword.control.module.modula2"
- },
- "3": {
- "name": "entity.name.namespace.modula2"
- }
- }
- },
- {
- "name": "meta.module.end.modula2",
- "match": "\\b(END)\\s+([A-Za-z_][A-Za-z0-9_]*)\\s*\\.",
- "captures": {
- "1": {
- "name": "keyword.control.module.modula2"
- },
- "2": {
- "name": "entity.name.namespace.modula2"
- }
- }
- },
- {
- "name": "keyword.control.module.modula2",
- "match": "\\bFOR\\b(?=\\s+\")"
- }
- ]
- },
- "imports": {
- "patterns": [
- {
- "name": "keyword.control.import.modula2",
- "match": "\\b(?:FROM|IMPORT)\\b"
- },
- {
- "name": "entity.name.namespace.import.modula2",
- "match": "\\b(FROM)\\s+([A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "keyword.control.import.modula2"
- },
- "2": {
- "name": "entity.name.namespace.import.modula2"
- }
- }
- }
- ]
- },
- "exports": {
- "patterns": [
- {
- "name": "keyword.control.export.modula2",
- "match": "\\bEXPORT(?:\\s+(?:QUALIFIED|UNQUALIFIED))?\\b"
- }
- ]
- },
- "declarations": {
- "patterns": [
- {
- "name": "storage.type.declaration.modula2",
- "match": "\\b(?:CONST|TYPE|VAR)\\b"
- },
- {
- "name": "entity.name.type.modula2",
- "match": "\\bTYPE\\s+([A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "entity.name.type.modula2"
- }
- }
- },
- {
- "name": "constant.other.modula2",
- "match": "\\bCONST\\s+([A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "constant.other.modula2"
- }
- }
- },
- {
- "name": "variable.other.modula2",
- "match": "\\bVAR\\s+([A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "variable.other.modula2"
- }
- }
- }
- ]
- },
- "procedure": {
- "patterns": [
- {
- "name": "keyword.control.procedure.modula2",
- "match": "\\bPROCEDURE\\b"
- },
- {
- "name": "meta.procedure.modula2",
- "match": "\\b(PROCEDURE)\\s+((?:__ATTRIBUTE__\\s+__BUILTIN__\\s+)?[A-Za-z_][A-Za-z0-9_]*)",
- "captures": {
- "1": {
- "name": "keyword.control.procedure.modula2"
- },
- "2": {
- "name": "entity.name.function.modula2"
- }
- }
- }
- ]
- },
- "attributes": {
- "patterns": [
- {
- "name": "keyword.other.gnu.modula2",
- "match": "\\b__(?:ATTRIBUTE|BUILTIN)__\\b"
- }
- ]
- },
- "types": {
- "patterns": [
- {
- "name": "storage.type.modula2",
- "match": "\\b(?:INTEGER|CARDINAL|REAL|LONGREAL|SHORTREAL|CHAR|BOOLEAN|BITSET|ADDRESS|WORD|LOC|BYTE)\\b"
- },
- {
- "name": "keyword.operator.type.modula2",
- "match": "\\b(?:ARRAY|OF|POINTER)\\b"
- }
- ]
- },
- "operators": {
- "patterns": [
- {
- "name": "keyword.operator.modula2",
- "match": ":=|<=|>=|<>|#|=|<|>|\\+|-|\\*|/|\\.\\.|;|:|\\."
- }
- ]
- },
- "keywords": {
- "patterns": [
- {
- "name": "keyword.control.modula2",
- "match": "\\b(?:AND|BEGIN|BY|CASE|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"
- }
- ]
- }
- }
- }
|