GrADS
GrADS syntax for Sublime Text
Details
Installs
- Total 10
- Win 4
- Mac 2
- Linux 4
| Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
GrADS syntax for Sublime Text
Syntax highlighting and comment toggling for the
GrADS scripting language (.gs / .gsf).
Unlike a docs-driven grammar, the rules here are derived directly from the GrADS
C sources (gscrpt.c, gauser.c, gafunc.c, gaexpr.c, gxchpl.c), which are
the ground truth for what the interpreter actually accepts — the HTML
documentation is incomplete or inaccurate in several places.
Features
- Comments —
*or#at the start of a record (column 0 or right after a;), matching the parser exactly. - Strings — single-line only; an unterminated quote is flagged as an error
(GrADS reports
Non-terminated constant). - Script language — case-insensitive keywords (
if/while/say/…),function/return, the 37 script intrinsics (subwrd,math_*, …). - Compound (array) variables —
_trin.n.1, with the accessor dots and index segments highlighted. - Command strings — case-insensitive command verbs, sub-options, and the 62
built-in grid functions (
ave,maskout,EXP, …). - Implied define —
name = exprshorthand (any case). - Expressions — arithmetic / comparison / logical operators, parentheses and
commas inside
display/define/ implied-define, persisting across concatenated string segments. - Backtick formatting codes — fonts, super/subscript, and the
`3.degree symbol. - Shell escapes —
'!cmd …'is marked as a shell command (uniform scope, persisting across concatenation). - Comment toggling —
Ctrl+/(Cmd+/).
Installation
Package Control (recommended)
- Install Package Control.
- Open the Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) and run Package Control: Install Package. - Search for GrADS and install it.
Manual
Clone or download this repository into your Sublime Text packages folder
(Preferences → Browse Packages…), as a folder named GrADS:
git clone https://github.com/fox91/GrADS-Sublime-syntax.git GrADS
Then open a .gs / .gsf file (or pick View → Syntax → GrADS Script) to
activate it.
Developing
The grammar lives in GrADS.sublime-syntax; scope assignments are covered by
syntax tests in tests/syntax_test_grads.gs.
To run the tests, place the repository in your Sublime Text packages folder as a
folder named GrADS (so the test header's Packages/GrADS/… path resolves),
open tests/syntax_test_grads.gs, and run Tools → Build (Ctrl+B /
Cmd+B). Results appear in the output panel; press F4 to jump to a failure.
The same tests run on every push and pull request via GitHub Actions
(.github/workflows/syntax.yml, using
syntax-test-action).
License
MIT © Andrea Falco