From 4f4daa1fed77d25f9922ed33e7ca2c1374ee1eaa Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Sun, 22 Dec 2024 12:56:31 +0100 Subject: [PATCH] fix(syntax): add missing keywords, change the order, update names, fix comments & operators --- syntax/jule.vim | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/syntax/jule.vim b/syntax/jule.vim index 7880d8b..bebbfd6 100644 --- a/syntax/jule.vim +++ b/syntax/jule.vim @@ -8,35 +8,34 @@ if exists("b:current_syntax") finish endif -syntax keyword juleKeyword map error use fn pub struct byte rune enum unsafe -syntax keyword juleKeyword const let static mut self match defer if else for in -syntax keyword juleKeyword impl trait break continue goto cpp -syntax keyword juleKeyword i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 str +syntax match juleDirective "#\p\+\>" -syntax keyword juleStorage let static const mut pub self +syntax keyword juleKeyword chan map error use fn pub struct byte rune enum unsafe +syntax keyword juleKeyword const let static match defer if else for in impl trait +syntax keyword juleKeyword break continue goto cpp i8 i16 i32 i64 u8 u16 u32 u64 +syntax keyword juleKeyword f32 f64 str int uint type any bool ret fall unitptr co +syntax keyword juleKeyword let +syntax keyword juleStorage static const mut pub self syntax keyword juleConstant true false nil +syntax match juleFunction "\<\k\+\ze(" + syntax match juleNumber "\<\d\+\(_\?\d\+\)*\>" syntax match juleFloat "\<\d\+\(_\?\d\+\)*\.\d\+\([eE][-+]\?\d\+\)\?" syntax match juleBinary "\<0b[01]\+\(_\?[01]\+\)*\>" syntax match juleOctal "\<0o[0-7]\+\(_\?[0-7]\+\)*\>" syntax match juleHex "\<0x[0-9a-fA-F]\+\(_\?[0-9a-fA-F]\+\)*\>" -syntax region juleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=juleEscape -syntax region juleRawString start=+`+ end=+`+ -syntax region juleChar start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=juleEscape +syntax region juleStringS start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=juleEscape +syntax region juleStringD start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=juleEscape +syntax region juleStringRaw start=+`+ end=+`+ syntax match juleEscape display contained "\\[abfnrtv'\"\\]" +syntax region juleLineComment start="//" end="$" contains=@Spell syntax region juleComment start="/\*" end="\*/" contains=@Spell -syntax region juleDocComment start="/\*" end="\*/" contains=@Spell -syntax match juleLineComment "//.*$" contains=@Spell - -syntax match juleDirective "#\p\+\>" - -syntax match juleFunction "\<\k\+\ze(" -syntax match juleOperator "\(+\|-\|*\|/\|%\|++\|--\|>>\|<<\)" +syntax match juleOperator "\(+\|-\|*\|/\|%\|++\|--\|>>\|<<\)" contains=juleLineComment,juleComment syntax match juleOperator "\(==\|!=\|>\|<\|>=\|<=\)" syntax match juleOperator "\(=\|+=\|-=\|*=\|/=\|%=\|&=\||=\|\^=\|>>=\|<<=\)" syntax match juleOperator "\(&\||\|\^\)" @@ -44,23 +43,22 @@ syntax match juleOperator "\(&&\|||\|!\)" syntax match juleDelimiter "[.,;:]" +highlight default link juleDirective PreProc highlight default link juleKeyword Keyword highlight default link juleStorage StorageClass highlight default link juleConstant Constant +highlight default link juleFunction Function highlight default link juleNumber Number highlight default link juleFloat Float highlight default link juleBinary Number highlight default link juleOctal Number highlight default link juleHex Number -highlight default link juleString String -highlight default link juleRawString String -highlight default link juleChar Character +highlight default link juleStringS String +highlight default link juleStringD String +highlight default link juleStringRaw String highlight default link juleEscape SpecialChar -highlight default link juleComment Comment -highlight default link juleDocComment Comment highlight default link juleLineComment Comment -highlight default link juleDirective PreProc -highlight default link juleFunction Function +highlight default link juleComment Comment highlight default link juleOperator Operator highlight default link juleDelimiter Delimiter