annotate runtime/syntax/spup.vim @ 4389:736b8e18a3bc v7.3.943

updated for version 7.3.943 Problem: Python: Negative indices were failing. Solution: Fix negative indices. Add tests. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Sun, 12 May 2013 21:16:23 +0200
parents b7811ab264bf
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Speedup, plant simulator from AspenTech
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Stefan.Schwarzer <s.schwarzer@ndh.net>
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " URL: http://www.ndh.net/home/sschwarzer/download/spup.vim
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " Last Change: 2012 Feb 03 by Thilo Six
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Filename: spup.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " Bugs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " - in the appropriate sections keywords are always highlighted
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " even if they are not used with the appropriate meaning;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " example: in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " MODEL demonstration
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " TYPE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " *area AS area
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " both "area" are highlighted as spupType.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " If you encounter problems or have questions or suggestions, mail me
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Remove old syntax stuff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
28 let s:cpo_save = &cpo
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
29 set cpo&vim
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
30
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " don't hightlight several keywords like subsections
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "let strict_subsections = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " highlight types usually found in DECLARE section
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 if !exists("hightlight_types")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 let highlight_types = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " one line comment syntax (# comments)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " 1. allow appended code after comment, do not complain
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " 2. show code beginnig with the second # as an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " 3. show whole lines with more than one # as an error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 if !exists("oneline_comments")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 let oneline_comments = 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Speedup SECTION regions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn case ignore
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
49 syn region spupCdi matchgroup=spupSection start="^CDI" end="^\*\*\*\*" contains=spupCdiSubs,@spupOrdinary
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn region spupConditions matchgroup=spupSection start="^CONDITIONS" end="^\*\*\*\*" contains=spupConditionsSubs,@spupOrdinary,spupConditional,spupOperator,spupCode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn region spupDeclare matchgroup=spupSection start="^DECLARE" end="^\*\*\*\*" contains=spupDeclareSubs,@spupOrdinary,spupTypes,spupCode
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn region spupEstimation matchgroup=spupSection start="^ESTIMATION" end="^\*\*\*\*" contains=spupEstimationSubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn region spupExternal matchgroup=spupSection start="^EXTERNAL" end="^\*\*\*\*" contains=spupExternalSubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn region spupFlowsheet matchgroup=spupSection start="^FLOWSHEET" end="^\*\*\*\*" contains=spupFlowsheetSubs,@spupOrdinary,spupStreams,@spupTextproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn region spupFunction matchgroup=spupSection start="^FUNCTION" end="^\*\*\*\*" contains=spupFunctionSubs,@spupOrdinary,spupHelp,spupCode,spupTypes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn region spupGlobal matchgroup=spupSection start="^GLOBAL" end="^\*\*\*\*" contains=spupGlobalSubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn region spupHomotopy matchgroup=spupSection start="^HOMOTOPY" end="^\*\*\*\*" contains=spupHomotopySubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn region spupMacro matchgroup=spupSection start="^MACRO" end="^\*\*\*\*" contains=spupMacroSubs,@spupOrdinary,@spupTextproc,spupTypes,spupStreams,spupOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn region spupModel matchgroup=spupSection start="^MODEL" end="^\*\*\*\*" contains=spupModelSubs,@spupOrdinary,spupConditional,spupOperator,spupTypes,spupStreams,@spupTextproc,spupHelp
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn region spupOperation matchgroup=spupSection start="^OPERATION" end="^\*\*\*\*" contains=spupOperationSubs,@spupOrdinary,@spupTextproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn region spupOptions matchgroup=spupSection start="^OPTIONS" end="^\*\*\*\*" contains=spupOptionsSubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn region spupProcedure matchgroup=spupSection start="^PROCEDURE" end="^\*\*\*\*" contains=spupProcedureSubs,@spupOrdinary,spupHelp,spupCode,spupTypes
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn region spupProfiles matchgroup=spupSection start="^PROFILES" end="^\*\*\*\*" contains=@spupOrdinary,@spupTextproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn region spupReport matchgroup=spupSection start="^REPORT" end="^\*\*\*\*" contains=spupReportSubs,@spupOrdinary,spupHelp,@spupTextproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn region spupTitle matchgroup=spupSection start="^TITLE" end="^\*\*\*\*" contains=spupTitleSubs,spupComment,spupConstant,spupError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn region spupUnit matchgroup=spupSection start="^UNIT" end="^\*\*\*\*" contains=spupUnitSubs,@spupOrdinary
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " Subsections
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
69 syn keyword spupCdiSubs INPUT FREE OUTPUT LINEARTIME MINNONZERO CALCULATE FILES SCALING contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword spupDeclareSubs TYPE STREAM contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword spupEstimationSubs ESTIMATE SSEXP DYNEXP RESULT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword spupExternalSubs TRANSMIT RECEIVE contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword spupFlowsheetSubs STREAM contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword spupFunctionSubs INPUT OUTPUT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn keyword spupGlobalSubs VARIABLES MAXIMIZE MINIMIZE CONSTRAINT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword spupHomotopySubs VARY OPTIONS contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn keyword spupMacroSubs MODEL FLOWSHEET contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn keyword spupModelSubs CATEGORY SET TYPE STREAM EQUATION PROCEDURE contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword spupOperationSubs SET PRESET INITIAL SSTATE FREE contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword spupOptionsSubs ROUTINES TRANSLATE EXECUTION contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword spupProcedureSubs INPUT OUTPUT SPACE PRECALL POSTCALL DERIVATIVE STREAM contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " no subsections for Profiles
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword spupReportSubs SET INITIAL FIELDS FIELDMARK DISPLAY WITHIN contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn keyword spupUnitSubs ROUTINES SET contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " additional keywords for subsections
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 if !exists( "strict_subsections" )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn keyword spupConditionsSubs STOP PRINT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn keyword spupDeclareSubs UNIT SET COMPONENTS THERMO OPTIONS contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn keyword spupEstimationSubs VARY MEASURE INITIAL contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn keyword spupFlowsheetSubs TYPE FEED PRODUCT INPUT OUTPUT CONNECTION OF IS contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn keyword spupMacroSubs CONNECTION STREAM SET INPUT OUTPUT OF IS FEED PRODUCT TYPE contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn keyword spupModelSubs AS ARRAY OF INPUT OUTPUT CONNECTION contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn keyword spupOperationSubs WITHIN contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn keyword spupReportSubs LEFT RIGHT CENTER CENTRE UOM TIME DATE VERSION RELDATE contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn keyword spupUnitSubs IS A contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 " Speedup data types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 if exists( "highlight_types" )
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn keyword spupTypes act_coeff_liq area coefficient concentration contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 syn keyword spupTypes control_signal cond_liq cond_vap cp_mass_liq contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn keyword spupTypes cp_mol_liq cp_mol_vap cv_mol_liq cv_mol_vap contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn keyword spupTypes diffus_liq diffus_vap delta_p dens_mass contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn keyword spupTypes dens_mass_sol dens_mass_liq dens_mass_vap dens_mol contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn keyword spupTypes dens_mol_sol dens_mol_liq dens_mol_vap enthflow contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn keyword spupTypes enth_mass enth_mass_liq enth_mass_vap enth_mol contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn keyword spupTypes enth_mol_sol enth_mol_liq enth_mol_vap entr_mol contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn keyword spupTypes entr_mol_sol entr_mol_liq entr_mol_vap fraction contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn keyword spupTypes flow_mass flow_mass_liq flow_mass_vap flow_mol contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn keyword spupTypes flow_mol_vap flow_mol_liq flow_vol flow_vol_vap contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn keyword spupTypes flow_vol_liq fuga_vap fuga_liq fuga_sol contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn keyword spupTypes gibb_mol_sol heat_react heat_trans_coeff contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn keyword spupTypes holdup_heat holdup_heat_liq holdup_heat_vap contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn keyword spupTypes holdup_mass holdup_mass_liq holdup_mass_vap contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn keyword spupTypes holdup_mol holdup_mol_liq holdup_mol_vap k_value contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 syn keyword spupTypes length length_delta length_short liqfraction contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 syn keyword spupTypes liqmassfraction mass massfraction molefraction contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 syn keyword spupTypes molweight moment_inertia negative notype percent contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn keyword spupTypes positive pressure press_diff press_drop press_rise contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 syn keyword spupTypes ratio reaction reaction_mass rotation surf_tens contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 syn keyword spupTypes temperature temperature_abs temp_diff temp_drop contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 syn keyword spupTypes temp_rise time vapfraction vapmassfraction contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 syn keyword spupTypes velocity visc_liq visc_vap volume zmom_rate contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 syn keyword spupTypes seg_rate smom_rate tmom_rate zmom_mass seg_mass contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 syn keyword spupTypes smom_mass tmom_mass zmom_holdup seg_holdup contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 syn keyword spupTypes smom_holdup tmom_holdup contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 " stream types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn keyword spupStreams mainstream vapour liquid contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 " "conditional" keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 syn keyword spupConditional IF THEN ELSE ENDIF contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 " Operators, symbols etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 syn keyword spupOperator AND OR NOT contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 syn match spupSymbol "[,\-+=:;*/\"<>@%()]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn match spupSpecial "[&\$?]" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 " Surprisingly, Speedup allows no unary + instead of the -
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 syn match spupError "[(=+\-*/]\s*+\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 syn match spupError "[(=+\-*/]\s*+\d\+\.\([ed][+-]\=\d\+\)\=\>"lc=1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn match spupError "[(=+\-*/]\s*+\d*\.\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 " String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 syn region spupString start=+"+ end=+"+ oneline contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 syn region spupString start=+'+ end=+'+ oneline contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 " Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 syn match spupIdentifier "\<[a-z][a-z0-9_]*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 " Textprocessor directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 syn match spupTextprocGeneric "?[a-z][a-z0-9_]*\>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 syn region spupTextprocError matchgroup=spupTextprocGeneric start="?ERROR" end="?END"he=s-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 " Number, without decimal point
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 syn match spupNumber "-\=\d\+\([ed][+-]\=\d\+\)\=" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 " Number, allows 1. before exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 syn match spupNumber "-\=\d\+\.\([ed][+-]\=\d\+\)\=" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 " Number allows .1 before exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 syn match spupNumber "-\=\d*\.\d\+\([ed][+-]\=\d\+\)\=" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 " Help subsections
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 syn region spupHelp start="^HELP"hs=e+1 end="^\$ENDHELP"he=s-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " Fortran code
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 syn region spupCode start="^CODE"hs=e+1 end="^\$ENDCODE"he=s-1 contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 " oneline comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 if oneline_comments > 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 oneline_comments = 2 " default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 if oneline_comments == 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 syn match spupComment "#[^#]*#\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 elseif oneline_comments == 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 syn match spupError "#.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 syn match spupComment "#[^#]*" nextgroup=spupError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 elseif oneline_comments == 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 syn match spupComment "#[^#]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 syn match spupError "#[^#]*#.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 " multiline comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 syn match spupOpenBrace "{" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 syn match spupError "}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 syn region spupComment matchgroup=spupComment2 start="{" end="}" keepend contains=spupOpenBrace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 syn cluster spupOrdinary contains=spupNumber,spupIdentifier,spupSymbol
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 syn cluster spupOrdinary add=spupError,spupString,spupComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 syn cluster spupTextproc contains=spupTextprocGeneric,spupTextprocError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 " define syncronizing; especially OPERATION sections can become very large
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 syn sync minlines=100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 syn sync maxlines=500
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
189 syn sync match spupSyncCdi grouphere spupCdi "^CDI"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 syn sync match spupSyncConditions grouphere spupConditions "^CONDITIONS"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 syn sync match spupSyncDeclare grouphere spupDeclare "^DECLARE"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 syn sync match spupSyncEstimation grouphere spupEstimation "^ESTIMATION"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 syn sync match spupSyncExternal grouphere spupExternal "^EXTERNAL"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 syn sync match spupSyncFlowsheet grouphere spupFlowsheet "^FLOWSHEET"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn sync match spupSyncFunction grouphere spupFunction "^FUNCTION"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn sync match spupSyncGlobal grouphere spupGlobal "^GLOBAL"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 syn sync match spupSyncHomotopy grouphere spupHomotopy "^HOMOTOPY"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 syn sync match spupSyncMacro grouphere spupMacro "^MACRO"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 syn sync match spupSyncModel grouphere spupModel "^MODEL"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 syn sync match spupSyncOptions grouphere spupOptions "^OPTIONS"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 syn sync match spupSyncProcedure grouphere spupProcedure "^PROCEDURE"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 syn sync match spupSyncProfiles grouphere spupProfiles "^PROFILES"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 syn sync match spupSyncReport grouphere spupReport "^REPORT"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 syn sync match spupSyncTitle grouphere spupTitle "^TITLE"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 syn sync match spupSyncUnit grouphere spupUnit "^UNIT"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 if version >= 508 || !exists("did_spup_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 if version < 508
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
213 let did_spup_syn_inits = 1
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
214 command -nargs=+ HiLink hi link <args>
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
215 else
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
216 command -nargs=+ HiLink hi def link <args>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
219 HiLink spupCdi spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
220 HiLink spupConditions spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
221 HiLink spupDeclare spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
222 HiLink spupEstimation spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
223 HiLink spupExternal spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
224 HiLink spupFlowsheet spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
225 HiLink spupFunction spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
226 HiLink spupGlobal spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
227 HiLink spupHomotopy spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
228 HiLink spupMacro spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
229 HiLink spupModel spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
230 HiLink spupOperation spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
231 HiLink spupOptions spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
232 HiLink spupProcedure spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
233 HiLink spupProfiles spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
234 HiLink spupReport spupSection
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
235 HiLink spupTitle spupConstant " this is correct, truly ;)
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
236 HiLink spupUnit spupSection
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
238 HiLink spupCdiSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
239 HiLink spupConditionsSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
240 HiLink spupDeclareSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
241 HiLink spupEstimationSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
242 HiLink spupExternalSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
243 HiLink spupFlowsheetSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
244 HiLink spupFunctionSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
245 HiLink spupHomotopySubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
246 HiLink spupMacroSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
247 HiLink spupModelSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
248 HiLink spupOperationSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
249 HiLink spupOptionsSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
250 HiLink spupProcedureSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
251 HiLink spupReportSubs spupSubs
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
252 HiLink spupUnitSubs spupSubs
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
254 HiLink spupCode Normal
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
255 HiLink spupComment Comment
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
256 HiLink spupComment2 spupComment
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
257 HiLink spupConditional Statement
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
258 HiLink spupConstant Constant
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
259 HiLink spupError Error
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
260 HiLink spupHelp Normal
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
261 HiLink spupIdentifier Identifier
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
262 HiLink spupNumber Constant
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
263 HiLink spupOperator Special
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
264 HiLink spupOpenBrace spupError
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
265 HiLink spupSection Statement
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
266 HiLink spupSpecial spupTextprocGeneric
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
267 HiLink spupStreams Type
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
268 HiLink spupString Constant
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
269 HiLink spupSubs Statement
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
270 HiLink spupSymbol Special
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
271 HiLink spupTextprocError Normal
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
272 HiLink spupTextprocGeneric PreProc
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
273 HiLink spupTypes Type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 let b:current_syntax = "spup"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279
3312
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
280 let &cpo = s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
281 unlet s:cpo_save
b7811ab264bf updated for version 7.3.423
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
282 " vim:ts=8