pax_global_header00006660000000000000000000000064151106625740014521gustar00rootroot0000000000000052 comment=cf8e6832c783d571c4645a0a26fc32ead84903bf vim-tomo/000077500000000000000000000000001511066257400126345ustar00rootroot00000000000000vim-tomo/LICENSE000066400000000000000000000020751511066257400136450ustar00rootroot00000000000000MIT License Copyright 2018 Bruce Hill Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. vim-tomo/README.md000066400000000000000000000005311511066257400141120ustar00rootroot00000000000000# Vim Tomo This is a vim plugin for the [Tomo programming language](https://github.com/bruce-hil/tomo). ## Installation Either install with your preferred plugin manager (e.g. `Plug 'bruce-hill/tomo'`) or use Vim's built-int pack system: ``` git clone --depth=1 'https://github.com/bruce-hill/vim-tomo' ~/.vim/pack/syntax/start/vim-tomo ``` vim-tomo/ftdetect/000077500000000000000000000000001511066257400144365ustar00rootroot00000000000000vim-tomo/ftdetect/tomo.vim000066400000000000000000000002151511066257400161270ustar00rootroot00000000000000" Language: Tomo " Maintainer: Bruce Hill " License: WTFPL autocmd BufNewFile,BufRead *.tm set filetype=tomo vim-tomo/ftplugin/000077500000000000000000000000001511066257400144645ustar00rootroot00000000000000vim-tomo/ftplugin/tomo.vim000066400000000000000000000006011511066257400161540ustar00rootroot00000000000000" Language: Tomo " Maintainer: Bruce Hill " License: WTFPL if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal formatoptions-=t setlocal cpoptions+=M setlocal expandtab shiftwidth=4 tabstop=4 setlocal commentstring=#\ %s let b:undo_ftplugin = "setlocal formatoptions< cpoptions< expandtab< shiftwidth< tabstop< commentstring<" vim-tomo/indent/000077500000000000000000000000001511066257400141155ustar00rootroot00000000000000vim-tomo/indent/tomo.vim000066400000000000000000000024151511066257400156120ustar00rootroot00000000000000" Language: Tomo " Maintainer: Bruce Hill " License: WTFPL if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetTomoIndent() setlocal indentkeys+=s " Only define the function once. if exists("*GetTomoIndent") finish endif function! GetTomoIndent() let line = getline(v:lnum) let current_ind = indent(v:lnum) let previousNum = prevnonblank(v:lnum - 1) let prev_line = getline(previousNum) let ind = indent(previousNum) if line =~ '^\s*else$' if prev_line =~ '^\s*else \+if\> .* then .*$' && current_ind == ind return current_ind else return current_ind - &tabstop endif endif if line =~ '^\s*\(skip\|stop\|pass\|return\|break\|continue\|)\(.*\\)\@!$' return current_ind - &tabstop endif if line =~ '^\s*is$' if prev_line =~ '^\s*is .* then .*$' && current_ind == ind return current_ind else return current_ind - &tabstop endif endif if prev_line =~ '\(^\s*\<\(for\|while\|if\|repeat\|when\|func\|convert\|lang\|struct\|enum\)\>\)\|^[^#]*[:=]\s*$' if prev_line !~ '^.* then ' let ind = ind + &tabstop endif endif if ind == indent(previousNum) return current_ind endif return ind endfunction vim-tomo/syntax/000077500000000000000000000000001511066257400141625ustar00rootroot00000000000000vim-tomo/syntax/tomo.vim000066400000000000000000000171701511066257400156630ustar00rootroot00000000000000" Language: Tomo " Maintainer: Bruce Hill " License: WTFPL " Bail if our syntax is already loaded. if exists('b:current_syntax') && b:current_syntax == 'tomo' finish endif syn match TomoErrorWord /\i*/ contained hi def link TomoErrorWord Error syn match TomoVar /[a-zA-Z_][a-zA-Z_0-9]*/ syn match TomoNumber /0x[0-9a-fA-F_]\+%\?\|[0-9][0-9_]*\(\.\([0-9][0-9_]*\|\.\@!\)\)\?\(e[0-9_]\+\)\?%\?\|\.\@/he=s-1 contains=TomoStringInterp,TomoEscape contained "syn region TomoDSLString start=/(/hs=e+1 end=/)/he=s-1 contains=TomoStringInterp,TomoEscape contained "hi def link TomoDSLString String syn match TomoArray /\[/ nextgroup=TomoTypeAnnotation syn match TomoTable /{/ nextgroup=TomoTypeAnnotation syn match TomoDocTest /^\s*>>>/ syn region TomoDocTest start=/^\s*===/ end=/$/ hi TomoDocTest ctermfg=gray syn match TomoDocError /!!!.*/ hi TomoDocError ctermfg=red cterm=italic syn match TomoDSL /\$\d\@!\w*/ nextgroup=TomoString hi def link TomoDSL String hi TomoDSL ctermfg=white cterm=bold "syn match TomoCustomStringInterp /[~!@#$%^&*+=\?]\?/ contained nextgroup=TomoDSLString "hi TomoCustomStringInterp ctermfg=gray syn match TomoStringDollar /\$/ contained hi TomoStringDollar ctermfg=LightBlue syn match TomoStringAt /@/ contained hi TomoStringAt ctermfg=LightBlue syn match TomoStringInterpWord /[a-zA-Z_][a-zA-Z_0-9]*/ contained hi TomoStringInterpWord ctermfg=LightBlue syn match TomoStringInterp /\$/ contained nextgroup=TomoStringDollar,TomoStringInterpWord,TomoParenGroup,@TomoAll hi TomoStringInterp ctermfg=LightBlue syn match TomoStringInterpAt /@/ contained nextgroup=TomoStringAt,TomoStringInterpWord,TomoParenGroup,@TomoAll hi TomoStringInterpAt ctermfg=LightBlue syn match TomoEscape /\\\([abenrtvN]\|x\x\x\|\d\{3}\|{[^}]*}\|\[[^]]*\]\)\|\\./ hi TomoEscape ctermfg=LightBlue syn keyword TomoExtern extern hi def link TomoExtern Statement syn keyword TomoConditional if unless else when then defer holding hi def link TomoConditional Conditional syn keyword TomoLoop for while do until repeat hi def link TomoLoop Repeat syn keyword TomoFail fail hi def link TomoFail Exception syn keyword TomoStatement stop skip break continue fail pass return del struct lang extend assert hi def link TomoStatement Statement syn keyword TomoNone none hi TomoNone ctermfg=red syn keyword TomoSerializing deserialize hi TomoSerializing ctermfg=blue cterm=bold syn region TomoUse matchgroup=Keyword start=/\/ matchgroup=TomoDelim end=/$\|;/ hi def link TomoUse String syn match TomoArgDefault /=/ nextgroup=@TomoAll skipwhite contained hi def link TomoArgDefault Operator syn match TomoReturnSignature /->/ nextgroup=TomoType skipwhite contained hi def link TomoReturnSignature Operator syn region TomoFnArgSignature start=/(/ end=/)/ contains=TomoVar,TomoDelim,TomoTypeAnnotation,TomoArgDefault,TomoComment nextgroup=TomoReturnSignature skipwhite contained syn match TomoFnName /\<[a-zA-Z_][a-zA-Z_0-9]*\>/ nextgroup=TomoFnArgSignature skipwhite contained hi def link TomoFnName Function syn keyword TomoFuncDef func nextgroup=TomoFnName skipwhite hi def link TomoFuncDef Keyword syn keyword TomoConvertDef convert nextgroup=TomoFnArgSignature skipwhite hi def link TomoConvertDef Keyword syn match TomoTagEquals /=/ skipwhite nextgroup=TomoErrorWord,TomoNumber contained hi def link TomoTagEquals Operator syn match TomoTagType /(/ nextgroup=TomoType contained syn match TomoTag /[a-zA-Z_]\i*/ nextgroup=TomoTagType contained hi TomoTag cterm=bold syn keyword TomoEnum enum skipwhite nextgroup=TomoTaggedUnion hi def link TomoEnum Keyword syn region TomoTaggedUnion start=/:=/ skip=/|/ end=/$/ contains=TomoTag,TomoTagEquals contained " syn region TomoFnDecl start=/\/ end=/(\@=\|$/ contains=TomoFnName,TomoKeyword syn keyword TomoBoolean yes no hi def link TomoBoolean Boolean syn match TomoStructName /\w\+\( *{\)\@=/ hi TomoStructName cterm=bold syn keyword TomoOperator in and or xor is not mod mod1 _min_ _max_ _mix_ mutexed syn match TomoOperator ;\([a-zA-Z0-9_)] *\)\@<=/; syn match TomoOperator ;[+*^<>=-]=\?; syn match TomoOperator /[:!]\?=/ syn match TomoOperator /[#?:]/ hi def link TomoOperator Operator syn match TomoDelim /,/ hi def link TomoDelim Delimiter syn match TomoTableValueType /:/ nextgroup=TomoType contained hi def link TomoTableValueType Type syn match TomoTypeDelim /,/ contained hi def link TomoTypeDelim Type syn match TomoAssoc /=/ contained hi def link TomoAssoc Type syn region TomoType start=/\[/ end=/\]\|\():\)\@=\|$/ contains=TomoType contained nextgroup=TomoTableValueType syn region TomoType start=/{/ end=/}\|\():\)\@=\|$/ contains=TomoType,TomoAssoc contained nextgroup=TomoTableValueType syn region TomoType start=/func(/ end=/) *\(->\)\?/ contains=TomoType,TomoTypeDelim nextgroup=TomoType contained syn match TomoType /[a-zA-Z_]\i*/ contained nextgroup=TomoTableValueType syn match TomoType /\$[a-zA-Z_0-9]\+/ contained nextgroup=TomoTableValueType syn match TomoType /[@?&]\+/ contained nextgroup=TomoType hi def link TomoType Type syn match TomoTypeAnnotation /:=\@!/ nextgroup=TomoType contained hi def link TomoTypeAnnotation Operator syn region TomoComment start=;#; end=/$/ hi def link TomoComment Comment syn region TomoSay start=;!!; end=/$/ contains=TomoEscape,TomoStringInterp hi TomoSay ctermfg=white cterm=bold syn region TomoInlineCParens start=/(/ end=/)/ contains=TomoInlineCParens contained hi def link TomoInlineCParens String syn region TomoInlineCBraces start=/{/ end=/}/ contains=TomoInlineCBraces contained hi def link TomoInlineCBraces String syn match TomoInlineC ;\ *; nextgroup=TomoInlineCBraces,TomoInlineCParens hi def link TomoInlineC Keyword syn region TomoParenGroup start=/(/ end=/)/ contains=@TomoAll,TomoParenGroup contained syn match TomoLinkerDirective ;^\s*!link.*$; hi TomoLinkerDirective ctermbg=blue ctermfg=black syn cluster TomoAll contains=TomoVar,TomoComment,TomoChar,TomoString,TomoDSL,TomoPath,TomoKeyword,TomoOperator, \TomoConditional,TomoLoop,TomoFail,TomoNone,TomoSerializing,TomoStatement,TomoStructure,TomoTypedef,TomoEmptyTable,TomoUse, \TomoNumber,TomoFnDecl,TomoBoolean,TomoDocTest,TomoDocError,TomoArray,TomoTable, \TomoLinkerDirective,TomoInlineC if !exists('b:current_syntax') let b:current_syntax = 'tomo' endif