Loading files
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Filament",
"patterns": [
{
"include": "#toplevel-keywords"
},
{
"include": "#control"
},
{
"include": "#strings"
},
{
"include": "#numeric-literals"
},
{
"include": "#comments"
},
{
"include": "#ports"
}
],
"repository": {
"toplevel-keywords": {
"patterns": [
{
"name": "entity.name.tag.event-var",
"match": "'\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b"
},
{
"match": "\\b(comp)\\b\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.operator.new"
},
"2": {
"name": "support.class"
}
}
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s*:\\s*\\b([^,]+)\\b,",
"captures": {
"1": {
"name": "entity.name.function.port"
},
"2": {
"name": "constant.numeric.port-width"
}
}
},
{
"name": "support.function",
"match": "\\b(import|extern)\\b"
},
{
"name": "keyword.control.filament",
"match": "\\b(with|where|for|if|else|assume|assert)\\b"
},
{
"match": "\\b(exists)\\b\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.control.filament"
},
"2": {
"name": "constant.numeric.parameter"
}
}
}
]
},
"control": {
"patterns": [
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b::\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "storage.type.annotation"
},
"2": {
"name": "constant.numeric.parameter"
}
}
},
{
"match": "\\b(bundle)\\b\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.control.filament"
},
"2": {
"name": "support.class"
}
}
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s+:=\\s+\\b(new)\\b\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "storage.type.annotation"
},
"2": {
"name": "keyword.other"
},
"3": {
"name": "support.class"
}
}
},
{
"match": "\\b(let)\\b\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.other"
},
"2": {
"name": "constant.numeric.param-width"
}
}
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b\\s+:=\\s+\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "string.jade"
},
"2": {
"name": "storage.type.annotation"
}
}
},
{
"begin": "((interface)?)\\[",
"end": "\\]",
"beginCaptures": {
"1": {
"name": "entity.other.attribute-name.interval"
}
},
"patterns": [
{
"name": "entity.name.tag.event-var",
"match": "'\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b"
},
{
"name": "constant.numeric.event-incr",
"match": "\\b(\\d+)\\b"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "constant.numeric.param-width"
}
}
}
]
},
{
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"name": "constant.numeric.parameter",
"match": "\\b(\\d+)\\b"
},
{
"name": "constant.numeric.parameter",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b"
}
]
},
{
"begin": "<",
"end": "\n|>",
"patterns": [
{
"name": "entity.name.tag",
"match": "'\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b"
},
{
"name": "constant.numeric",
"match": "\\b(\\d+)\\b"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "constant.numeric.param-width"
}
}
}
]
}
]
},
"strings": {
"name": "string.quoted.double.filament",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.filament",
"match": "\\\\."
}
]
},
"numeric-literals": {
"patterns": [
{
"name": "constant.numeric",
"match": "\\b(\\d+)\\b"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.filament",
"match": "//.*\n"
},
{
"name": "comment.block",
"begin": "/\\*",
"end": "\\*/"
}
]
},
"ports": {
"patterns": [
{
"match": "\\b(clk|reset)\\b",
"name": "entity.name.special-port"
},
{
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*).\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "string.jade.instance"
},
"2": {
"name": "entity.name.function.port"
}
}
},
{
"name": "entity.name.function",
"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b"
}
]
}
},
"scopeName": "source.filament"
}8c85c67fdThis file is pinned to the selected release. Download the original to open it in your design tool.