diff --git a/ivy.vim/autoload/ivyasm.vim b/ivy.vim/autoload/ivy-asm.vim similarity index 100% rename from ivy.vim/autoload/ivyasm.vim rename to ivy.vim/autoload/ivy-asm.vim diff --git a/ivy.vim/ftdetect/ivy-asm.vim b/ivy.vim/ftdetect/ivy-asm.vim new file mode 100755 index 0000000..aade104 --- /dev/null +++ b/ivy.vim/ftdetect/ivy-asm.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.iasm setfiletype ivy-asm diff --git a/ivy.vim/ftdetect/ivy-ir.vim b/ivy.vim/ftdetect/ivy-ir.vim new file mode 100755 index 0000000..19f5779 --- /dev/null +++ b/ivy.vim/ftdetect/ivy-ir.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.ir setfiletype ivy-ir diff --git a/ivy.vim/ftdetect/ivy.vim b/ivy.vim/ftdetect/ivy.vim index f62302b..0ff0b6e 100755 --- a/ivy.vim/ftdetect/ivy.vim +++ b/ivy.vim/ftdetect/ivy.vim @@ -1,2 +1 @@ autocmd BufNewFile,BufRead *.im setfiletype ivy -autocmd BufNewFile,BufRead *.iasm setfiletype ivyasm diff --git a/ivy.vim/ftdetect/ivyasm.vim b/ivy.vim/ftdetect/ivyasm.vim deleted file mode 100755 index e69de29..0000000 diff --git a/ivy.vim/ftplugin/ivyasm.vim b/ivy.vim/ftplugin/ivy-asm.vim similarity index 100% rename from ivy.vim/ftplugin/ivyasm.vim rename to ivy.vim/ftplugin/ivy-asm.vim diff --git a/ivy.vim/ftplugin/ivy-ir.vim b/ivy.vim/ftplugin/ivy-ir.vim new file mode 100755 index 0000000..25eeecd --- /dev/null +++ b/ivy.vim/ftplugin/ivy-ir.vim @@ -0,0 +1,4 @@ +setlocal tabstop=8 +setlocal softtabstop=8 +setlocal shiftwidth=8 +setlocal noexpandtab diff --git a/ivy.vim/syntax/ivyasm.vim b/ivy.vim/syntax/ivy-asm.vim similarity index 98% rename from ivy.vim/syntax/ivyasm.vim rename to ivy.vim/syntax/ivy-asm.vim index b5ee242..d36403b 100755 --- a/ivy.vim/syntax/ivyasm.vim +++ b/ivy.vim/syntax/ivy-asm.vim @@ -85,7 +85,7 @@ hi def link ivyasmLineContinuation ivyasmComment hi def link ivyasmIdent @variable.builtin hi def link ivyasmAtom Constant -let b:current_syntax = 'ivyasm' +let b:current_syntax = 'ivy-asm' let &cpoptions = s:save_cpo unlet s:save_cpo diff --git a/ivy.vim/syntax/ivy-ir.vim b/ivy.vim/syntax/ivy-ir.vim new file mode 100755 index 0000000..e7e669a --- /dev/null +++ b/ivy.vim/syntax/ivy-ir.vim @@ -0,0 +1,82 @@ +if exists('b:current_syntax') + finish +endif + +let s:save_cpo = &cpoptions +set cpoptions&vim + +syn keyword ivyirUnspecifiedStatement record data define +syn keyword ivyirInstruction + \ alloca load store call br cmp + \ c.z c.nz c.eq c.ne c.lt c.le c.gt c.ge + \ br br.t br.f + \ add sub div mul push pop msg +syn match ivyirRegister "%[0-9]\>" +syn match ivyirRegister "%[1-9][0-9]\+\>" +syn match ivyirRegister "%\w\+\>" +syn match ivyirIdentifier /@\(\w\+\)\(\.\(\w\+\)\)*\>/ +syn match ivyirIdentifier /@\.\(\w\+\)\(\.\(\w\+\)\)*\>/ +syn match ivyirLabel /\(\w\+\)\(\.\(\w\+\)\)*\:/ +syn keyword ivyirType id ptr str label +syn match ivyirType "i[0-9]\>" +syn match ivyirType "i[1-9][0-9]\+\>" +syn keyword ivyirBlockType iblock class lambda function + +syn match ivyirFieldIndex /#[0-9]\+:\>/ +syn match ivyirFieldIndex /#-[0-9]\+:\>/ +syn match ivyirFieldIndex /#0x[:xdigit:]\+:\>/ +syn match ivyirFieldIndex /#-0x[:xdigit:]\+:\>/ + +syn region ivyirString start=+"+ end=+"\%(u8\)\=+ end=+$+ extend + +syn match ivyirInteger /#[0-9]\+\>/ +syn match ivyirInteger /#-[0-9]\+\>/ +syn match ivyirInteger /#0x[:xdigit:]\+\>/ +syn match ivyirInteger /#-0x[:xdigit:]\+\>/ + +syn keyword ivyirTodo contained TODO FIXME XXX NOTE HACK TBD +syn region ivyirBlockComment start="/\*" end="\*/" contains=ivyirTodo,ivyirBlockComment +syn match ivyirLineComment ";.*$" contains=ivyirTodo,ivyirBlockComment +syn cluster ivyirComment contains=ivyirLineComment,ivyirBlockComment + +syn match ivyirBrackets "[[\]]" display +syn match ivyirParens "[()]" display +syn match ivyPropertySymbol "\$" display + +" The default highlighting. +hi def link ivyirUnspecifiedStatement Statement +hi def link ivyPropertySymbol Statement + +hi def link ivyirInteger Number + +hi def link ivyirParens Delimiter +hi def link ivyirBraces Structure + +hi def link ivyirPropertyName @property +hi def link ivyirFieldName @variable.parameter +hi def link ivyirClassName Type +hi def link ivyirLambdaName @variable.parameter + +hi def link ivyirInstruction Function +hi def link ivyirIdentifier Identifier +hi def link ivyirLabel Tag +hi def link ivyirIndexBase @variable.builtin +hi def link ivyirRegister Constant + +hi def link ivyirString String +hi def link ivyirType Type +hi def link ivyirBlockType @attribute + +hi def link ivyirComment Comment +hi def link ivyirLineComment ivyirComment +hi def link ivyirBlockComment ivyirComment +hi def link ivyirLineContinuation ivyirComment + +hi def link ivyirIdent @variable.builtin +hi def link ivyirAtom Constant + +let b:current_syntax = 'ivy-ir' + +let &cpoptions = s:save_cpo +unlet s:save_cpo + diff --git a/ivy.vim/syntax/ivy.vim b/ivy.vim/syntax/ivy.vim index 6fbf59f..da44436 100755 --- a/ivy.vim/syntax/ivy.vim +++ b/ivy.vim/syntax/ivy.vim @@ -11,12 +11,12 @@ syn match ivyType /\<[A-Z]\{1,2\}\([a-z0-9]\+[A-Z]\{0, " we have to use syn match for keywords because any keyword can be used as a " label by adding : to the end, and adding : to iskeyword causes more problems " than it solves. -syn match ivyStorage /\(class\|protocol\)\(\:\)\@!/ -syn match ivyRepeat /\(for\|while\|break\|continue\)\(\:\)\@!/ -syn match ivyConditional /\(if\|elif\|else\|unless\|match\)\(\:\)\@!/ -syn match ivyException /\(try\|catch\|finally\|throw\)\(\:\)\@!/ -syn match ivyBuiltinVar /\(error\|cout\|cin\|cerr\)\(\:\)\@!/ -syn match ivyUnspecifiedStatement /\(end\|package\|use\|as\|then\|in\|do\|get\|set\)\(\:\)\@!/ +syn match ivyStorage /\(class\|protocol\)\>\(\:\)\@!/ +syn match ivyRepeat /\(for\|while\|break\|continue\)\>\(\:\)\@!/ +syn match ivyConditional /\(if\|elif\|else\|unless\|match\)\>\(\:\)\@!/ +syn match ivyException /\(try\|catch\|finally\|throw\)\>\(\:\)\@!/ +syn match ivyBuiltinVar /\(error\|cout\|cin\|cerr\)\>\(\:\)\@!/ +syn match ivyUnspecifiedStatement /\(end\|package\|use\|as\|then\|in\|do\|get\|set\)\>\(\:\)\@!/ syn match ivySelectorLabel /\<[a-z][A-Za-z0-9_]*\:/ "syn match ivySelectorLabel /\<\([a-z]\([A-Za-z0-9_]\+\)\:\(\:\)\@!\)\+/