" Vim syntax file " Language: Rebol " Maintainer: Mike Williams " Filenames: *.r " Last Change: 20th October 1998 " URL: N/A " " Change history " changes by TimJohnson " Added additional keywords, ?? " changes by Ingo Hohmann " added pair! " added folding block " added mold/all value " added some chars to isk " added setWord and GetWord " Todo: Tags " Todo: urls: e.g. async:// is a valid url! in Rebol " Todo: comment [] " Todo: decide how to name sysntax groups: Core/View/... or Mezzanine/C-Level or function/native/... " Todo: rename syntaxgroups according to this decision " Todo: cleanup File: %/ not allowed at the moment " This version needs at least vim 6.0 " Remove any old syntax stuff hanging around syn clear " Rebol is case insensitive syn case ignore " As per current users documentation set isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~,°,§,^ "Blocks! syn region rebolBlock matchgroup=rebolBlockDelim start="\[" end="\]" fold transparent contains=ALL syn region rebolParen matchgroup=rebolParenDelim start="(" end=")" fold transparent contains=ALL " Yer TODO highlighter syn keyword rebolTodo contained TODO syn keyword rebolFixme contained FIXME " These are my initials, which I (nearly) always use, when I'm changing code " from someone else. syn keyword rebolInitials contained iho " Comments syn match rebolComment ";.*$" contains=rebolTodo,rebolFixme,rebolInitials syn region rebolComment start="\" " Decimals syn match rebolDecimal "[+-]\=\(\d\+\('\d*\)*\)\=[,.]\d*\(e[+-]\=\d\+\)\=" syn match rebolDecimal "[+-]\=\d\+\('\d*\)*\(e[+-]\=\d\+\)\=" " Pair syn match rebolPair "[+-]\=\d*x[+-]\=\d" " Tuples syn match rebolTuple "\(\d\+\.\)\{2,}" " Money syn match rebolMoney "\a*\$\d\+\('\d*\)*\([,.]\d\+\)\=" " Time syn match rebolTime "[+-]\=\(\d\+\('\d*\)*\:\)\{1,2}\d\+\('\d*\)*\([.,]\d\+\)\=\([AP]M\)\=\>" syn match rebolTime "[+-]\=:\d\+\([.,]\d*\)\=\([AP]M\)\=\>" " Dates " DD-MMM-YY & YYYY format syn match rebolDate "\d\{1,2}\([/-]\)\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\1\(\d\{2}\)\{1,2}\>" " DD-month-YY & YYYY format syn match rebolDate "\d\{1,2}\([/-]\)\(January\|February\|March\|April\|May\|June\|July\|August\|September\|October\|November\|December\)\1\(\d\{2}\)\{1,2}\>" " DD-MM-YY & YY format syn match rebolDate "\d\{1,2}\([/-]\)\d\{1,2}\1\(\d\{2}\)\{1,2}\>" " YYYY-MM-YY format syn match rebolDate "\d\{4}-\d\{1,2}-\d\{1,2}\>" " DD.MM.YYYY format syn match rebolDate "\d\{1,2}\.\d\{1,2}\.\d\{4}\>" " String based " Strings syn region rebolString oneline start=+"+ skip=+^"+ end=+"+ contains=rebolSpecialCharacter keepend syn region rebolString start=+[^#]{+ end=+}+ skip=+{[^}]*}+ contains=rebolSpecialCharacter fold " Binary syn region rebolBinary start=+\d*#{+ end=+}+ contains=rebolComment fold " Email syn match rebolEmail "\<\k\+@\(\k\+\.\)*\k\+\>" " File "syn match rebolFile "%\(\k\+/\)*\k\+[/]\=" contains=rebolSpecialCharacter syn match rebolFile "%[/]*\(\k\+/\)*\k\+[/]\=" contains=rebolSpecialCharacter syn region rebolFile oneline start=+%"+ end=+"+ contains=rebolSpecialCharacter " URLs "syn match rebolURL "\<\a\k*:\/\*\S\+\>" syn match rebolURL "http://\(\k\+:\k\+@\)\=\k\+\(\.\k\+\)*\(:\d\+\)\=\(/\(\k\+/\)*\(\k\+\)\=\)*" syn match rebolURL "file://\k\+\(\.\k\+\)*/\(\k\+/\)*\k\+" syn match rebolURL "ftp://\(\k\+:\k\+@\)\=\k\+\(\.\k\+\)*\(:\d\+\)\=/\(\k\+/\)*\k\+" syn match rebolURL "mailto:\k\+\(\.\k\+\)*@\k\+\(\.\k\+\)*" " Issues syn match rebolIssue "#\(\d\+-\)*\d\+" " Tags syn region rebolTag oneline start="<\a\k*" end=">" " load/all "syn region rebolLoadValue matchgroup=rebolString start="#\[\S+" end="\]" skip="\[\_.\{-}\]" syn region rebolLoadValue matchgroup=rebolString start="#\[\S+" end="\]" fold transparent contains=All " Characters syn region rebolCharacter start=+#"+ end=+"+ skip=+^"+ contains=rebolSpecialCharacter syn keyword rebolCharacter newline tab cr syn match rebolSpecialCharacter transparent contained "\^[^[:space:][]" syn match rebolSpecialCharacter transparent contained "%\d\+" " Operators " Math operators syn match rebolMathOperator "\(\*\{1,2}\|+\|-\|/\{1,2}\)" "syn keyword rebolMathFunction " Binary operators "syn keyword rebolBinaryOperator complement and or xor ~ syn keyword rebolBinaryOperator ~ " Logic operators syn match rebolLogicOperator "[<>=]=\=" "syn match rebolLogicOperator "<>" "syn match rebolBraces "[[\]()]" " use rebolRepeat for control functions syn keyword rebolControl all any attempt break catch compose disarm dispatch do do-events does syn keyword rebolControl either exit for forall foreach forever forskip func function halt syn keyword rebolControl has if launch local loop q quit reduce repeat return secure syn keyword rebolControl switch throw throw-on-error try unless until wait while " user defined functions syn keyword rebolUserWord cgi chomp column-indexes flatten map tomorrow yesterday next-week last-week next-month last-month next-year last-year syn keyword rebolUserWord global-default-value fetch host-server dos-newline int-words hexidecimals month-days months br block-sum syn keyword rebolUserWord change-select quote setq date-ops sql-time print-to syn keyword rebolUserWord cut decode deform distinct diverge div-rem drop even-div encode filter from fstringf getpos hex-char index syn keyword rebolUserWord inc in-range int-string longest like import int-string? htm syn keyword rebolUserWord lTrim-to order raise matrix-index mrk merge merge-blocks minus nbsp pcompare pop print-error syn keyword rebolUserWord to-sql run parse-date parse-today part plus rotate-right rotate-left read-dir syn keyword rebolUserWord rTrim-to slice split split-text sprintf sqrt-rem strcat strcpyn strpos syn keyword rebolUserWord sql-reb-date sql-today table table-read tabify tohex unform urlcat valid-str within where syn keyword rebolUserWord dec time-sum data? no-data? remove-all end? front? pos? shortest longest syn keyword rebolUserWord dbg fuse push ins que lop pull tie un-esc esc fold to-matrix div make-nested syn keyword rebolUserWord picks collect objectify attributes blockify make-al export syn keyword rebolUserWord sub def cmpn cond conde case " rebol functions syn keyword rebolSystemWord * ** + - / // < <= <> = == =? > >= ? syn keyword rebolSystemWord ?? about abs absolute add alert alias alter and attempt syn keyword rebolSystemWord any-block? any-function? any-string? any-type? syn keyword rebolSystemWord any-word? append arccosine arcsine arctangent array syn keyword rebolSystemWord ask at back binary? bind bitset? block? browse syn keyword rebolSystemWord build-tag caret-to-offset center-face change change-dir syn keyword rebolSystemWord char? charset checksum choose clean-path clear clear-fields close comment syn keyword rebolSystemWord complement compress confirm connected? context copy cosine datatype? date? syn keyword rebolSystemWord debase decimal? decode-cgi decompress dehex delete detab difference syn keyword rebolSystemWord dir? dirize divide echo email? empty? enbase entab equal? error? error! even? syn keyword rebolSystemWord event? exclude exists? exp extract fifth file? find first flash focus syn keyword rebolSystemWord form found? fourth free function? get get-word? greater-or-equal? syn keyword rebolSystemWord one? has-data? off? syn keyword rebolSystemWord hash? head head? help hide hide-popup image? import-email in in-window? syn keyword rebolSystemWord index? info? inform input greater? syn keyword rebolSystemWord input? insert integer? intersect issue? join last layout length? syn keyword rebolSystemWord lesser-or-equal? lesser? library? license list-dir list? lit-path? syn keyword rebolSystemWord lit-word? load load-image load-prefs load-thru log-10 log-2 log-e syn keyword rebolSystemWord logic? lowercase make make-dir make-face max maximum min minimum syn keyword rebolSystemWord modified? mold money? multiply native? negate negative? next none? not syn keyword rebolSystemWord not-equal? now number? object? odd? offset-to-caret offset? op? open or syn keyword rebolSystemWord pair? paren? parse parse-email-addrs parse-header parse-header-date syn keyword rebolSystemWord parse-xml path? pick poke port? positive? power prin print syn keyword rebolSystemWord probe protect protect-system query random read read-io read-net read-thru syn keyword rebolSystemWord rebol recycle refinement? reform rejoin remainder remold remove rename syn keyword rebolSystemWord repend replace select request request-color request-date request-download syn keyword rebolSystemWord request-file request-list request-pass request-text resend reverse syn keyword rebolSystemWord routine? same? save script? second self syn keyword rebolSystemWord send series? set set-net set-path? syn keyword rebolSystemWord set-word? show show-popup sine size-text size? skip some sort source span? syn keyword rebolSystemWord split-path square-root strict-equal? strict-not-equal? string? struct? syn keyword rebolSystemWord stylize subtract system tag? tail tail? tangent third syn keyword rebolSystemWord thru time? to to-binary to-bitset syn keyword rebolSystemWord to-block to-char to-date to-decimal to-email to-event to-file to-get-word syn keyword rebolSystemWord to-hash to-hex to-idate to-image to-integer to-issue to-list syn keyword rebolSystemWord to-lit-path to-lit-word to-logic to-money to-none to-pair to-paren to-path syn keyword rebolSystemWord to-refinement to-set-path to-set-word to-string to-tag to-time to-tuple syn keyword rebolSystemWord to-url to-word trace trim tuple? type? unfocus union unique unprotect syn keyword rebolSystemWord unset unset? unview update upgrade uppercase url? usage use value? view what syn keyword rebolSystemWord what-dir within? word? write write-io xor zero? " Colours syn keyword rebolColor aqua bar-color base-color beige black blue brick brown button-color coal coffee syn keyword rebolColor crimson cyan forest gold gray green ivory khaki leaf linen magenta main-color syn keyword rebolColor maroon mint navy oldrab olive orange over-color papaya pewter pink purple reblue syn keyword rebolColor rebolor red sienna silver sky snow tan teal violet water wheat white yellow " use rebolType for types syn keyword rebolType any-function! any-type! bitset! block! char! datatype! date! decimal! email! syn keyword rebolType event! file! get-word! hash! hex! syn keyword rebolType idate! image! integer! issue! list! lit-path! lit-word! logic! money! syn keyword rebolType number! none! object! pair! paren! path! port! refinement! series! syn keyword rebolType set-path! set-word! string! tag! time! tuple! url! word! " Constants syn keyword rebolConstant none " Booleans syn keyword rebolBoolean true false on off yes no if !exists("did_rebol_syntax_inits") let did_rebol_syntax_inits = 1 " The default methods for highlighting. Can be overridden later hi link rebolTodo Todo hi link rebolFixme Todo hi link rebolInitials Todo " hi link rebolWord Statement " hi link rebolConditional Conditional " hi link rebolLabel Label hi link rebolWord Identifier hi link rebolUserWord Function hi link rebolSystemWord Keyword hi link rebolControl Repeat hi link rebolWordPath Statement hi link rebolSetWord Statement hi link rebolGetWord Statement hi link rebolBlockDelim Statement hi link rebolParenDelim rebolBlockDelim hi link rebolOperator Operator hi link rebolBraces Float hi link rebolLogicOperator rebolOperator hi link rebolLogicFunction rebolLogicOperator hi link rebolMathOperator rebolOperator hi link rebolBinaryOperator rebolOperator hi link rebolBinaryFunction rebolBinaryOperator " hi link rebolMathFunction rebolMathOperator hi link rebolType Type " hi link SpecialChar rebolTypeFunction hi link rebolString String hi link rebolCharacter Character hi link rebolSpecialCharacter SpecialChar hi link rebolTag rebolString hi link rebolEmail rebolString hi link rebolFile rebolString hi link rebolURL rebolString hi link rebolLoadValue Error hi link rebolNumber Number hi link rebolInteger rebolNumber hi link rebolPair rebolNumber hi link rebolDecimal rebolNumber hi link rebolTime rebolNumber hi link rebolDate rebolNumber hi link rebolMoney rebolNumber hi link rebolBinary rebolNumber hi link rebolIssue rebolNumber hi link rebolTuple rebolNumber hi link rebolColor rebolNumber hi link rebolFloat rebolNumber hi link rebolBoolean Constant hi link rebolConstant Constant hi link rebolComment Comment hi link rebolError Error endif if exists("my_rebol_file") if file_readable(expand(my_rebol_file)) execute "source " . my_rebol_file endif endif let b:current_syntax = "rebol" " vim: ts=8