Comments (8)
{
"name": "tcl",
"scopeName": "source.tcl",
"fileTypes": [
"tcl",
"xdc",
"sdc",
"fdc"
],
"uuid": "45aff42e-4fcd-4717-829b-4cdaf9d707aa",
"variables": null,
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.tcl"
}
},
"match": "(?<=^|[\[{;])\s*(if|while|for|catch|default|return|break|continue|switch|exit|foreach|try|throw)\b"
},
{
"include": "#comment"
},
{
"include": "#command"
}
],
"repository": {
"comment": {
"patterns": [
{
"name": "comment.line.tcl",
"match": "\s*\#.+"
}
]
},
"command": {
"patterns": [
{
"include": "#tcl_commands"
},
{
"include": "#default_command"
}
]
},
"expression": {
"patterns": [
{
"include": "#variable"
},
{
"include": "#brackets"
},
{
"name": "constant.numeric.tcl",
"match": "(?:0(?:x|o|b))?\d+(?!\.)"
},
{
"name": "constant.numeric.tcl",
"match": "\d+\.(?:\d+(?:[eE][+-]?\d+)?)?"
},
{
"name": "keyword.operator.tcl",
"match": "(?:\+|\-|\~|\!|\\|\|\%|\<\<|\>\>|\<\=|\>\=|\<|\>|\=\=|\!\=|eq|ne|in|ni|\&\&|\&|\|\||\||\^|\?|\:)"
}
]
},
"double_quotes": {
"patterns": [
{
"name": "string.quoted.double.tcl",
"begin": """,
"end": """,
"patterns": [
{
"include": "#variable"
}
]
}
]
},
"variable": {
"patterns": [
{
"begin": "(\$(?:(?:\:\:)?[a-zA-Z0-9_]+))\(",
"beginCaptures": {
"1": {
"name": "variable.other.tcl"
}
},
"end": "\)",
"patterns": [
{
"include": "#brackets"
},
{
"include": "#variable"
}
]
},
{
"name": "variable.other.tcl",
"match": "\$(?:(?:\:\:)?[a-zA-Z0-9_]+)"
},
{
"name": "variable.other.tcl",
"begin": "\$\{",
"end": "\}"
}
]
},
"braces": {
"patterns": [
{
"begin": "\{",
"end": "\}",
"patterns": [
{
"include": "#braces"
}
]
}
]
},
"tcl_braces": {
"patterns": [
{
"begin": "\{",
"end": "\}",
"patterns": [
{
"include": "#comment"
},
{
"include": "#command"
}
]
}
]
},
"expr_braces": {
"patterns": [
{
"begin": "\{",
"end": "\}",
"patterns": [
{
"include": "#expression"
}
]
}
]
},
"brackets": {
"patterns": [
{
"begin": "\[",
"end": "\]",
"patterns": [
{
"include": "#comment"
},
{
"include": "#command"
}
]
}
]
},
"proc": {
"patterns": [
{
"name": "meta.command.proc.tcl",
"begin": "(proc)",
"beginCaptures": {
"1": {
"name": "storage.type.function.tcl"
}
},
"end": "(?:(;)|(?=\})|(?=\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"match": "(?:"([^\"]+)"|\{([^}]+)\}|([^\\{\\\"\\s]+)\b)\s(?:"([^\"]+)"|\{([^}]+)\}|([^\\{\\\"\\s]+)\b)",
"captures": {
"1": {
"name": "entity.name.function.tcl"
},
"2": {
"name": "entity.name.function.tcl"
},
"3": {
"name": "entity.name.function.tcl"
},
"4": {
"name": "variable.parameter.tcl"
},
"5": {
"name": "variable.parameter.tcl"
},
"6": {
"name": "variable.parameter.tcl"
}
}
},
{
"include": "#double_quotes"
},
{
"include": "#brackets"
},
{
"include": "#tcl_braces"
}
]
}
]
},
"for": {
"patterns": [
{
"name": "meta.command.for.tcl",
"begin": "(for)",
"beginCaptures": {
"1": {
"name": "keyword.control.for.tcl"
}
},
"end": "(?:(;)|(?=\})|(?=\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"begin": "(?=\{)(?=(?:.+?\{){3})",
"end": "(?<=\})",
"patterns": [
{
"include": "#tcl_braces"
}
]
},
{
"begin": "(?=\{)(?=(?:.+?\{){2})",
"end": "(?<=\})",
"patterns": [
{
"include": "#expr_braces"
}
]
},
{
"begin": "(?=\{)(?=(?:.+?\{){1})",
"end": "(?<=\})",
"patterns": [
{
"include": "#tcl_braces"
}
]
},
{
"begin": "(?=\{)",
"end": "(?<=\})",
"patterns": [
{
"include": "#tcl_braces"
}
]
},
{
"include": "#brackets"
},
{
"include": "#braces"
}
]
}
]
},
"if": {
"patterns": [
{
"name": "meta.command.for.tcl",
"begin": "(if)",
"beginCaptures": {
"1": {
"name": "keyword.control.if.tcl"
}
},
"end": "(?:(;)|(?=\})|(?=\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"begin": "(?=\{)(?=(?:.+?\{))",
"end": "(?<=\})",
"patterns": [
{
"include": "#expr_braces"
}
]
},
{
"begin": "(?=\{)",
"end": "(?<=\})",
"patterns": [
{
"include": "#tcl_braces"
}
]
},
{
"include": "#brackets"
},
{
"include": "#braces"
}
]
}
]
},
"expr": {
"patterns": [
{
"name": "meta.command.expr.tcl",
"begin": "(expr)",
"beginCaptures": {
"1": {
"name": "support.function.expr.tcl"
}
},
"end": "(?:(;)|(?=\})|(?=\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"include": "#expr_braces"
},
{
"include": "#expression"
}
]
}
]
},
"default_command": {
"patterns": [
{
"begin": "(\S+)",
"beginCaptures": {
"1": {
"name": "entity.name.function.tcl"
}
},
"end": "(?:(;)|(?=\})|(?=\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"include": "#variable"
},
{
"include": "#double_quotes"
},
{
"include": "#brackets"
},
{
"include": "#braces"
}
]
}
]
},
"tcl_commands": {
"patterns": [
{
"include": "#proc"
},
{
"include": "#for"
},
{
"include": "#foreach"
},
{
"include": "#if"
},
{
"include": "#expr"
}
]
}
}
}
from digital-ide.
You can try changing the Tcl.json file to the above configuration
from digital-ide.
You can try changing the Tcl.json file to the above configuration
I have fixed the escape characters and tested. It is not working again, since the "foreach":
entry is missing under "repository":
. I do not know how to define the pattern characters for a new command.
from digital-ide.
@Bestduan, we need something like this, but it is not correct. Can you fix please?
"foreach": {
"patterns": [
{
"name": "meta.command.foreach.tcl",
"begin": "(foreach)",
"beginCaptures": {
"1": {
"name": "keyword.control.foreach.tcl"
}
},
"end": "(?:(;)|(?=\\})|(?=\\])|$)",
"endCaptures": {
"1": {
"name": "punctuation.end.semicolon.tcl"
}
},
"patterns": [
{
"begin": "(?=\\{)(?=(?:.+?\\{))",
"end": "(?<=\\})",
"patterns": [
{
"include": "#expr_braces"
}
]
},
{
"begin": "(?=\\{)",
"end": "(?<=\\})",
"patterns": [
{
"include": "#tcl_braces"
}
]
},
{
"include": "#brackets"
},
{
"include": "#braces"
}
]
}
]
},
from digital-ide.
I have tried to fix it in the way you mentioned, but again it doesn't work, so I have added the following code to patterns so that we can highlight foreach. I am not familiar with the highlight grammar itself, and I just refer to the relevant design for reference.
{
"captures": {
"1": {
"name": "keyword.control.tcl"
}
},
"match": "(?<=^|[\[{;])\s*(if|while|for|catch|default|return|break|continue|switch|exit|foreach|try|throw)\b"
},
from digital-ide.
Then we can probably wait for a feedback from:
go2sh/tcl-language-support#2
Thanks for the support. ❤️
from digital-ide.
Hi, i fixed some of the highlighting especially foreach while for if/else break continue and some dict functions. Next step is to add try/trap/finally switch exit throw and lmap.
from digital-ide.
This issue has been addressed in the new version
from digital-ide.
Related Issues (20)
- verilog module 是否支持数组输入?
- 不支持 .svh 头文件识别? HOT 1
- systemverilog语法识别问题 HOT 1
- 关于在多个.v文件的补全
- Architecture 中无法识别ip文件夹中的ip
- 使用generate批量例化的模块层级关系在architecture中无法正确地被识别 HOT 1
- 自动例化对于没有写在head的变量不
- 使用时自动补全功能消失。
- 10个月没更新,是关闭项目了吗
- I hope to designate the top-level design file within the configuration profile.
- 宏 误报错
- 找不到修改testbench模板的命令
- 中文README404,仅剩知乎版本
- 使用生成property.json的命令时,报错找不到这个命令 HOT 1
- 仿真时报错error: Unknown module type HOT 1
- how to deal the command not find
- 请问是否会加入Vivado TCL自动补全+纠错功能
- 在插件中使用vivado仿真波形无变化
- 未来是否会支持任意形式下全文件夹内的文件都可以解析
- 用MYHDL生成的VCD文件,用插件查看波形时有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digital-ide.