codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Reva Forth3" Version: 2011.24" Last Change: 2019 Sep 275" Maintainer: Ron Aaron <ron@ronware.org>6" URL: https://github.com/ronaaron/reva7" Filetypes: *.rf *.frt8" NOTE: You should also have the ftplugin/reva.vim file to set 'isk'9 10" quit when a syntax file was already loaded11if exists("b:current_syntax")12 finish13endif14 15let s:cpo_save = &cpo16set cpo&vim17 18syn clear19 20" Synchronization method21syn sync ccomment22syn sync maxlines=10023 24 25syn case ignore26" Some special, non-FORTH keywords27"syn keyword revaTodo contained todo fixme bugbug todo: bugbug: note:28syn match revaTodo contained '\(todo\|fixme\|bugbug\|note\)[:]*'29syn match revaTodo contained 'copyright\(\s(c)\)\=\(\s[0-9]\{2,4}\)\='30 31syn match revaHelpDesc '\S.*' contained32syn match revaHelpStuff '\<\(def\|stack\|ctx\|ver\|os\|related\):\s.*'33syn region revaHelpStuff start='\<desc:\>' end='^\S' contains=revaHelpDesc34syn region revaEOF start='\<|||\>' end='{$}' contains=revaHelpStuff35 36 37syn case match38" basic mathematical and logical operators39syn keyword revaoperators + - * / mod /mod negate abs min max umin umax40syn keyword revaoperators and or xor not invert 1+ 1-41syn keyword revaoperators m+ */ */mod m* um* m*/ um/mod fm/mod sm/rem42syn keyword revaoperators d+ d- dnegate dabs dmin dmax > < = >> << u< <>43 44 45" stack manipulations46syn keyword revastack drop nip dup over tuck swap rot -rot ?dup pick roll47syn keyword revastack 2drop 2nip 2dup 2over 2swap 2rot 3drop48syn keyword revastack >r r> r@ rdrop49" syn keyword revastack sp@ sp! rp@ rp!50 51" address operations52syn keyword revamemory @ ! +! c@ c! 2@ 2! align aligned allot allocate here free resize53syn keyword revaadrarith chars char+ cells cell+ cell cell- 2cell+ 2cell- 3cell+ 4cell+54syn keyword revamemblks move fill55 56" conditionals57syn keyword revacond if else then =if >if <if <>if if0 ;; catch throw58 59" iterations60syn keyword revaloop while repeat until again61syn keyword revaloop do loop i j leave unloop skip more62 63" new words64syn match revaColonDef '\<noname:\|\<:\s+' contains=revaComment65syn keyword revaEndOfColonDef ; ;inline66syn keyword revadefine constant constant, variable create variable,67syn keyword revadefine user value to +to defer! defer@ defer is does> immediate68syn keyword revadefine compile literal ' [']69 70" Built in words71com! -nargs=+ Builtin syn keyword revaBuiltin <args>72Builtin execute ahead interp bye >body here pad words make73Builtin accept close cr creat delete ekey emit fsize ioerr key?74Builtin mtime open/r open/rw read rename seek space spaces stat75Builtin tell type type_ write (seek) (argv) (save) 0; 0drop;76Builtin >class >lz >name >xt alias alias: appname argc asciiz, asciizl,77Builtin body> clamp depth disassemble findprev fnvhash getenv here,78Builtin iterate last! last@ later link lz> lzmax os parse/ peek79Builtin peek-n pop prior push put rp@ rpick save setenv slurp80Builtin stack-empty? stack-iterate stack-size stack: THROW_BADFUNC81Builtin THROW_BADLIB THROW_GENERIC used xt>size z,82Builtin +lplace +place -chop /char /string bounds c+lplace c+place83Builtin chop cmp cmpi count lc lcount lplace place quote rsplit search split84Builtin zcount zt \\char85Builtin chdir g32 k32 u32 getcwd getpid hinst osname stdin stdout86Builtin (-lib) (bye) (call) (else) (find) (func) (here) (if (lib) (s0) (s^)87Builtin (to~) (while) >in >rel ?literal appstart cold compiling? context? d0 default_class88Builtin defer? dict dolstr dostr find-word h0 if) interp isa onexit89Builtin onstartup pdoes pop>ebx prompt rel> rp0 s0 src srcstr state str0 then,> then> tib90Builtin tp vector vector! word? xt? .ver revaver revaver# && '' 'constant 'context91Builtin 'create 'defer 'does 'forth 'inline 'macro 'macront 'notail 'value 'variable92Builtin (.r) (context) (create) (header) (hide) (inline) (p.r) (words~) (xfind)93Builtin ++ -- , -2drop -2nip -link -swap . .2x .classes .contexts .funcs .libs .needs .r94Builtin .rs .x 00; 0do 0if 1, 2, 3, 2* 2/ 2constant 2variable 3dup 4dup ;then >base >defer95Builtin >rr ? ?do @execute @rem appdir argv as back base base! between chain cleanup-libs96Builtin cmove> context?? ctrl-c ctx>name data: defer: defer@def dictgone do_cr eleave97Builtin endcase endof eval exception exec false find func: header heapgone help help/98Builtin hex# hide inline{ last lastxt lib libdir literal, makeexename mnotail ms ms@99Builtin newclass noop nosavedict notail nul of off on p: padchar parse parseln100Builtin parsews rangeof rdepth remains reset reva revaused rol8 rr> scratch setclass sp101Builtin strof super> temp time&date true turnkey? undo vfunc: w! w@102Builtin xchg xchg2 xfind xt>name xwords { {{ }} } _+ _1+ _1- pathsep case \||103" p[ [''] [ [']104 105 106" debugging107syn keyword revadebug .s dump see108 109" basic character operations110" syn keyword revaCharOps (.) CHAR EXPECT FIND WORD TYPE -TRAILING EMIT KEY111" syn keyword revaCharOps KEY? TIB CR112" syn match revaCharOps '\<char\s\S\s'113" syn match revaCharOps '\<\[char\]\s\S\s'114" syn region revaCharOps start=+."\s+ skip=+\\"+ end=+"+115 116" char-number conversion117syn keyword revaconversion s>d >digit digit> >single >double >number >float118 119" contexts120syn keyword revavocs forth macro inline121syn keyword revavocs context:122syn match revavocs /\<\~[^~ ]*/123syn match revavocs /[^~ ]*\~\>/124 125" numbers126syn keyword revamath decimal hex base binary octal127syn match revainteger '\<-\=[0-9.]*[0-9.]\+\>'128" recognize hex and binary numbers, the '$' and '%' notation is for greva129syn match revainteger '\<\$\x*\x\+\>' " *1* --- dont't mess130syn match revainteger '\<\x*\d\x*\>' " *2* --- this order!131syn match revainteger '\<%[0-1]*[0-1]\+\>'132syn match revainteger "\<'.\>"133 134" Strings135" syn region revaString start=+\.\?\"+ end=+"+ end=+$+136syn region revaString start=/"/ skip=/\\"/ end=/"/137 138" Comments139syn region revaComment start='\\S\s' end='.*' contains=revaTodo140syn match revaComment '\.(\s[^)]\{-})' contains=revaTodo141syn region revaComment start='(\s' skip='\\)' end=')' contains=revaTodo142syn match revaComment '(\s[^\-]*\-\-[^\-]\{-})' contains=revaTodo143syn match revaComment '\<|\s.*$' contains=revaTodo144syn match revaColonDef '\<:m\?\s*[^ \t]\+\>' contains=revaComment145 146" Include files147syn match revaInclude '\<\(include\|needs\)\s\+\S\+'148 149 150" Define the default highlighting.151if !exists("did_reva_syntax_inits")152 let did_reva_syntax_inits=1153 " The default methods for highlighting. Can be overridden later.154 hi def link revaEOF cIf0155 hi def link revaHelpStuff special156 hi def link revaHelpDesc Comment157 hi def link revaTodo Todo158 hi def link revaOperators Operator159 hi def link revaMath Number160 hi def link revaInteger Number161 hi def link revaStack Special162 hi def link revaFStack Special163 hi def link revaSP Special164 hi def link revaMemory Operator165 hi def link revaAdrArith Function166 hi def link revaMemBlks Function167 hi def link revaCond Conditional168 hi def link revaLoop Repeat169 hi def link revaColonDef Define170 hi def link revaEndOfColonDef Define171 hi def link revaDefine Define172 hi def link revaDebug Debug173 hi def link revaCharOps Character174 hi def link revaConversion String175 hi def link revaForth Statement176 hi def link revaVocs Statement177 hi def link revaString String178 hi def link revaComment Comment179 hi def link revaClassDef Define180 hi def link revaEndOfClassDef Define181 hi def link revaObjectDef Define182 hi def link revaEndOfObjectDef Define183 hi def link revaInclude Include184 hi def link revaBuiltin Keyword185endif186 187let b:current_syntax = "reva"188let &cpo = s:cpo_save189unlet s:cpo_save190 191" vim: ts=8:sw=4:nocindent:smartindent:192 