Browse Source

Basic *.cton syntax mode for Vim.

pull/3/head
Jakob Stoklund Olesen 8 years ago
parent
commit
0dd16a360d
  1. 1
      misc/vim/ftdetect/cton.vim
  2. 34
      misc/vim/syntax/cton.vim

1
misc/vim/ftdetect/cton.vim

@ -0,0 +1 @@
au BufRead,BufNewFile *.cton set filetype=cton

34
misc/vim/syntax/cton.vim

@ -0,0 +1,34 @@
" Vim syntax file
" Language: Cretonne
" Maintainer: Jakob Stoklund Olesen <stoklund@2pi.dk
" Last Change: Sep 22, 2016
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn keyword ctonHeader test isa set
syn keyword ctonDecl function stack_slot jump_table
syn keyword ctonFilecheck check sameln nextln unordered not regex contained
syn match ctonType /\<[bif]\d\+\(x\d\+\)\?\>/
syn match ctonEntity /\<\(v\|vx\|ss\|jt\|\)\d\+\>/
syn match ctonLabel /\<ebb\d+\>/
syn match ctonNumber /-\?\<\d\+\>/
syn match ctonNumber /-\?\<0x\x\+\(\.\x*\)\(p[+-]\?\d\+\)\?\>/
syn region ctonCommentLine start=";" end="$" contains=ctonFilecheck
hi def link ctonHeader Keyword
hi def link ctonDecl Keyword
hi def link ctonType Type
hi def link ctonEntity Identifier
hi def link ctonLabel Label
hi def link ctonNumber Number
hi def link ctonCommentLine Comment
hi def link ctonFilecheck SpecialComment
let b:current_syntax = "cton"
Loading…
Cancel
Save