commit 7f7827f1bc1c4bbcf549a423f16e60f77e5179c6
parent 2456da70e19f28511e348e1702f9815eb25094fe
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 4 Aug 2020 19:23:24 -0400
Update from local hare.vim
Diffstat:
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/syntax/hare.vim b/syntax/hare.vim
@@ -5,8 +5,8 @@ if exists("b:current_syntax")
finish
endif
-syn keyword hareKeyword let const fn def return static export continue break
-syn keyword hareRepeat for while
+syn keyword hareKeyword let const fn def static export bit
+syn keyword hareBranch for while return break continue
syn keyword hareConditional if else match switch
syn keyword hareBuiltin len offset free alloc assert
syn keyword hareOperator is as
@@ -20,25 +20,25 @@ syn region hareString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+
"adapted from c.vim
"integer number, or floating point number without a dot and with "f".
syn case ignore
-syn match hareNumbers display transparent "\<\d\|\.\d" contains=hareNumber,hareFloat,hareOctalError,hareOctal
+syn match hareNumbers display transparent "\<\d" contains=hareNumber,hareOctalError,hareOctal
" Same, but without octal error (for comments)
syn match hareNumbersCom display contained transparent "\<\d\|\.\d" contains=hareNumber,hareFloat,hareOctal
-syn match hareNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+syn match hareNumber display contained "\d\+\([ziu]\d*\)\?\>"
"hex number
-syn match hareNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+syn match hareNumber display contained "0x\x\+\([ziu]\d*\)\?\>"
" Flag the first zero of an octal number as something special
-syn match hareOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=hareOctalZero
+syn match hareOctal display contained "0\o\+\([ziu]\d*\)\?\>" contains=hareOctalZero
syn match hareOctalZero display contained "\<0"
-syn match hareFloat display contained "\d\+f"
+syn match hareFloat display contained "\d\+\(f32\|f64\)"
"floating point number, with dot, optional exponent
-syn match hareFloat display contained "\d\+\.\d+\(e[-+]\=\d\+\)\=[fl]\="
+syn match hareFloat display contained "\d\+\.\d+\(e[-+]\=\d\+\)\=\(f32\|f64\)\="
"floating point number, starting with a dot, optional exponent
-syn match hareFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+syn match hareFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=\(f32\|f64\)\=\>"
"floating point number, without dot, with exponent
-syn match hareFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+syn match hareFloat display contained "\d\+e[-+]\=\d\+\(f32\|f64\)\=\>"
syn keyword hareTodo contained TODO FIXME XXX
-syn region hareComment start="/\*" end="\*/" contains=hareTodo
+syn region hareComment start="/\*" end="\*/" contains=hareTodo extend
syn keyword hareType u8 u16 u32 u64 i8 i16 i32 i64
syn keyword hareType uint int
@@ -49,6 +49,7 @@ syn keyword hareType bool
syn keyword hareType char str
syn keyword hareType void
syn keyword hareType struct union
+syn keyword hareType enum
syn keyword hareType nullable
syn keyword hareNull null
syn keyword hareBoolean true false
@@ -63,7 +64,7 @@ hi def link hareNull Constant
hi def link hareOctal Number
hi def link hareOperator Operator
hi def link harePreProc PreProc
-hi def link hareRepeat Repeat
+hi def link hareBranch Repeat
hi def link hareString String
hi def link hareTodo Todo
hi def link hareType Type