vim: add support for ivy assembly language
This commit is contained in:
0
ivy.vim/autoload/ivyasm.vim
Executable file
0
ivy.vim/autoload/ivyasm.vim
Executable file
@@ -1 +1,2 @@
|
||||
autocmd BufNewFile,BufRead *.im setfiletype ivy
|
||||
autocmd BufNewFile,BufRead *.iasm setfiletype ivyasm
|
||||
|
||||
0
ivy.vim/ftdetect/ivyasm.vim
Executable file
0
ivy.vim/ftdetect/ivyasm.vim
Executable file
4
ivy.vim/ftplugin/ivyasm.vim
Executable file
4
ivy.vim/ftplugin/ivyasm.vim
Executable file
@@ -0,0 +1,4 @@
|
||||
setlocal tabstop=8
|
||||
setlocal softtabstop=8
|
||||
setlocal shiftwidth=8
|
||||
setlocal noexpandtab
|
||||
74
ivy.vim/syntax/ivyasm.vim
Executable file
74
ivy.vim/syntax/ivyasm.vim
Executable file
@@ -0,0 +1,74 @@
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
setlocal iskeyword+=@-@
|
||||
setlocal iskeyword+=.
|
||||
syn keyword ivyasmUnspecifiedStatement @end @lambda @class @msgh @use @constpool @selector @ident
|
||||
syn keyword ivyasmInstruction ldr str ret ret.n
|
||||
syn match ivyasmRegister "x[0-9]"
|
||||
syn match ivyasmRegister "x[1-9][0-9]"
|
||||
syn keyword ivyasmIndexBase self bp sp
|
||||
|
||||
syn match ivyasmFieldIndex /#[0-9]\+:\>/
|
||||
syn match ivyasmFieldIndex /#-[0-9]\+:\>/
|
||||
syn match ivyasmFieldIndex /#0x[:xdigit:]\+:\>/
|
||||
syn match ivyasmFieldIndex /#-0x[:xdigit:]\+:\>/
|
||||
|
||||
syn region ivyasmString matchgroup=ivyQuote start=+"+ end=+"\%(u8\)\=+ end=+$+ extend
|
||||
|
||||
syn match ivyasmInteger /#[0-9]\+\>/
|
||||
syn match ivyasmInteger /#-[0-9]\+\>/
|
||||
syn match ivyasmInteger /#0x[:xdigit:]\+\>/
|
||||
syn match ivyasmInteger /#-0x[:xdigit:]\+\>/
|
||||
|
||||
syn match ivyasmPropertyName /\($\s*\)\@<=[a-zA-Z_][A-Za-z0-9_]*/
|
||||
syn match ivyasmFieldName /\(#[0-9]\+:\s\)\@<=[a-zA-Z_][A-Za-z0-9_]*\>/
|
||||
|
||||
syn match ivyasmClassName /\(@msgh (\)\@<=\([A-Za-z_][A-Za-z0-9_]*\)\(.\([A-Za-z_][A-Za-z0-9_]*\)\)*\()\)\@=\>/
|
||||
syn match ivyasmClassName /\(@class (\)\@<=\([A-Za-z_][A-Za-z0-9_]*\)\(.\([A-Za-z_][A-Za-z0-9_]*\)\)*\()\)\@=\>/
|
||||
syn match ivyasmLambdaName /\(@lambda (\)\@<=\([A-Za-z_][A-Za-z0-9_]*\)\()\)\@=\>/
|
||||
|
||||
syn match ivyasmFieldIndex /#-[0-9]\+:\>/
|
||||
syn match ivyasmFieldIndex /#0x[:xdigit:]\+:\>/
|
||||
syn match ivyasmFieldIndex /#-0x[:xdigit:]\+:\>/
|
||||
|
||||
syn match ivyasmSelectorLabel /\<[a-z_]\([A-Za-z0-9_]*\)\:/
|
||||
|
||||
syn match ivyasmBrackets "[[\]]" display
|
||||
syn match ivyasmParens "[()]" display
|
||||
syn match ivyPropertySymbol "\$" display
|
||||
|
||||
" The default highlighting.
|
||||
hi def link ivyasmUnspecifiedStatement Statement
|
||||
hi def link ivyPropertySymbol Statement
|
||||
|
||||
hi def link ivyasmInteger Number
|
||||
hi def link ivyasmFieldIndex Tag
|
||||
|
||||
hi def link ivyasmParens Delimiter
|
||||
hi def link ivyasmBraces Structure
|
||||
|
||||
hi def link ivyasmPropertyName @property
|
||||
hi def link ivyasmFieldName @variable.parameter
|
||||
hi def link ivyasmClassName Type
|
||||
hi def link ivyasmLambdaName @variable.parameter
|
||||
|
||||
hi def link ivyasmInstruction Identifier
|
||||
hi def link ivyasmIndexBase @variable.builtin
|
||||
hi def link ivyasmRegister Constant
|
||||
|
||||
hi def link ivyasmSelectorLabel Label
|
||||
|
||||
hi def link ivyasmString String
|
||||
|
||||
|
||||
let b:current_syntax = 'ivyasm'
|
||||
|
||||
let &cpoptions = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: vts=16,28;ech
|
||||
Reference in New Issue
Block a user