src/Tools/VSCode/extension/isabelle-ml-grammar.json
author wenzelm
Mon Mar 25 17:21:26 2019 +0100 (8 weeks ago)
changeset 69981 3dced198b9ec
parent 64804 b2b05fdff3a7
permissions -rw-r--r--
more strict AFP properties;
wenzelm@64749
     1
{
wenzelm@64749
     2
  "name": "Isabelle/ML",
wenzelm@64749
     3
  "scopeName": "source.isabelle-ml",
wenzelm@64804
     4
  "fileTypes": ["ML", "sml", "sig"],
wenzelm@64749
     5
  "uuid": "aa32eb5e-d0d9-11e6-b7a4-37ba001f1e6e",
wenzelm@64749
     6
  "keyEquivalent": "^~M",
wenzelm@64749
     7
  "repository": {
wenzelm@64749
     8
    "comments": {
wenzelm@64749
     9
      "patterns": [
wenzelm@64749
    10
        {
wenzelm@64749
    11
          "end": "\\*\\)",
wenzelm@64749
    12
          "begin": "\\(\\*",
wenzelm@64749
    13
          "beginCaptures": {
wenzelm@64749
    14
            "0": {
wenzelm@64749
    15
              "name": "punctuation.definition.comment.begin.ml"
wenzelm@64749
    16
            }
wenzelm@64749
    17
          },
wenzelm@64749
    18
          "patterns": [
wenzelm@64749
    19
            {
wenzelm@64749
    20
              "include": "#comments"
wenzelm@64749
    21
            }
wenzelm@64749
    22
          ],
wenzelm@64749
    23
          "endCaptures": {
wenzelm@64749
    24
            "0": {
wenzelm@64749
    25
              "name": "punctuation.definition.comment.end.ml"
wenzelm@64749
    26
            }
wenzelm@64749
    27
          },
wenzelm@64749
    28
          "name": "comment.block.ml"
wenzelm@64749
    29
        }
wenzelm@64749
    30
      ]
wenzelm@64749
    31
    },
wenzelm@64749
    32
    "spec": {
wenzelm@64749
    33
      "patterns": [
wenzelm@64749
    34
        {
wenzelm@64749
    35
          "match": "\\b(exception|type)\\s+([a-zA-Z][a-zA-Z0-9'_]*)",
wenzelm@64749
    36
          "captures": {
wenzelm@64749
    37
            "1": {
wenzelm@64749
    38
              "name": "keyword.other.ml"
wenzelm@64749
    39
            },
wenzelm@64749
    40
            "2": {
wenzelm@64749
    41
              "name": "entity.name.type.abbrev.ml"
wenzelm@64749
    42
            }
wenzelm@64749
    43
          },
wenzelm@64749
    44
          "name": "meta.spec.ml.type"
wenzelm@64749
    45
        },
wenzelm@64749
    46
        {
wenzelm@64749
    47
          "end": "(?=val|type|eqtype|datatype|structure|include|exception)",
wenzelm@64749
    48
          "begin": "\\b(datatype)\\s+([a-zA-Z][a-zA-Z0-9'_]*)\\s*(?==)",
wenzelm@64749
    49
          "patterns": [
wenzelm@64749
    50
            {
wenzelm@64749
    51
              "match": "\\b(and)\\s+([a-zA-Z][a-zA-Z0-9'_]*)\\s*(?==)",
wenzelm@64749
    52
              "captures": {
wenzelm@64749
    53
                "1": {
wenzelm@64749
    54
                  "name": "keyword.other.ml"
wenzelm@64749
    55
                },
wenzelm@64749
    56
                "2": {
wenzelm@64749
    57
                  "name": "entity.name.type.datatype.ml"
wenzelm@64749
    58
                }
wenzelm@64749
    59
              },
wenzelm@64749
    60
              "name": "meta.spec.ml.datatype"
wenzelm@64749
    61
            },
wenzelm@64749
    62
            {
wenzelm@64749
    63
              "match": "(?x)\n\t\t\t\t\t\t\t=\\s*([a-zA-Z][a-zA-Z0-9'_]*)(\\s+of)?",
wenzelm@64749
    64
              "captures": {
wenzelm@64749
    65
                "1": {
wenzelm@64749
    66
                  "name": "variable.other.dcon.ml"
wenzelm@64749
    67
                },
wenzelm@64749
    68
                "2": {
wenzelm@64749
    69
                  "name": "keyword.other.ml"
wenzelm@64749
    70
                }
wenzelm@64749
    71
              },
wenzelm@64749
    72
              "name": "meta.datatype.rule.main.ml"
wenzelm@64749
    73
            },
wenzelm@64749
    74
            {
wenzelm@64749
    75
              "match": "\\|\\s*([a-zA-Z][a-zA-Z0-9'_]*)(\\s+of)?",
wenzelm@64749
    76
              "captures": {
wenzelm@64749
    77
                "1": {
wenzelm@64749
    78
                  "name": "variable.other.dcon.ml"
wenzelm@64749
    79
                },
wenzelm@64749
    80
                "2": {
wenzelm@64749
    81
                  "name": "keyword.other.ml"
wenzelm@64749
    82
                }
wenzelm@64749
    83
              },
wenzelm@64749
    84
              "name": "meta.datatype.rule.other.ml"
wenzelm@64749
    85
            }
wenzelm@64749
    86
          ],
wenzelm@64749
    87
          "captures": {
wenzelm@64749
    88
            "1": {
wenzelm@64749
    89
              "name": "keyword.other.ml"
wenzelm@64749
    90
            },
wenzelm@64749
    91
            "2": {
wenzelm@64749
    92
              "name": "entity.name.type.datatype.ml"
wenzelm@64749
    93
            }
wenzelm@64749
    94
          },
wenzelm@64749
    95
          "name": "meta.spec.ml.datatype"
wenzelm@64749
    96
        },
wenzelm@64749
    97
        {
wenzelm@64749
    98
          "match": "\\b(val)\\s*([^:]+)\\s*:",
wenzelm@64749
    99
          "captures": {
wenzelm@64749
   100
            "1": {
wenzelm@64749
   101
              "name": "keyword.other.ml"
wenzelm@64749
   102
            }
wenzelm@64749
   103
          },
wenzelm@64749
   104
          "name": "meta.spec.ml.val"
wenzelm@64749
   105
        },
wenzelm@64749
   106
        {
wenzelm@64749
   107
          "end": "(?=val|type|eqtype|datatype|structure|include)",
wenzelm@64749
   108
          "begin": "\\b(structure)\\s*(\\w+)\\s*:",
wenzelm@64749
   109
          "patterns": [
wenzelm@64749
   110
            {
wenzelm@64749
   111
              "match": "\\b(sharing)\\b",
wenzelm@64749
   112
              "name": "keyword.other.ml"
wenzelm@64749
   113
            }
wenzelm@64749
   114
          ],
wenzelm@64749
   115
          "captures": {
wenzelm@64749
   116
            "1": {
wenzelm@64749
   117
              "name": "keyword.other.ml"
wenzelm@64749
   118
            },
wenzelm@64749
   119
            "2": {
wenzelm@64749
   120
              "name": "entity.name.type.module.ml"
wenzelm@64749
   121
            }
wenzelm@64749
   122
          },
wenzelm@64749
   123
          "name": "meta.spec.ml.structure"
wenzelm@64749
   124
        },
wenzelm@64749
   125
        {
wenzelm@64749
   126
          "match": "\\b(include)\\b",
wenzelm@64749
   127
          "captures": {
wenzelm@64749
   128
            "1": {
wenzelm@64749
   129
              "name": "keyword.other.ml"
wenzelm@64749
   130
            }
wenzelm@64749
   131
          },
wenzelm@64749
   132
          "name": "meta.spec.ml.include"
wenzelm@64749
   133
        },
wenzelm@64749
   134
        {
wenzelm@64749
   135
          "include": "#comments"
wenzelm@64749
   136
        }
wenzelm@64749
   137
      ]
wenzelm@64749
   138
    }
wenzelm@64749
   139
  },
wenzelm@64749
   140
  "patterns": [
wenzelm@64749
   141
    {
wenzelm@64749
   142
      "include": "#comments"
wenzelm@64749
   143
    },
wenzelm@64749
   144
    {
wenzelm@64749
   145
      "match": "\\b(val|datatype|signature|type|op|sharing|struct|as|let|in|abstype|local|where|case|of|fn|raise|exception|handle|ref|infix|infixr|before|end|structure|withtype)\\b",
wenzelm@64749
   146
      "name": "keyword.other.ml"
wenzelm@64749
   147
    },
wenzelm@64749
   148
    {
wenzelm@64749
   149
      "end": "\\b(end)\\b",
wenzelm@64749
   150
      "begin": "\\b(let)\\b",
wenzelm@64749
   151
      "patterns": [
wenzelm@64749
   152
        {
wenzelm@64749
   153
          "include": "$self"
wenzelm@64749
   154
        }
wenzelm@64749
   155
      ],
wenzelm@64749
   156
      "captures": {
wenzelm@64749
   157
        "1": {
wenzelm@64749
   158
          "name": "keyword.other.ml"
wenzelm@64749
   159
        },
wenzelm@64749
   160
        "2": {
wenzelm@64749
   161
          "name": "keyword.other.ml"
wenzelm@64749
   162
        }
wenzelm@64749
   163
      },
wenzelm@64749
   164
      "name": "meta.exp.let.ml"
wenzelm@64749
   165
    },
wenzelm@64749
   166
    {
wenzelm@64749
   167
      "end": "\\b(end)\\b",
wenzelm@64749
   168
      "begin": "\\b(sig)\\b",
wenzelm@64749
   169
      "patterns": [
wenzelm@64749
   170
        {
wenzelm@64749
   171
          "include": "#spec"
wenzelm@64749
   172
        }
wenzelm@64749
   173
      ],
wenzelm@64749
   174
      "captures": {
wenzelm@64749
   175
        "1": {
wenzelm@64749
   176
          "name": "keyword.other.delimiter.ml"
wenzelm@64749
   177
        },
wenzelm@64749
   178
        "2": {
wenzelm@64749
   179
          "name": "keyword.other.delimiter.ml"
wenzelm@64749
   180
        }
wenzelm@64749
   181
      },
wenzelm@64749
   182
      "name": "meta.module.sigdec.ml"
wenzelm@64749
   183
    },
wenzelm@64749
   184
    {
wenzelm@64749
   185
      "match": "\\b(if|then|else)\\b",
wenzelm@64749
   186
      "name": "keyword.control.ml"
wenzelm@64749
   187
    },
wenzelm@64749
   188
    {
wenzelm@64749
   189
      "end": "(?=val|type|eqtype|datatype|structure|local)",
wenzelm@64749
   190
      "begin": "\\b(fun|and)\\s+([\\w]+)\\b",
wenzelm@64749
   191
      "patterns": [
wenzelm@64749
   192
        {
wenzelm@64804
   193
          "include": "source.isabelle-ml"
wenzelm@64749
   194
        }
wenzelm@64749
   195
      ],
wenzelm@64749
   196
      "captures": {
wenzelm@64749
   197
        "1": {
wenzelm@64749
   198
          "name": "keyword.control.fun.ml"
wenzelm@64749
   199
        },
wenzelm@64749
   200
        "2": {
wenzelm@64749
   201
          "name": "entity.name.function.ml"
wenzelm@64749
   202
        }
wenzelm@64749
   203
      },
wenzelm@64749
   204
      "name": "meta.definition.fun.ml"
wenzelm@64749
   205
    },
wenzelm@64749
   206
    {
wenzelm@64749
   207
      "end": "\"",
wenzelm@64749
   208
      "begin": "\"",
wenzelm@64749
   209
      "beginCaptures": {
wenzelm@64749
   210
        "0": {
wenzelm@64749
   211
          "name": "punctuation.definition.string.begin.ml"
wenzelm@64749
   212
        }
wenzelm@64749
   213
      },
wenzelm@64749
   214
      "patterns": [
wenzelm@64749
   215
        {
wenzelm@64749
   216
          "match": "\\\\.",
wenzelm@64749
   217
          "name": "constant.character.escape.ml"
wenzelm@64749
   218
        }
wenzelm@64749
   219
      ],
wenzelm@64749
   220
      "endCaptures": {
wenzelm@64749
   221
        "0": {
wenzelm@64749
   222
          "name": "punctuation.definition.string.end.ml"
wenzelm@64749
   223
        }
wenzelm@64749
   224
      },
wenzelm@64749
   225
      "name": "string.quoted.double.ml"
wenzelm@64749
   226
    },
wenzelm@64749
   227
    {
wenzelm@64749
   228
      "match": "(#\")(\\\\)?.(\")",
wenzelm@64749
   229
      "captures": {
wenzelm@64749
   230
        "3": {
wenzelm@64749
   231
          "name": "punctuation.definition.constant.ml"
wenzelm@64749
   232
        },
wenzelm@64749
   233
        "1": {
wenzelm@64749
   234
          "name": "punctuation.definition.constant.ml"
wenzelm@64749
   235
        }
wenzelm@64749
   236
      },
wenzelm@64749
   237
      "name": "constant.character.ml"
wenzelm@64749
   238
    },
wenzelm@64749
   239
    {
wenzelm@64749
   240
      "match": "\\b\\d*\\.?\\d+\\b",
wenzelm@64749
   241
      "name": "constant.numeric.ml"
wenzelm@64749
   242
    },
wenzelm@64749
   243
    {
wenzelm@64749
   244
      "match": "\\b(andalso|orelse|not)\\b",
wenzelm@64749
   245
      "name": "keyword.operator.logical.ml"
wenzelm@64749
   246
    },
wenzelm@64749
   247
    {
wenzelm@64749
   248
      "end": "(?==|:|\\()",
wenzelm@64749
   249
      "begin": "(?x)\\b\n\t\t\t\t\t(functor|structure|signature)\\s+\n\t\t\t\t\t(\\w+)\\s* # identifier",
wenzelm@64749
   250
      "captures": {
wenzelm@64749
   251
        "1": {
wenzelm@64749
   252
          "name": "storage.type.module.binder.ml"
wenzelm@64749
   253
        },
wenzelm@64749
   254
        "2": {
wenzelm@64749
   255
          "name": "entity.name.type.module.ml"
wenzelm@64749
   256
        }
wenzelm@64749
   257
      },
wenzelm@64749
   258
      "name": "meta.module.dec.ml"
wenzelm@64749
   259
    },
wenzelm@64749
   260
    {
wenzelm@64749
   261
      "match": "\\b(open)\\b",
wenzelm@64749
   262
      "name": "keyword.other.module.ml"
wenzelm@64749
   263
    },
wenzelm@64749
   264
    {
wenzelm@64749
   265
      "match": "\\b(nil|true|false|NONE|SOME)\\b",
wenzelm@64749
   266
      "name": "constant.language.ml"
wenzelm@64749
   267
    },
wenzelm@64749
   268
    {
wenzelm@64749
   269
      "end": "$",
wenzelm@64749
   270
      "begin": "\\b(type|eqtype) .* =",
wenzelm@64749
   271
      "patterns": [
wenzelm@64749
   272
        {
wenzelm@64749
   273
          "match": "(([a-zA-Z0-9\\.\\* ]|(\\->))*)",
wenzelm@64749
   274
          "name": "meta.typeexp.ml"
wenzelm@64749
   275
        }
wenzelm@64749
   276
      ],
wenzelm@64749
   277
      "captures": {
wenzelm@64749
   278
        "1": {
wenzelm@64749
   279
          "name": "keyword.other.typeabbrev.ml"
wenzelm@64749
   280
        },
wenzelm@64749
   281
        "2": {
wenzelm@64749
   282
          "name": "variable.other.typename.ml"
wenzelm@64749
   283
        }
wenzelm@64749
   284
      },
wenzelm@64749
   285
      "name": "meta.typeabbrev.ml"
wenzelm@64749
   286
    }
wenzelm@64749
   287
  ]
wenzelm@64749
   288
}