{
  "name": "ATS",
  "scopeName": "source.ats",
  "fileTypes": [
    "dats",
    "sats",
    "hats"
  ],
  "uuid": "c3b7ee53-6117-4cdf-80ea-d0572e54aed7",
  "patterns": [
    {
      "include": "#block"
    },
    {
      "include": "#comment_rest"
    },
    {
      "include": "#comment_line"
    },
    {
      "include": "#comment_block"
    },
    {
      "include": "#embed"
    },
    {
      "include": "#operators"
    },
    {
      "include": "#quantifier_curly"
    },
    {
      "include": "#quantifier_square"
    },
    {
      "include": "#quantifier_arrow"
    },
    {
      "include": "#keywords"
    },
    {
      "include": "#keywords_types"
    },
    {
      "include": "#string"
    },
    {
      "include": "#char"
    },
    {
      "include": "#records"
    },
    {
      "include": "#tuples"
    },
    {
      "include": "#number"
    }
  ],
  "repository": {
    "comment_block": {
      "name": "comment.block",
      "begin": "\\(\\*",
      "end": "\\*\\)",
      "patterns": [
        {
          "include": "#comment_block"
        }
      ],
      "applyEndPatternLast": 1
    },
    "comment_line": {
      "name": "comment.line.double-slash",
      "match": "//.*$"
    },
    "comment_rest": {
      "name": "comment",
      "begin": "////",
      "end": ".\\z",
      "patterns": [
        {
          "match": ".*"
        }
      ],
      "applyEndPatternLast": 1
    },
    "records": {
      "begin": "('|@)({)",
      "end": "(})",
      "patterns": [
        {
          "include": "$self"
        }
      ]
    },
    "tuples": {
      "begin": "('|@)\\(",
      "end": "(\\))",
      "patterns": [
        {
          "include": "$self"
        }
      ]
    },
    "keywords": {
      "name": "keyword",
      "match": "(\\#|\\$)(\\w+)|\\b(castfn|and|andalso|assume|as|begin|break|case(\\+|-)?|class|continue|dynload|dyn|else|end|exception|extern|fix|fn|for|fun|if|implement|implmnt|primplement|primplmnt|infixl|infixr|infix|in|lam|let|llam|local|macdef|macrodef|method|modprop|modtype|module|nonfix|object|of|op|or|orelse|overload|par|postfix|praxi|prefix|prfn|prfun|prval|rec|sif|staif|staload|stavar|sta|struct|symelim|symintr|then|try|union|val(\\+|-)?|var|when|where|while|withprop|withtype|withviewtype|withview|with)\\b"
    },
    "keywords_types": {
      "name": "keyword",
      "match": "(\\#|\\$)(\\w+)|\\b(abstype|abst@ype|abst0pe|absvtype|absvt@ype|absvt0pe|absviewtype|absviewt@ype|absviewt0pe|absview|absprop|datatype|datavtype|dataviewtype|dataview|dataprop|datasort|sortdef|propdef|viewdef|viewtypedef|vtypedef|stadef|typedef|)\\b"
    },
    "operators": {
      "name": "keyword.operator",
      "match": "!=|!|%|&&|&|\\*|\\+|-|-->|->|/|:=|<=|(?<=\\s)<|==>|=>|=|>=|>>|>|\\?|\\|\\||\\||~|\\[\\]"
    },
    "quantifier_arrow": {
      "name": "support.type",
      "begin": "(?<!\\s)<",
      "end": ">"
    },
    "quantifier_curly": {
      "name": "support.type",
      "begin": "({)",
      "end": "(})"
    },
    "quantifier_square": {
      "name": "support.type",
      "begin": "(\\[)",
      "end": "(\\])"
    },
    "number": {
      "name": "constant.numeric",
      "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|~)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
    },
    "string": {
      "name": "string.quoted.double",
      "begin": "(\")",
      "end": "(\")",
      "patterns": [
        {
          "include": "#string_escaped"
        }
      ]
    },
    "string_escaped": {
      "name": "constant.character.escape",
      "match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8})"
    },
    "char": {
      "name": "string.quoted.double",
      "match": "(')([^\\\\]{0,1}|\\\\(\\\\|[abefpnrtv'\"?]|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8}))(')"
    },
    "embed": {
      "name": "meta",
      "begin": "(%{)",
      "end": "(%})"
    },
    "block": {
      "begin": "(?<=where|=|^|then|else|\\$rec|\\$rec_t|\\$rec_vt)(?:\\s*){",
      "end": "}",
      "patterns": [
        {
          "include": "$self"
        }
      ],
      "applyEndPatternLast": 1
    }
  }
}