specky/syntax/specrun.vim
author mahlon
Fri, 03 Apr 2009 23:34:00 +0000
branchvim-stuff
changeset 5 3346aa8d5364
parent 2 6b33188f1694
child 6 31d00503e038
permissions -rw-r--r--
Add snippets and rspec syntax highlights.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     1
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     2
" specky: syntax highlighting for the 'spec' script output
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     3
" $Id$
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     4
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     5
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     6
if has("folding")
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     7
  setlocal foldmethod=syntax
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     8
endif
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
     9
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    10
" Command line as it was called, inserted by Specky
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    11
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    12
syntax match specSpeckyCmd /^Output of: .*/
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    13
highlight link specSpeckyCmd Question
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    14
"syntax match WarningMsg /\.\./
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    15
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    16
" Plain output block (...P..F...)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    17
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    18
syntax region specPlain start="^[\.PF]\+" end="^$" contains=specFailedPlain,specPendingPlain
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    19
highlight link specPlain MoreMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    20
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    21
" Passed specs (specdoc output)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    22
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    23
syntax match specPassed /^- .*/ contains=specFailed,specPending
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    24
highlight link specPassed MoreMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    25
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    26
" Pending specs (specdoc output)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    27
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    28
syntax match specPending /.*PENDING: Not Yet Implemented)/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    29
highlight link specPending Function
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    30
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    31
" (Plain output)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    32
syntax match specPendingPlain /P/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    33
highlight link specPendingPlain Function
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    34
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    35
" Failed specs (specdoc output)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    36
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    37
syntax match specFailed /.*\(FAILED\|ERROR\) - \d\+)/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    38
highlight link specFailed WarningMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    39
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    40
" (Plain output)
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    41
syntax match specFailedPlain /F/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    42
highlight link specFailedPlain WarningMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    43
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    44
" Warning details
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    45
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    46
syntax region specFailedDetails start="^\d\+)" end="^$" fold
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    47
highlight link specFailedDetails WarningMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    48
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    49
" Pending specs
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    50
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    51
syntax region specPendingDetails start="^Pending:" end="^$" fold
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    52
highlight link specPendingDetails Function
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    53
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    54
" Timing information
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    55
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    56
syntax match specTimedRun /^Finished in.*/
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    57
highlight link specTimedRun Question
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    58
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    59
" Status summary
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    60
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    61
syntax match specExamplesTotal /^\d\+ examples, .\+/ contains=specTotalFailed,specNoFailures,specTotalPending
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    62
highlight link specExamplesTotal Special
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    63
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    64
syntax match specTotalFailed /\d\+ failure\%[s]/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    65
highlight link specTotalFailed WarningMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    66
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    67
syntax match specTotalPending /\d pending/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    68
highlight link specTotalPending Function
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    69
"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    70
syntax match specNoFailures /0 failures/ contained
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    71
highlight link specNoFailures MoreMsg
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    72
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    73
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    74
let b:current_syntax = "specrun"
6b33188f1694 Moving Specky into a Vim subfolder.
mahlon
parents:
diff changeset
    75