~otheb/o-vim

0f2ee8f9f8870b6fddfa02a5b04b9631846997af — Olie Ayre 4 years ago 8f61fb1
Added O project file and O assembly file highlighting.
5 files changed, 45 insertions(+), 1 deletions(-)

A ftdetect/oa.vim
A ftdetect/op.vim
A syntax/oa.vim
M syntax/oc.vim
A syntax/op.vim
A ftdetect/oa.vim => ftdetect/oa.vim +1 -0
@@ 0,0 1,1 @@
au BufNewFile,BufRead *.oa setfiletype oa

A ftdetect/op.vim => ftdetect/op.vim +1 -0
@@ 0,0 1,1 @@
au BufNewFile,BufRead *.op setfiletype op

A syntax/oa.vim => syntax/oa.vim +32 -0
@@ 0,0 1,32 @@
" O ASM vim syntax highlighting

if exists("b:current_syntax")
	finish
endif

" sections
syntax keyword Label .exec .data

" labels
syntax match Label "\v[a-zA-Z0-9!<>(){}.]+:"
syntax match oaGoto "\v[a-zA-Z0-9!<>(){}.]+"
hi def link oaGoto Label

" values
syntax region String start=/\v"/ end=/\v"/ contains=oaEscape
syntax match oaEscape "\v\\['"{}\\nrt]" contained
syntax match oaEscape "\v\\x[a-fA-F0-9]{2}" contained
syntax match oaEscape "\v\\u[a-fA-F0-9]{4}" contained
syntax match oaEscape "\v\\U[a-fA-F0-9]{8}" contained
hi def link oaEscape SpecialChar

" instructions
syntax keyword Identifier popn shuf dupn yank rev ldc anew new get set sys \
                          nextgroup=Number
syntax keyword Identifier ifgt ifge ifle iflt ifeq gto nextgroup=oaGoto
syntax keyword Identifier nop pop swap dup add sub mul div mod inv inc dec and \
                          or xor toi8 toi16 toi32 toi64 tou8 tou16 tou32 tou64 \
                          tof tod top toB send pull free aget aset adel alget \
                          alset arot ajoin exit abort

let b:current_syntax = "oa"

M syntax/oc.vim => syntax/oc.vim +1 -1
@@ 61,4 61,4 @@ syntax keyword Type var fn void
syntax match Comment "\v//.*$"
syntax match SpecialComment "\v///.*$"

let b:current_syntax = "olang"
let b:current_syntax = "oc"

A syntax/op.vim => syntax/op.vim +10 -0
@@ 0,0 1,10 @@
" O vim syntax highlighting

if exists("b:current_syntax")
	finish
endif

" based on the ini filetype
runtime! syntax/dosini.vim

let b:current_syntax = "op"