{ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "Sail", "patterns": [ { "include": "#comments" }, { "include": "#keywords" }, { "include": "#operators" }, { "include": "#strings" }, { "include": "#numbers" }, { "include": "#typevariables" }, { "include": "#variables" } ], "repository": { "keywords": { "patterns": [ { "name": "keyword.control.sail", "match": "\\b(if|then|while|for|foreach|return|match|else)\\b" }, { "name": "keyword.type.sail", "match": "\\b(atom|int)\\b" }, { "name": "keyword.other.sail", "match": "\\b(type|val|var|let|in|function|scattered|enum|union|clause|default|order|dec|register|vector|bitfield)\\b" }, { "name": "keyword.other.sail", "match": "\\b(forall)\\b" }, { "name": "keyword.other.sail", "match": "\\b(effect)\\b" }, { "name": "keyword.other.sail", "match": "\\b(infix|overload|operator)\\b" }, { "name": "keyword.other.sail", "match": "\\b(\\$include)\\b" }, { "name": "keyword.other.sail", "match": "(=>|>=|<=|=|->|-|:|,|\\+|\\*|\\.|@)" }, { "name": "keyword.other.sail", "match": "\\b_\\b" }, { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.paren.open" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.paren.close" } }, "patterns": [ { "include": "$self" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.curly.open" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.curly.close" } }, "patterns": [ { "include": "$self" } ] }, { "begin": "^\\s*((\\$)\\s*(include|import))\\b\\s*", "beginCaptures": { "1": { "name": "keyword.control.directive.$3.sail" }, "2": { "name": "punctuation.definition.directive.sail" } }, "end": "(?=(?://|/\\*))|(?", "endCaptures": { "0": { "name": "punctuation.definition.string.end.sail" } }, "name": "string.quoted.other.lt-gt.include.sail" } ] }, { "include": "#comments" } ] }, "comments": { "patterns": [ { "name": "comment.line.double-slash.documentation.sail", "begin": "(?:^)(?>\\s*)(\\/\\/[!\\/]+)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.documentation.sail" } }, "end": "(?<=\\n)(?\\s*)\\/\\*[!*]+(?:(?:\\n|$)|(?=\\s)))", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.documentation.sail" } }, "end": "([!*]*\\*\\/)", "endCaptures": { "1": { "name": "punctuation.definition.comment.end.documentation.sail" } } }, { "match": "^\\/\\* =(\\s*.*?)\\s*= \\*\\/$\\n?", "captures": { "1": { "name": "meta.toc-list.banner.block.sail" } }, "name": "comment.block.banner.sail" }, { "name": "comment.block.sail", "begin": "(\\/\\*)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.sail" } }, "end": "(\\*\\/)", "endCaptures": { "1": { "name": "punctuation.definition.comment.end.sail" } } }, { "match": "^\\/\\/ =(\\s*.*?)\\s*=$\\n?", "captures": { "1": { "name": "meta.toc-list.banner.line.sail" } }, "name": "comment.line.banner.sail" }, { "begin": "((?:^[ \\t]+)?)(?=\\/\\/)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.sail" } }, "end": "(?!\\G)", "patterns": [ { "name": "comment.line.double-slash.sail", "begin": "(\\/\\/)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.sail" } }, "end": "(?=\\n)", "patterns": [ { "include": "#line_continuation_character" } ] } ] } ] }, "line_continuation_character": { "patterns": [ { "match": "(\\\\)\\n", "captures": { "1": { "name": "constant.character.escape.line-continuation.c" } } } ] }, "strings": { "name": "string.quoted.double.sail", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.sail", "match": "\\\\." } ] }, "numbers": { "patterns": [ { "match": "\\b((0(x|X)[0-9a-fA-F]*)|(0(b|B)[01]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b", "name": "constant.numeric.sail" } ] }, "typevariables": { "patterns": [ { "match": "'([A-Za-z][A-Za-z_0-9]*)\\b", "name": "variable.parameter" } ] }, "variables": { "patterns": [ { "match": "\\b([A-Za-z][A-Za-z_0-9]*)\\b", "name": "variable.other" } ] } }, "scopeName": "source.sail" }