vim: add gaybuild syntax file
This is sort of half-finished and probably full of bugs, but it works for the most part. At least it's nicer to look at than blank text.
This commit is contained in:
parent
de42513728
commit
54a21f9121
1 changed files with 63 additions and 0 deletions
63
vim/syntax/gaybuild.vim
Normal file
63
vim/syntax/gaybuild.vim
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: gaybuild
|
||||||
|
" Maintainer: anna <owo@fef.moe>
|
||||||
|
" Latest Revision: 29 August 2022
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn match gaybuildLink contained '\vhttps?\:\/\/([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z0-9\-]+\.?(:[1-9][0-9]*)?(\/[^/!"#? \t]*)*(\?[a-zA-T0-9_]+(\=[^/!"#? \t]*))?(#[^/!"#?\. \t]*)?'
|
||||||
|
hi def link gaybuildLink Underlined
|
||||||
|
syn keyword gaybuildTodo contained TODO FIXME XXX NOTE WARNING ATTENTION
|
||||||
|
hi def link gaybuildTodo Todo
|
||||||
|
syn match gaybuildComment '#.*$' contains=gaybuildTodo,gaybuildLink
|
||||||
|
hi def link gaybuildComment Comment
|
||||||
|
|
||||||
|
syn match gaybuildStringEsc contained '\\.'
|
||||||
|
hi def link gaybuildStringEsc SpecialChar
|
||||||
|
syn region gaybuildString start='"' skip=/\\./ end='"' contains=gaybuildStringEsc
|
||||||
|
hi def link gaybuildString String
|
||||||
|
|
||||||
|
syn match gaybuildIdent '[a-zA-Z_][a-zA-Z0-9_]*'
|
||||||
|
hi def link gaybuildIdent Identifier
|
||||||
|
|
||||||
|
syn match gaybuildFnName '[a-zA-Z_][a-zA-Z0-9_]*('he=e-1,me=e-1
|
||||||
|
hi def link gaybuildFnName Function
|
||||||
|
|
||||||
|
syn match gaybuildOperator '\v[=+\-*/]\=?'
|
||||||
|
syn match gaybuildOperator '\v\<\<?\=?'
|
||||||
|
syn match gaybuildOperator '\v\>\>?\=?'
|
||||||
|
syn match gaybuildOperator '\v\|[|\=]?'
|
||||||
|
syn match gaybuildOperator '\v\&[&\=]?'
|
||||||
|
syn match gaybuildOperator '\v\^\=?'
|
||||||
|
hi def link gaybuildOperator Operator
|
||||||
|
|
||||||
|
syn match gaybuildNumberErr '0[0-9]+'
|
||||||
|
hi def link gaybuildNumberErr Error
|
||||||
|
|
||||||
|
syn match gaybuildNumber '\v0[^\0-9]|$'
|
||||||
|
syn match gaybuildNumber '0x[0-9a-fA-F]+'
|
||||||
|
syn match gaybuildNumber '0o[0-7]+'
|
||||||
|
syn match gaybuildNumber '0b[01]+'
|
||||||
|
syn match gaybuildNumber '[1-9][0-9]*'
|
||||||
|
hi def link gaybuildNumber Number
|
||||||
|
|
||||||
|
syn keyword gaybuildLoopKeyword for while
|
||||||
|
hi def link gaybuildLoopKeyword Repeat
|
||||||
|
|
||||||
|
syn keyword gaybuildCondKeyword if else
|
||||||
|
hi def link gaybuildCondKeyword Conditional
|
||||||
|
|
||||||
|
syn keyword gaybuildKeyword break depend fn include return set source target type var
|
||||||
|
hi def link gaybuildKeyword Statement
|
||||||
|
|
||||||
|
syn keyword gaybuildBool true false
|
||||||
|
hi def link gaybuildBool Boolean
|
||||||
|
|
||||||
|
syn region gaybuildParens start='(' end=')' fold transparent
|
||||||
|
syn region gaybuildBlock start='{' end='}' fold transparent
|
||||||
|
|
||||||
|
let b:current_syntax = 'gaybuild'
|
||||||
|
|
||||||
|
" vim: set et sw=4 sts=4 ts=8:
|
Loading…
Reference in a new issue