github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/third_party/mlir/utils/textmate/mlir.json (about)

     1  {
     2    "fileTypes" : [
     3      "mlir"
     4    ],
     5    "repository" : {
     6      "container" : {
     7        "end" : ">",
     8        "begin" : "(complex|tuple)<",
     9        "beginCaptures" : {
    10          "1" : {
    11            "name" : "keyword.container.mlir"
    12          }
    13        },
    14        "patterns" : [
    15          {
    16            "include" : "#types"
    17          }
    18        ],
    19        "name" : "meta.types.container.mlir"
    20      },
    21      "loc" : {
    22        "end" : "\\)",
    23        "begin" : "\\b(loc)\\(",
    24        "beginCaptures" : {
    25          "1" : {
    26            "name" : "keyword.loc.mlir"
    27          }
    28        },
    29        "patterns" : [
    30          {
    31            "include" : "#loc_fusedloc"
    32          },
    33          {
    34            "include" : "#loc_nameloc"
    35          },
    36          {
    37            "include" : "#op_generic"
    38          }
    39        ],
    40        "name" : "meta.loc.mlir"
    41      },
    42      "integer" : {
    43        "match" : "[1-9][0-9]*",
    44        "name" : "constant.numeric.mlir"
    45      },
    46      "op" : {
    47        "patterns" : [
    48          {
    49            "include" : "#terminator"
    50          },
    51          {
    52            "include" : "#op_generic"
    53          }
    54        ]
    55      },
    56      "loc_nameloc" : {
    57        "patterns" : [
    58          {
    59            "include" : "#string"
    60          }
    61        ],
    62        "name" : "meta.location.mlir"
    63      },
    64      "bool_constant" : {
    65        "match" : "\\b(true|false)\\b",
    66        "captures" : {
    67          "1" : {
    68            "name" : "constant.language.mlir"
    69          }
    70        },
    71        "name" : "constant.language.mlir"
    72      },
    73      "string" : {
    74        "end" : "\"",
    75        "begin" : "\"",
    76        "beginCaptures" : {
    77          "0" : {
    78            "name" : "punctuation.definition.string.begin.mlir"
    79          }
    80        },
    81        "patterns" : [
    82          {
    83            "match" : "\\\\[nt\"]",
    84            "name" : "constant.character.escape.mlir"
    85          },
    86          {
    87            "match" : "\\\\.",
    88            "name" : "invalid.illegal.mlir"
    89          }
    90        ],
    91        "endCaptures" : {
    92          "0" : {
    93            "name" : "punctuation.definition.string.end.mlir"
    94          }
    95        },
    96        "name" : "string.quoted.double.mlir"
    97      },
    98      "terminator" : {
    99        "end" : "\\n",
   100        "begin" : "(br|cond_br|return)",
   101        "beginCaptures" : {
   102          "1" : {
   103            "name" : "keyword.control.mlir"
   104          }
   105        },
   106        "patterns" : [
   107          {
   108            "include" : "#branch_target"
   109          },
   110          {
   111            "include" : "#identifier"
   112          },
   113          {
   114            "include" : "#types"
   115          },
   116          {
   117            "include" : "#loc"
   118          }
   119        ]
   120      },
   121      "region" : {
   122        "end" : "(?=})",
   123        "begin" : "{",
   124        "patterns" : [
   125          {
   126            "include" : "#branch_target"
   127          },
   128          {
   129            "include" : "#op"
   130          },
   131          {
   132            "include" : "#attributes"
   133          },
   134          {
   135            "include" : "#comment"
   136          },
   137          {
   138            "include" : "#string"
   139          }
   140        ],
   141        "name" : "meta.region.mlir"
   142      },
   143      "constant" : {
   144        "patterns" : [
   145          {
   146            "include" : "#bool_constant"
   147          },
   148          {
   149            "include" : "#integer"
   150          },
   151          {
   152            "include" : "#string"
   153          }
   154        ],
   155        "name" : "constants.other.mlir"
   156      },
   157      "loc_fusedloc" : {
   158        "end" : "\\]",
   159        "begin" : "(fused)(<.*>)?\\[",
   160        "beginCaptures" : {
   161          "1" : {
   162            "name" : "keyword.loc.mlir"
   163          },
   164          "2" : {
   165            "patterns" : [
   166              {
   167                "include" : "#string"
   168              }
   169            ]
   170          }
   171        },
   172        "patterns" : [
   173          {
   174            "include" : "#string"
   175          }
   176        ],
   177        "name" : "meta.location.mlir"
   178      },
   179      "branch_target" : {
   180        "end" : "[:,\\n]",
   181        "begin" : "(\\^bb[\\w\\d_$\\.-]+)",
   182        "beginCaptures" : {
   183          "1" : {
   184            "name" : "entity.name.label.mlir"
   185          }
   186        },
   187        "patterns" : [
   188          {
   189            "include" : "#branch_target_region"
   190          },
   191          {
   192            "include" : "#comment"
   193          }
   194        ],
   195        "name" : "meta.branch_target.mlir"
   196      },
   197      "types" : {
   198        "patterns" : [
   199          {
   200            "include" : "#container"
   201          },
   202          {
   203            "include" : "#shaped_container"
   204          },
   205          {
   206            "include" : "#standard_simple_types"
   207          }
   208        ],
   209        "name" : "meta.types.mlir"
   210      },
   211      "attribute_keywords" : {
   212        "match" : "\\b(dense|none|opaque|sparse)\\b",
   213        "captures" : {
   214          "1" : {
   215            "name" : "keyword.attributes.mlir"
   216          }
   217        }
   218      },
   219      "identifier" : {
   220        "match" : "[\\%#][a-zA-Z0-9][\\w\\d_]*",
   221        "captures" : {
   222          "0" : {
   223            "name" : "variable.mlir"
   224          }
   225        },
   226        "name" : "meta.identifier.mlir"
   227      },
   228      "shaped_container" : {
   229        "end" : ">",
   230        "begin" : "(memref|tensor|vector)<",
   231        "beginCaptures" : {
   232          "1" : {
   233            "name" : "keyword.shaped_container.mlir"
   234          }
   235        },
   236        "patterns" : [
   237          {
   238            "include" : "#types"
   239          }
   240        ],
   241        "name" : "meta.types.standard.shaped_container.mlir"
   242      },
   243      "standard_simple_types" : {
   244        "match" : "\\b(index|i[1-9]\\d*|f16|bf16|f32|f64)\\b",
   245        "captures" : {
   246          "1" : {
   247            "name" : "keyword.types.standard.simple.mlir"
   248          }
   249        },
   250        "name" : "meta.types.standard.simple.mlir"
   251      },
   252      "function_attributes" : {
   253        "end" : "}",
   254        "begin" : "(attributes)\\s*{",
   255        "beginCaptures" : {
   256          "1" : {
   257            "name" : "keyword.attributes.mlir"
   258          }
   259        },
   260        "patterns" : [
   261          {
   262            "include" : "#constant"
   263          }
   264        ],
   265        "name" : "meta.attributes.function.mlir"
   266      },
   267      "op_generic" : {
   268        "end" : "\\n",
   269        "begin" : "((%[\\w\\d_]*)\\s*)=\\s*(?=\")",
   270        "beginCaptures" : {
   271          "2" : {
   272            "name" : "variable.mlir"
   273          }
   274        },
   275        "patterns" : [
   276          {
   277            "include" : "#attributes"
   278          },
   279          {
   280            "include" : "#identifier"
   281          },
   282          {
   283            "include" : "#loc"
   284          },
   285          {
   286            "include" : "#string"
   287          },
   288          {
   289            "include" : "#types"
   290          }
   291        ],
   292        "name" : "meta.op.generic.mlir"
   293      },
   294      "function_results" : {
   295        "end" : "\\)",
   296        "begin" : "->\\s*\\(",
   297        "patterns" : [
   298          {
   299            "include" : "#types"
   300          }
   301        ],
   302        "name" : "meta.function.results.mlir"
   303      },
   304      "branch_target_region" : {
   305        "end" : "\\)",
   306        "begin" : "\\(",
   307        "patterns" : [
   308          {
   309            "include" : "#identifier"
   310          },
   311          {
   312            "include" : "#types"
   313          }
   314        ],
   315        "name" : "meta.branch_target.mlir"
   316      },
   317      "comment" : {
   318        "match" : "\/\/.*$",
   319        "name" : "comment.line.double-slash.mlir"
   320      },
   321      "attributes" : {
   322        "end" : "}",
   323        "begin" : "{",
   324        "patterns" : [
   325          {
   326            "include" : "#attribute_keywords"
   327          },
   328          {
   329            "include" : "#constant"
   330          }
   331        ],
   332        "name" : "meta.attributes.mlir"
   333      },
   334      "function_params" : {
   335        "end" : ")",
   336        "begin" : "(",
   337        "patterns" : [
   338          {
   339            "include" : "#identifier"
   340          },
   341          {
   342            "include" : "#types"
   343          }
   344        ]
   345      }
   346    },
   347    "scope" : "mlir",
   348    "patterns" : [
   349      {
   350        "match" : "\\b(module)\\b",
   351        "name" : "keyword.module.mlir"
   352      },
   353      {
   354        "end" : "}",
   355        "begin" : "\\b(func)\\b\\s*(@[a-zA-Z_][a-zA-Z_0-9\\.]*)",
   356        "beginCaptures" : {
   357          "1" : {
   358            "name" : "keyword.function.mlir"
   359          },
   360          "2" : {
   361            "name" : "entity.name.function.mlir"
   362          }
   363        },
   364        "patterns" : [
   365          {
   366            "include" : "#function_params"
   367          },
   368          {
   369            "include" : "#function_attributes"
   370          },
   371          {
   372            "include" : "#function_results"
   373          },
   374          {
   375            "include" : "#region"
   376          }
   377        ],
   378        "name" : "support.function.mlir"
   379      },
   380      {
   381        "include" : "#comment",
   382        "name" : "comment.line.double-slash.mlir"
   383      }
   384    ],
   385    "name" : "MLIR",
   386    "scopeName" : "source.mlir"
   387  }