https://github.com/dash-os/atom-language-dashtcl
Atom Syntax Grammars for Tcl/Tk 8.6.6
https://github.com/dash-os/atom-language-dashtcl
Last synced: 5 months ago
JSON representation
Atom Syntax Grammars for Tcl/Tk 8.6.6
- Host: GitHub
- URL: https://github.com/dash-os/atom-language-dashtcl
- Owner: Dash-OS
- Created: 2017-08-03T19:49:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-29T17:45:51.000Z (over 8 years ago)
- Last Synced: 2025-05-24T23:41:08.024Z (about 1 year ago)
- Homepage:
- Size: 82 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Tcl 8.6.6 Enhanced Grammars
This is an enhanced grammar adding an extensive amount of command-specific
highlighting for Tcl. This is far from completed and may exhibit odd
behavior at certain points but many of the core commands are handled
properly.
This is currently a work in progress and is missing some core handling
and commands. We are currently adding and building to it as we encounter
issues with the highlighting while moving our projects to atom editor.
> Pull requests are more than welcome. At the moment there are various scopes that
> need refinements as we perfect the expression handling, etc.

## Comment Syntax

This grammar supports annotating within "multi-line-comments". Tcl does not officially have a multi-line comment, however using `if 0 {}` is generally a way to accomplish this.
We personally use `% {}` so it is currently expecting either of those to be multi-line.
It will highlight links. If you also want to be able to click to open them, then you can
install the excellent [Hyperclick](https://atom.io/packages/hyperclick) package along with
the [hyperlink-hyperclick](https://atom.io/packages/hyperlink-hyperclick) provider after which
you can open links with a ctrl/cmd + click.
##### $ variables
Variable within annotations are highlighted differently than normal variables
within your code using the "non-substituting-variable" patterns.
```tcl
% { $::my::variable }
```
##### { curly bracket blocks }
When a line starts with an opening curly bracket, it will be given
standard syntax highlighting. This can be useful when providing
examples of calling a proc, etc. These can span multiple lines.

##### prop types
When we want to provide a "type" that a value will be, we can brace it in curly braces.
As long as it is not the first item on a line, it will give it prop type highlighting.
Currently you may add a "?" or "\*" value to indicate a value is required or optional.
###### prop type properties
If we want to provide a type with arguments (such as giving the type of values within a list)
we can add < or > brackets after a types name and add the property within it.`
###### prop types regexp
If we want to use a regular expression syntax w/ regexp highlighting, we can do so by using the
by bracing the type within forward slashes (example: /[0-4]\*/)

##### @ properties
@ properties allow you to dictate values such as properties in a dict, the return
value, and more. You can then include descriptions, types, and whatever else
as desired.
When a "@" is placed and a space is given immediately after, the line will
become a title line which can be terminated with another @ on the same line or
a line break.
Property keys allow defining a value after them and standard highlighting
such as `{$type}` apply as normal.
| Kind | Keys |
|-----|-----|
| Title | @ Comment Title @ |
| Categories | @type |
| Property | @key, @prop, @arg, @args, @returns, @example, @if |
| Misc | @$any |

***and/or***
```tcl
if 0 { @ Cool Title @ }
```
## Extra Command Handling
In addition to the core Tcl commands, the grammar is also being built to
cover many of our ["Tcl Modules"](https://github.com/Dash-OS/tcl-modules) utilities.
#### Tcl State Manager

## Regular Expression Handling
Handles regular expression highlighting when using curly-brackets to enclose
the expressions. This will only work when used directly with the regexp /
regsub commands as it is otherwise impossible to know that the values are
regular expression.
