- Bit operators & | ^ ~ << >> and their op= forms (Go precedence),
plus hex, binary and octal literals (0xff, 0b1010, 0o755)
- defer stmt / defer { ... }: runs when the block ends, last first,
also on return, ?, break and continue
- List methods insert, remove, clear, contains, index_of, reverse,
sort and sort_by (stable merge sort)
- rand module: int(a, b), float(), seed(n)
- assert(cond[, msg]) and `rex test`, which runs each test_ function
in its own process
- rex.toml marks a project's top folder: imports count from there
- Docs, formatter, LSP completions and editor grammars updated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
38 lines
1.6 KiB
VimL
38 lines
1.6 KiB
VimL
" Vim / Neovim syntax highlighting for Rex
|
|
if exists("b:current_syntax")
|
|
finish
|
|
endif
|
|
|
|
syn keyword rexControl if else for in step match return break continue defer
|
|
syn keyword rexDeclare func var const import struct enum interface pub
|
|
syn keyword rexModifier shared weak
|
|
syn keyword rexConstant true false nil
|
|
syn keyword rexType int float bool char string error map i8 i16 i32 i64 u8 u16 u32 u64 f32 f64
|
|
syn match rexTypeName "\<[A-Z][A-Za-z0-9_]*\>"
|
|
syn match rexNumber "\<\(0[xX][0-9a-fA-F_]\+\|0[bB][01_]\+\|0[oO][0-7_]\+\|[0-9][0-9_]*\(\.[0-9][0-9_]*\)\?\)\>"
|
|
syn match rexCall "\<[a-z_][A-Za-z0-9_]*\ze\s*("
|
|
syn match rexOperator "=>\|\.\.\|==\|!=\|<<=\=\|>>=\=\|<=\|>=\|&&\|||\|[-+*/%&|^]=\?\|[<>!?=~]"
|
|
syn match rexEscape "\\." contained
|
|
syn region rexInterp matchgroup=rexInterpEdge start="{" end="}" contained contains=TOP
|
|
syn region rexString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rexEscape,rexInterp
|
|
syn match rexChar "'\(\\.\|[^'\\]\)'"
|
|
syn region rexComment start="/\*" end="\*/"
|
|
syn match rexComment "//.*$"
|
|
|
|
hi def link rexControl Conditional
|
|
hi def link rexDeclare Keyword
|
|
hi def link rexModifier StorageClass
|
|
hi def link rexConstant Constant
|
|
hi def link rexType Type
|
|
hi def link rexTypeName Type
|
|
hi def link rexNumber Number
|
|
hi def link rexCall Function
|
|
hi def link rexOperator Operator
|
|
hi def link rexEscape SpecialChar
|
|
hi def link rexInterpEdge Delimiter
|
|
hi def link rexString String
|
|
hi def link rexChar Character
|
|
hi def link rexComment Comment
|
|
|
|
let b:current_syntax = "rex"
|