Skip to content

Instantly share code, notes, and snippets.

@iainmcgin
Created July 27, 2011 17:13
Show Gist options
  • Save iainmcgin/1109880 to your computer and use it in GitHub Desktop.
Save iainmcgin/1109880 to your computer and use it in GitHub Desktop.
Sublime Text 2 syntax highlighter for Plaid language
{ "name": "Plaid",
"scopeName": "source.plaid",
"fileTypes": ["plaid"],
"patterns": [
{
"name": "keyword.source.plaid",
"match": "\\b(case|default|import|match|new|of|package|requires|state|override|with)\\b",
"comment": "keywords"
},
{
"name": "variable.language.plaid",
"match": "\\bthis\\b",
"comment": "self reference"
},
{
"name": "keyword.other.plaid",
"match": "\\b(immutable|unique|shared)\\b",
"comment": "Permissions"
},
{
"name": "constant.numeric.plaid",
"match": "\\b[0-9]+(\\.[0-9]+)?\\b",
"comment": "numeric constants"
},
{
"name": "constant.language.plaid",
"match": "\\b(true|false|Nil|None)\\b",
"comment": "language constants"
},
{
"name": "support.class.plaid",
"match": "\\b(Boolean|Integer|Double|String|void|Option)\\b",
"comment": "built in types"
},
{
"name": "support.function.plaid",
"match": "\\b(while|if|ifElse|min|max|abs)\\b",
"comment": "built in functions"
},
{
"name": "variable.plaid",
"match": "\\b(val|var)\\s+(\\w+)\\b",
"captures": {
"1": { "name": "keyword.source.plaid"},
"2": { "name": "variable.plaid"}
}
},
{
"name": "comment.block.plaid",
"begin": "/\\*",
"end": "\\*/"
},
{
"name": "comment.block.empty.plaid",
"match": "/\\*\\*/"
},
{
"name": "comment.line.plaid",
"match": "^\\s*//.*$"
},
{
"name": "lambda.plaid",
"begin": "(fn)\\s*\\(",
"beginCaptures": {
"1": { "name": "keyword.source.plaid" }
},
"patterns": [
{ "include": "#parameters" }
],
"end": "\\)"
},
{
"name": "method.plaid",
"begin": "(method)\\s+((\\w+|->|\\(\\))\\s+)*(\\w+)\\s*\\(",
"beginCaptures": {
"1": { "name": "keyword.source.plaid" },
"2": { "name": "storage.type.plaid" },
"3": { "name": "storage.type.plaid" },
"4": { "name": "entity.name.function"}
},
"patterns": [
{ "include": "#parameters" }
],
"end": "\\)"
},
{
"name": "bad.string.plaid",
"match": "^[^\"]*(\"[^\"]*)$",
"captures": {
"1": { "name": "invalid.string.plaid" }
}
}
],
"repository": {
"parameters": {
"patterns": [
{
"name": "variable.parameter.plaid",
"match": "\\w+"
}
]
}
},
"uuid": "6d4fc1c7-a4de-4139-a070-57413e88e028"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment