Files
ivy/ivy.vim/syntax/ivy-asm.vim
T

96 lines
3.2 KiB
VimL
Raw Normal View History

2024-11-05 22:16:50 +00:00
if exists('b:current_syntax')
finish
endif
let s:save_cpo = &cpoptions
set cpoptions&vim
setlocal iskeyword+=@-@
setlocal iskeyword+=.
syn keyword ivyasmUnspecifiedStatement
\ @end @class @block @import @constpool @selector
\ @ident @atom @package @property @var @msgh @lambda
2024-12-15 22:37:19 +00:00
syn keyword ivyasmInstruction
\ ldr str ret ret.n
\ 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
2024-11-05 22:16:50 +00:00
syn match ivyasmRegister "x[0-9]"
syn match ivyasmRegister "x[1-9][0-9]"
syn keyword ivyasmIndexBase self bp sp pool
syn match ivyasmLabelRef "\$[a-zA-Z_][a-zA-Z0-9._]*"
2024-11-05 22:16:50 +00:00
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 keyword ivyasmTodo contained TODO FIXME XXX NOTE HACK TBD
syn region ivyasmBlockComment start="/\*" end="\*/" contains=ivyasmTodo,ivyasmBlockComment
syn match ivyasmLineComment ";.*$" contains=ivyasmTodo,ivyasmBlockComment
syn cluster ivyasmComment contains=ivyasmLineComment,ivyasmBlockComment
" syn match ivyasmPropertyName /\($\s*\)\@<=[a-zA-Z_][A-Za-z0-9_]*/
2024-11-05 22:16:50 +00:00
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 ivyasmIdent /\(@ident\(\s\)*\[\)\@<=\([A-Za-z_][A-Za-z0-9_]*\)\(\]\)\@=\>/
syn match ivyasmAtom /\(@atom\(\s\)*\[\)\@<=\([A-Za-z_][A-Za-z0-9_]*\)\(\]\)\@=\>/
2024-11-05 22:16:50 +00:00
syn match ivyasmFieldIndex /#-[0-9]\+:\>/
syn match ivyasmFieldIndex /#0x[:xdigit:]\+:\>/
syn match ivyasmFieldIndex /#-0x[:xdigit:]\+:\>/
syn match ivyasmSelectorLabel /\<[A-Za-z_]\([A-Za-z0-9_]*\)\:/
2024-11-05 22:16:50 +00:00
syn match ivyasmBrackets "[[\]]" display
syn match ivyasmParens "[()]" display
" The default highlighting.
hi def link ivyasmUnspecifiedStatement 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
2024-11-05 22:16:50 +00:00
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 ivyasmLabelRef Label
2024-11-05 22:16:50 +00:00
hi def link ivyasmString String
hi def link ivyasmComment Comment
hi def link ivyasmLineComment ivyasmComment
hi def link ivyasmBlockComment ivyasmComment
hi def link ivyasmLineContinuation ivyasmComment
hi def link ivyasmIdent @variable.builtin
hi def link ivyasmAtom Constant
2024-11-05 22:16:50 +00:00
let b:current_syntax = 'ivy-asm'
2024-11-05 22:16:50 +00:00
let &cpoptions = s:save_cpo
unlet s:save_cpo
" vim: vts=16,28;ech