X-Git-Url: http://nitlanguage.org diff --git a/misc/vim/syntax/nit.vim b/misc/vim/syntax/nit.vim index 18a579a..b5d86ac 100644 --- a/misc/vim/syntax/nit.vim +++ b/misc/vim/syntax/nit.vim @@ -36,8 +36,9 @@ syn match NITExprSubst "{\([^}]\|\n\)*}" contained syn match NITExprSubstLong "\\." contained syn match NITExprSubstLong "{*\zs{{{\([^}]\|\n\)*}}}\ze}*" contained -" Numbers and ASCII Codes -syn match NITNumber "\<\(\d\+\.\d\+\|\d\+\)\>" +" Numbers +syn match NITNumber "\<\([0-9_]\+\|0[bB][01_]\+\|0[oO][0-7_]\+\|0[xX][0-9a-fA-F_]\+\)\([iu]\(8\|16\|32\)\)\?\>" +syn match NITNumber "\<[0-9_]\+\.[0-9_]\+\>" " Identifiers syn match NITClass "\<\u\w*" @@ -87,7 +88,7 @@ syn match NITComment "#.*" contains=NITTodo,@Spell " Keywords syn keyword NITKeyword abstract intern new syn keyword NITDefine private public protected intrude readable writable redef -syn keyword NITControl if while for assert and or in as isa once break continue return abort +syn keyword NITControl if while for with assert and or in as isa once break continue return abort syn keyword NITClass nullable syn keyword NITInclude special syn keyword NITTodo FIXME NOTE TODO XXX contained @@ -131,31 +132,31 @@ hi def link NITFFIDelimiters Keyword " FFI Python syntax include @FFIPython syntax/python.vim unlet b:current_syntax -syn match NITFFILanguage /\c"Python"/ nextgroup=NITFFIBlockPython skipwhite +syn match NITFFILanguage /\c"Python"\ze.*`{/ nextgroup=NITFFIBlockPython skipwhite syn region NITFFIBlockPython matchgroup=NITFFI start='`{' matchgroup=NITFFI end='`}' keepend fold contains=@FFIPython " FFI Java syntax include @FFIJava syntax/java.vim unlet b:current_syntax -syn match NITFFILanguage /\c"Java\(\| inner\)"/ nextgroup=NITFFIBlockJava skipwhite +syn match NITFFILanguage /\c"Java\(\| inner\)"\ze.*`{/ nextgroup=NITFFIBlockJava skipwhite syn region NITFFIBlockJava matchgroup=NITFFI start='`{' matchgroup=NITFFI end='`}' keepend fold contains=@FFIJava " FFI C++ syntax include @FFICpp syntax/cpp.vim unlet b:current_syntax -syn match NITFFILanguage /\c"C++\(\| header\| body\)"/ nextgroup=NITFFIBlockCpp skipwhite +syn match NITFFILanguage /\c"C++\(\| header\| body\)"\ze.*`{/ nextgroup=NITFFIBlockCpp skipwhite syn region NITFFIBlockCpp matchgroup=NITFFI start='`{' matchgroup=NITFFI end='`}' keepend fold contains=@FFICpp " FFI Objective-C syntax include @FFIObjC syntax/objc.vim unlet b:current_syntax -syn match NITFFILanguage /\c"ObjC\(\| Header\| Body\)"/ nextgroup=NITFFIBlockObjC skipwhite +syn match NITFFILanguage /\c"ObjC\(\| Header\| Body\)"\ze.*`{/ nextgroup=NITFFIBlockObjC skipwhite syn region NITFFIBlockObjC matchgroup=NITFFI start='`{' matchgroup=NITFFI end='`}' keepend fold contains=@FFIObjC " FFI C (the last one is the default) syntax include @FFIC syntax/c.vim unlet b:current_syntax -syn match NITFFILanguage /\c"C\(\| header\| body\)"/ nextgroup=NITFFIBlockC skipwhite +syn match NITFFILanguage /\c"C\(\| header\| body\)"\ze.*`{/ nextgroup=NITFFIBlockC skipwhite syn region NITFFIBlockC matchgroup=NITFFI start='`{' matchgroup=NITFFI end='`}' keepend fold contains=@FFIC hi def link NITFFILanguage Define