tisp.vim

vim configuration for the tisp langauge
git clone git://edryd.org/tisp.vim
Log | Files | Refs

eevo.vim (4855B)


      1 " Vim syntax file
      2 " Language: eevo
      3 " Author:   Ed van Bruggen <ed@edryd.org>
      4 " URL:      eevo.pub
      5 
      6 if version < 600
      7   syntax clear
      8 elseif exists("b:current_syntax")
      9   finish
     10 endif
     11 
     12 " highlight unmatched parens
     13 syn match eevoError '[]})]'
     14 
     15 if version < 600
     16   set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
     17 else
     18   setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_
     19 endif
     20 
     21 " built-ins
     22 syn keyword eevoSyntax quote quasiquote unquote do do0 eval cond records
     23 syn keyword eevoSyntax def defmacro Func Macro load quit error assert procprops
     24 syn keyword eevoSyntax if else when unless let recur switch undefine! defined?
     25 " TODO color operators differently
     26 syn keyword eevoSyntax not and or nand nor
     27 syn keyword eevoSyntax typeof Void Bool Pair Int Dec Str Sym
     28 
     29 " functions
     30 syn keyword eevoFunc any? nil? empty? void? atom? string? symbol? pair? cons? list?
     31 syn keyword eevoFunc function? specialform? primitive? macro? builtin? procedure? record?
     32 syn keyword eevoFunc integer? ratio? decimal? rational? number?
     33 syn keyword eevoFunc boolean? true? false?
     34 syn keyword eevoFunc version repl ans doc default
     35 
     36 " math
     37 syn keyword eevoFunc + - * / ^ *^ mod ! = /= < <= = > >=
     38 syn keyword eevoFunc inc dec round truncate floor ceiling
     39 syn keyword eevoFunc sqr cube root sqrt cbrt exp log log10 logb
     40 syn keyword eevoFunc abs sgn max min numerator denominator dot norm
     41 syn keyword eevoFunc sin sinh cos cosh tan tanh
     42 syn keyword eevoFunc arcsin arcsinh arccos arccosh arctan arctanh
     43 syn keyword eevoFunc csc csch sec sech cot coth
     44 syn keyword eevoFunc arccsc arccsch arcsec arcsech arccot arccoth
     45 syn keyword eevoFunc negative? positive? zero? even? odd?
     46 syn keyword eevoFunc half double factorial gcd deg rad
     47 
     48 " i/o
     49 syn keyword eevoFunc read parse write print println display displayln newline printerr printerrln
     50 syn keyword eevoNumber stdout stderr
     51 
     52 " os
     53 syn keyword eevoFunc cd! pwd now time
     54 
     55 " list
     56 syn keyword eevoFunc list list* length last nth head tail count
     57 syn keyword eevoFunc apply map convert assoc filter keep remove memp member everyp? every?
     58 syn keyword eevoFunc compose reverse append zip
     59 
     60 " stack
     61 syn keyword eevoFunc push pop peek swap
     62 
     63 " first and rest
     64 syn keyword eevoFunc fst rst snd ffst rfst rrst
     65 syn keyword eevoFunc fffst ffrst frfst frrst rffst rfrst rrfst rrrst
     66 
     67 " string
     68 syn keyword eevoFunc strfmt split
     69 
     70 " lambda sign
     71 " syn match eevoSyntax /\<[\u03bb]\>/
     72 
     73 " TODO : and [] as sym end
     74 
     75 " TODO highlight escape sequences
     76 syn region eevoString start='\%(\\\)\@<!"' skip='\\[\\"]' end='"' contains=@Spell
     77 
     78 " TODO ;;; for section title
     79 syn match eevoComment ';.*$' contains=eevoTodo,eevoNote,@Spell
     80 syn keyword eevoTodo FIXME TODO XXX contained
     81 syn keyword eevoNote '\CNOTE\ze:\?' contained
     82 
     83 syn match eevoDelimiter '\<\.\>'
     84 " syn match eevoDelimiter ':\+'
     85 
     86 syn keyword eevoNumber e pi tau
     87 syn match eevoNumber "\<[+-]\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([eE][-+]\=\d\+\)\=\>"
     88 " syn match eevoNumber "[+-]\=\(\d\+/\d\+\)"
     89 syn match eevoNumber "0[xX][0-9a-fA-F]\+"
     90 
     91 syn match eevoSymbol ,\k+, contained
     92 
     93 syn keyword eevoBoolean True () Nil False it
     94 
     95 syn cluster eevoNormal  contains=eevoSyntax,eevoFunc,eevoDelimiter
     96 syn cluster eevoQuotedStuff  contains=eevoSymbol
     97 syn cluster eevoQuotedOrNormal  contains=eevoDelimiter
     98 
     99 syn region eevoStruc matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=ALL
    100 syn region eevoQuoted matchgroup=Delimiter start="['`]" end=![ \t()";]!me=e-1 contains=ALL
    101 
    102 syn region eevoQuoted matchgroup=Delimiter start="['`](" matchgroup=Delimiter end=")" contains=ALL
    103 
    104 syn region eevoUnquote matchgroup=Delimiter start="," end=![ \t()";]!me=e-1 contains=ALL
    105 syn region eevoUnquote matchgroup=Delimiter start=",@" end=![ \t()";]!me=e-1 contains=ALL
    106 
    107 syn region eevoUnquote matchgroup=Delimiter start=",(" end=")" contains=ALL
    108 syn region eevoUnquote matchgroup=Delimiter start=",@(" end=")" contains=ALL
    109 
    110 " Comments
    111 syn cluster eevoNormal  add=eevoQuoted,eevoComment
    112 syn cluster eevoQuotedOrNormal  add=eevoComment
    113 
    114 
    115 " Synchronization and the wrapping up...
    116 syn sync match matchPlace grouphere NONE "^[^ \t]"
    117 " ... i.e. synchronize on a line that starts at the left margin
    118 
    119 " Define the default highlighting.
    120 hi def link eevoSyntax             Statement
    121 hi def link eevoFunc               Function
    122 
    123 hi def link eevoString             String
    124 hi def link eevoChar               Character
    125 hi def link eevoBoolean            Boolean
    126 
    127 hi def link eevoNumber             Number
    128 hi def link eevoNumberError        Error
    129 
    130 hi def link eevoQuoted             Structure
    131 hi def link eevoSymbol             Structure
    132 
    133 hi def link eevoDelimiter          Delimiter
    134 hi def link eevoConstant           Constant
    135 
    136 hi def link eevoComment            Comment
    137 hi def link eevoTodo               Todo
    138 hi def link eevoNote               SpecialComment
    139 hi def link eevoError              Error
    140 
    141 let b:current_syntax = "eevo"