Last active
September 21, 2018 16:58
-
-
Save 5nizza/4e75380032b3644847aba95e5e2fb71c to your computer and use it in GitHub Desktop.
Syntax file for TLSF SYNTCOMP format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: TLSF | |
" Maintainer: Ayrat Khalimov <[email protected]> | |
" Last change: Sep 20, 2018 | |
" | |
" put this into to your ~/.config/nvim/init.vim | |
" | |
" augroup syntax | |
" au BufRead,BufNewFile,BufNewFile *.tlsf setfiletype tlsf | |
" augroup END | |
" | |
" ... and save this file as ~/.config/nvim/syntax/tlsf.vim ;-) | |
" | |
if exists("b:current_syntax") | |
finish | |
endif | |
" Remove any old syntax stuff hanging around | |
syn clear | |
" keyword definitions | |
syn keyword tlsfKeyword INFO TITLE DESCRIPTION SEMANTICS TARGET TAGS | |
syn keyword tlsfKeyword MAIN INPUTS OUTPUTS INITIALLY PRESET REQUIRE ASSERT ASSUME GUARANTEE | |
syn keyword tlsfKeyword GLOBAL PARAMETERS DEFINITIONS | |
syn keyword tlsfKeyword true false | |
syn keyword tlsfKeyword enum | |
syn keyword tlsfKeyword otherwise | |
" keywords from the old version of tlsf v.1.0 | |
syn keyword tlsfKeyword INVARIANTS ASSUMPTIONS GUARANTEES | |
" Types | |
syn keyword tlsfType Mealy Moore | |
" Operators | |
syn keyword tlsfOperator R U W G F X | |
syn keyword tlsfOperator MIN MAX SIZEOF IN | |
syn match tlsfOperator "-" | |
syn match tlsfOperator "<" | |
syn match tlsfOperator ">" | |
syn match tlsfOperator "->" | |
syn match tlsfOperator "<->" | |
syn match tlsfOperator "!" | |
syn match tlsfOperator "+" | |
syn match tlsfOperator "\*" | |
syn match tlsfOperator "&&" | |
syn match tlsfOperator "||" | |
syn match tlsfOperator "/" | |
syn match tlsfOperator "==" | |
syn match tlsfOperator "<=" | |
syn match tlsfOperator ">=" | |
syn match tlsfOperator "!=" | |
syn match tlsfOperator "%" | |
syn match tlsfOperator ":" | |
" Constants | |
syn match tlsfNumber "\d\+" | |
" Strings | |
syn region tlsfString start='"' end='"' | |
"Comment | |
syn match tlsfComment "//.*" | |
syn region tlsfComment start="/\*" end="\*/" | |
" Catch mismatched parentheses | |
syn region tlsfGeneric transparent start="\[" end="\]" contains=ALLBUT,tlsfBracketError | |
syn region tlsfParen transparent start="(" end=")" contains=ALLBUT,tlsfParenError | |
syn match tlsfParenError ")" | |
syn match tlsfBracketError "]" | |
syn sync lines=10 | |
if !exists("did_tlsf_syntax_inits") | |
let did_tlsf_syntax_inits = 1 | |
" The default methods for highlighting. Can be overridden later. | |
hi link tlsfKeyword Statement | |
hi link tlsfNumber Number | |
hi link tlsfString Constant | |
hi link tlsfOperator Special | |
hi link tlsfComment Comment | |
hi link tlsfType Type | |
hi link tlsfParenError Error | |
hi link tlsfBracketError Error | |
endif | |
let b:current_syntax = "tlsf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment