diff --git a/editor/glint/glint/syntax/glint.vim b/editor/glint/glint/syntax/glint.vim index b34954dd9..8044d364e 100644 --- a/editor/glint/glint/syntax/glint.vim +++ b/editor/glint/glint/syntax/glint.vim @@ -10,10 +10,13 @@ syn region glintRawString start="'" end="'" display syn match glintSpecial contained "\\[nr\\\"\'t]" display syn region glintString start="\"" skip="\\\"" end="\"" contains=glintSpecial +syn region glintByte start="`" skip="\\`" end="`" contains=glintSpecial syn keyword glintFFITypes \ cshort \ cushort + \ csize + \ cusize \ cint \ cuint \ clong @@ -23,15 +26,20 @@ syn keyword glintFFITypes \ void syn keyword glintPrimitiveTypes - \ Bool - \ Boolean - \ Byte + \ byte \ bool \ boolean \ int \ uint \ void +if exists("glint_use_uppercase_primitives") + syn keyword glintPrimitiveTypes + \ Bool + \ Boolean + \ Byte +endif + syn keyword glintDataTypes \ struct \ enum @@ -43,9 +51,18 @@ syn keyword glintKeywords \ return \ sizeof \ match + \ print + \ in + \ mapf + \ lambda + \ has + \ apply + \ typeof + \ template syn keyword glintRepeat \ for + \ cfor \ while syn keyword glintConditional @@ -69,7 +86,26 @@ syn keyword glintFunctionAttributes syn keyword glintTypeAttributes alignas -syn match glintOperators "?\|+\|-\|\*\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|\.\|/\(/\|*\)\@!" +" syn match glintOperators "?\|+\|-\|\*\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|\.\|/\(/\|*\)\@!" +syn match glintOperators "[/*+-\%~&|^<>]=" +syn match glintOperators ":" +syn keyword glintOperators + \ @ + \ ! + \ + + \ - + \ * + \ / + \ & + \ = + \ < + \ > + \ bitand + \ bitor + \ bitxor + \ bitnot + \ ++ + \ -- syn match glintNumber "\v<\d+>" @@ -83,6 +119,10 @@ syn keyword glintSupplant supplant " NOTE: Include semicolon at the end of line? syn match glintModuleName "\<[a-zA-Z0-9_]*" contained skipwhite +syn keyword glintBooleans + \ true + \ false + hi def link glintFFITypes Type hi def link glintPrimitiveTypes Type hi def link glintKeywords Keyword @@ -105,5 +145,9 @@ hi def link glintModuleName Function hi def link glintBuiltinFunc Identifier hi def link glintDataTypes Structure hi def link glintSupplant StorageClass +hi def link glintBooleans Boolean +hi def link glintByte Character let b:current_syntax = 'glint' + +" vim:sw=2 ts=2: