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