|
| 1 | +" Vim syntax file |
| 2 | +" Language: ngl |
| 3 | +" Maintainer: Luis Pedro Coelho <[email protected]> |
| 4 | + |
| 5 | +syn case ignore |
| 6 | + |
| 7 | +syn keyword nglKeyword ngless fastq preprocess map write count annotate |
| 8 | +syn keyword nglOperator ? : == != > >= < <= + - % * / |
| 9 | + |
| 10 | +syn match nglFunction "\<[a-zA-Z][a-zA-Z0-9_]*\s*(" contains=nglFunctionName |
| 11 | + |
| 12 | +syn region nglString start=+"+ skip=+\\\\\|\\"+ end=+"+ |
| 13 | +syn region nglString start=+'+ skip=+\\\\\|\\'+ end=+'+ |
| 14 | +syn region nglString start=+`+ skip=+\\\\\|\\`+ end=+`+ |
| 15 | + |
| 16 | +syn match nglSymbol "{[a-zA-Z0-9_]\+}" |
| 17 | + |
| 18 | +" Numbers: |
| 19 | +syn match nglNumber "[-+]\=\(\<\d[[:digit:]_]*L\=\>\|0[xX]\x[[:xdigit:]_]*\>\)" |
| 20 | +syn match nglFloat "[-+]\=\<\d[[:digit:]_]*[eE][\-+]\=\d\+" |
| 21 | +syn match nglFloat "[-+]\=\<\d[[:digit:]_]*\.[[:digit:]_]*\([eE][\-+]\=\d\+\)\=" |
| 22 | +syn match nglFloat "[-+]\=\<\.[[:digit:]_]\+\([eE][\-+]\=\d\+\)\=" |
| 23 | + |
| 24 | +" Comments: |
| 25 | +syn region nglComment start="/\*" end="\*/" contains=nglTodo |
| 26 | +syn match nglComment "//.*$" contains=nglTodo |
| 27 | +syn match nglComment "#.*$" contains=nglTodo |
| 28 | +syn sync ccomment nglComment |
| 29 | + |
| 30 | +" Todo. |
| 31 | +syn keyword nglTodo TODO FIXME XXX DEBUG NOTE contained |
| 32 | + |
| 33 | +" Define the default highlighting. |
| 34 | +" For version 5.7 and earlier: only when not done already |
| 35 | +" For version 5.8 and later: only when an item doesn't have highlighting yet |
| 36 | +if version >= 508 || !exists("did_c_syn_inits") |
| 37 | + if version < 508 |
| 38 | + let did_c_syn_inits = 1 |
| 39 | + command -nargs=+ HiLink hi link <args> |
| 40 | + else |
| 41 | + command -nargs=+ HiLink hi def link <args> |
| 42 | + endif |
| 43 | + |
| 44 | + HiLink nglComment Comment |
| 45 | + HiLink nglOpWord Label |
| 46 | + HiLink nglOperator Operator |
| 47 | + HiLink nglType Type |
| 48 | + HiLink nglSpecial Special |
| 49 | + HiLink nglKeyword Statement |
| 50 | + HiLink nglNumber Number |
| 51 | + HiLink nglFloat Float |
| 52 | + HiLink nglSymbol Constant |
| 53 | + HiLink nglAssignVar Identifier |
| 54 | + HiLink nglString String |
| 55 | + HiLink nglTodo Todo |
| 56 | + |
| 57 | + HiLink nglFunctionName Function |
| 58 | + |
| 59 | + |
| 60 | + delcommand HiLink |
| 61 | +endif |
| 62 | + |
| 63 | +let b:current_syntax = "ngl" |
| 64 | + |
0 commit comments