Yinzuo Jiang | 4a7a4a3 | 2024-07-09 19:11:18 +0200 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: ANTLR4, ANother Tool for Language Recognition v4 <www.antlr.org> |
| 3 | " Maintainer: Yinzuo Jiang <jiangyinzuo@foxmail.com> |
| 4 | " Last Change: 2024 July 09 |
| 5 | |
| 6 | " quit when a syntax file was already loaded |
| 7 | if exists("b:current_syntax") |
| 8 | finish |
| 9 | endif |
| 10 | |
| 11 | " Keywords. See https://github.com/antlr/antlr4/blob/4.13.1/doc/lexicon.md |
| 12 | syn keyword antlr4Include import |
| 13 | " https://github.com/antlr/antlr4/blob/4.13.1/doc/options.md |
| 14 | " https://github.com/antlr/antlr4/blob/4.13.1/doc/grammars.md |
| 15 | syn keyword antlr4Structure fragment lexer parser grammar options channels tokens mode |
| 16 | syn keyword antlr4Statement returns locals |
| 17 | syn keyword antlr4Exceptions throws catch finally |
| 18 | |
| 19 | " Comments. |
| 20 | syn keyword antlr4Todo contained TODO FIXME XXX NOTE |
| 21 | syn region antlr4Comment start="//" end="$" contains=antlr4Todo,@Spell |
| 22 | syn region antlr4Comment start="/\*" end="\*/" contains=antlr4Todo,@Spell |
| 23 | |
| 24 | hi def link antlr4Include Include |
| 25 | hi def link antlr4Structure Structure |
| 26 | hi def link antlr4Statement Statement |
| 27 | hi def link antlr4Exceptions Structure |
| 28 | hi def link antlr4Comment Comment |
| 29 | |
| 30 | let b:current_syntax = "antlr4" |