Basic *.cton syntax mode for Vim.

This commit is contained in:
Jakob Stoklund Olesen
2016-09-22 14:07:31 -07:00
parent 65f69fb088
commit 0dd16a360d
2 changed files with 35 additions and 0 deletions

View File

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

34
misc/vim/syntax/cton.vim Normal file
View File

@@ -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"