3 " Maintainer: Stephen Thomas (stephent@insignia.com)
4 " Last Change: 2001 May 10
6 " Quit when a syntax file was already loaded
9 elseif exists("b:current_syntax")
13 " A bunch of useful Inform keywords. First, case insensitive stuff
17 syn keyword informDefine Constant
19 syn keyword informType Array Attribute Class Global Nearby
20 syn keyword informType Object Property String Routine
22 syn keyword informInclude Import Include Link Replace System_file
24 syn keyword informPreCondit End Endif Ifdef Ifndef Iftrue Iffalse Ifv3 Ifv5
25 syn keyword informPreCondit Ifnot
27 syn keyword informPreProc Abbreviate Default Fake_action Lowstring
28 syn keyword informPreProc Message Release Serial Statusline Stub Switches
29 syn keyword informPreProc Trace Zcharacter
31 syn keyword informGramPreProc contained Verb Extend
33 if !exists("inform_highlight_simple")
34 syn keyword informLibAttrib absent animate clothing concealed container
35 syn keyword informLibAttrib door edible enterable female general light
36 syn keyword informLibAttrib lockable locked male moved neuter on open
37 syn keyword informLibAttrib openable pluralname proper scenery scored
38 syn keyword informLibAttrib static supporter switchable talkable
39 syn keyword informLibAttrib visited workflag worn
40 syn match informLibAttrib "\<transparent\>"
42 syn keyword informLibProp e_to se_to s_to sw_to w_to nw_to n_to ne_to
43 syn keyword informLibProp u_to d_to in_to out_to before after life
44 syn keyword informLibProp door_to with_key door_dir invent plural
45 syn keyword informLibProp add_to_scope list_together react_before
46 syn keyword informLibProp react_after grammar orders initial when_open
47 syn keyword informLibProp when_closed when_on when_off description
48 syn keyword informLibProp describe article cant_go found_in time_left
49 syn keyword informLibProp number time_out daemon each_turn capacity
50 syn keyword informLibProp name short_name short_name_indef parse_name
51 syn keyword informLibProp articles inside_description
53 syn keyword informLibObj e_obj se_obj s_obj sw_obj w_obj nw_obj n_obj
54 syn keyword informLibObj ne_obj u_obj d_obj in_obj out_obj compass
55 syn keyword informLibObj thedark selfobj player location second actor
56 syn keyword informLibObj noun
58 syn keyword informLibRoutine Achieved AddToScope AllowPushDir CDefArt
59 syn keyword informLibRoutine ChangeDefault ChangePlayer DefArt DoMenu
60 syn keyword informLibRoutine EnglishNumber HasLightSource InDefArt
61 syn keyword informLibRoutine Locale LoopOverScope NextWord
62 syn keyword informLibRoutine NextWordStopped NounDomain OffersLight
63 syn keyword informLibRoutine PlaceInScope PlayerTo PrintShortName
64 syn keyword informLibRoutine ScopeWithin SetTime StartDaemon StartTimer
65 syn keyword informLibRoutine StopDaemon StopTimer TestScope TryNumber
66 syn keyword informLibRoutine UnsignedCompare WordAddress WordLength
67 syn keyword informLibRoutine WriteListFrom YesOrNo ZRegion RunRoutines
68 syn keyword informLibRoutine AfterLife AfterPrompt Amusing BeforeParsing
69 syn keyword informLibRoutine ChooseObjects DarkToDark DeathMessage
70 syn keyword informLibRoutine GamePostRoutine GamePreRoutine Initialise
71 syn keyword informLibRoutine InScope LookRoutine NewRoom ParseNoun
72 syn keyword informLibRoutine ParseNumber ParserError PrintRank PrintVerb
73 syn keyword informLibRoutine PrintTaskName TimePasses UnknownVerb
75 syn keyword informLibAction Quit Restart Restore Verify Save
76 syn keyword informLibAction ScriptOn ScriptOff Pronouns Score
77 syn keyword informLibAction Fullscore LMode1 LMode2 LMode3
78 syn keyword informLibAction NotifyOn NotifyOff Version Places
79 syn keyword informLibAction Objects TraceOn TraceOff TraceLevel
80 syn keyword informLibAction ActionsOn ActionsOff RoutinesOn
81 syn keyword informLibAction RoutinesOff TimersOn TimersOff
82 syn keyword informLibAction CommandsOn CommandsOff CommandsRead
83 syn keyword informLibAction Predictable XPurloin XAbstract XTree
84 syn keyword informLibAction Scope Goto Gonear Inv InvTall InvWide
85 syn keyword informLibAction Take Drop Remove PutOn Insert Transfer
86 syn keyword informLibAction Empty Enter Exit GetOff Go Goin Look
87 syn keyword informLibAction Examine Search Give Show Unlock Lock
88 syn keyword informLibAction SwitchOn SwitchOff Open Close Disrobe
89 syn keyword informLibAction Wear Eat Yes No Burn Pray Wake
90 syn keyword informLibAction WakeOther Consult Kiss Think Smell
91 syn keyword informLibAction Listen Taste Touch Dig Cut Jump
92 syn keyword informLibAction JumpOver Tie Drink Fill Sorry Strong
93 syn keyword informLibAction Mild Attack Swim Swing Blow Rub Set
94 syn keyword informLibAction SetTo WaveHands Wave Pull Push PushDir
95 syn keyword informLibAction Turn Squeeze LookUnder ThrowAt Tell
96 syn keyword informLibAction Answer Buy Ask AskFor Sing Climb Wait
97 syn keyword informLibAction Sleep LetGo Receive ThrownAt Order
98 syn keyword informLibAction TheSame PluralFound Miscellany Prompt
100 syn keyword informLibVariable keep_silent deadflag action special_number
101 syn keyword informLibVariable consult_from consult_words etype verb_num
102 syn keyword informLibVariable verb_word the_time real_location c_style
103 syn keyword informLibVariable parser_one parser_two listing_together wn
104 syn keyword informLibVariable parser_action scope_stage scope_reason
105 syn keyword informLibVariable action_to_be menu_item item_name item_width
106 syn keyword informLibVariable lm_o lm_n inventory_style task_scores
108 syn keyword informLibConst AMUSING_PROVIDED DEBUG Headline MAX_CARRIED
109 syn keyword informLibConst MAX_SCORE MAX_TIMERS NO_PLACES NUMBER_TASKS
110 syn keyword informLibConst OBJECT_SCORE ROOM_SCORE SACK_OBJECT Story
111 syn keyword informLibConst TASKS_PROVIDED WITHOUT_DIRECTIONS
112 syn keyword informLibConst NEWLINE_BIT INDENT_BIT FULLINV_BIT ENGLISH_BIT
113 syn keyword informLibConst RECURSE_BIT ALWAYS_BIT TERSE_BIT PARTINV_BIT
114 syn keyword informLibConst DEFART_BIT WORKFLAG_BIT ISARE_BIT CONCEAL_BIT
115 syn keyword informLibConst PARSING_REASON TALKING_REASON EACHTURN_REASON
116 syn keyword informLibConst REACT_BEFORE_REASON REACT_AFTER_REASON
117 syn keyword informLibConst TESTSCOPE_REASON LOOPOVERSCOPE_REASON
118 syn keyword informLibConst STUCK_PE UPTO_PE NUMBER_PE CANTSEE_PE TOOLIT_PE
119 syn keyword informLibConst NOTHELD_PE MULTI_PE MMULTI_PE VAGUE_PE EXCEPT_PE
120 syn keyword informLibConst ANIMA_PE VERB_PE SCENERY_PE ITGONE_PE
121 syn keyword informLibConst JUNKAFTER_PE TOOFEW_PE NOTHING_PE ASKSCOPE_PE
124 " Now the case sensitive stuff.
128 syn keyword informSysFunc child children elder indirect parent random
129 syn keyword informSysFunc sibling younger youngest metaclass
130 if exists("inform_highlight_glulx")
131 syn keyword informSysFunc glk
134 syn keyword informSysConst adjectives_table actions_table classes_table
135 syn keyword informSysConst identifiers_table preactions_table version_number
136 syn keyword informSysConst largest_object strings_offset code_offset
137 syn keyword informSysConst dict_par1 dict_par2 dict_par3
138 syn keyword informSysConst actual_largest_object static_memory_offset
139 syn keyword informSysConst array_names_offset readable_memory_offset
140 syn keyword informSysConst cpv__start cpv__end ipv__start ipv__end
141 syn keyword informSysConst array__start array__end lowest_attribute_number
142 syn keyword informSysConst highest_attribute_number attribute_names_array
143 syn keyword informSysConst lowest_property_number highest_property_number
144 syn keyword informSysConst property_names_array lowest_action_number
145 syn keyword informSysConst highest_action_number action_names_array
146 syn keyword informSysConst lowest_fake_action_number highest_fake_action_number
147 syn keyword informSysConst fake_action_names_array lowest_routine_number
148 syn keyword informSysConst highest_routine_number routines_array
149 syn keyword informSysConst routine_names_array routine_flags_array
150 syn keyword informSysConst lowest_global_number highest_global_number globals_array
151 syn keyword informSysConst global_names_array global_flags_array
152 syn keyword informSysConst lowest_array_number highest_array_number arrays_array
153 syn keyword informSysConst array_names_array array_flags_array lowest_constant_number
154 syn keyword informSysConst highest_constant_number constants_array constant_names_array
155 syn keyword informSysConst lowest_class_number highest_class_number class_objects_array
156 syn keyword informSysConst lowest_object_number highest_object_number
158 syn keyword informConditional default else if switch
160 syn keyword informRepeat break continue do for objectloop until while
162 syn keyword informStatement box font give inversion jump move new_line
163 syn keyword informStatement print print_ret quit read remove restore return
164 syn keyword informStatement rfalse rtrue save spaces string style
166 syn keyword informOperator roman reverse bold underline fixed on off to
167 syn keyword informOperator near from
169 syn keyword informKeyword dictionary symbols objects verbs assembly
170 syn keyword informKeyword expressions lines tokens linker on off alias long
171 syn keyword informKeyword additive score time string table data initial
172 syn keyword informKeyword initstr with private has class error fatalerror
173 syn keyword informKeyword warning self
175 syn keyword informMetaAttrib remaining create destroy recreate copy call
177 syn keyword informPredicate contained has hasnt in notin ofclass or
178 syn keyword informPredicate contained provides
180 syn keyword informGrammar contained noun held multi multiheld multiexcept
181 syn keyword informGrammar contained multiinside creature special number
182 syn keyword informGrammar contained scope topic reverse meta only replace
183 syn keyword informGrammar contained first last
185 syn keyword informTodo contained TODO
187 " Assembly language mnemonics must be preceded by a '@'.
189 syn match informAsmContainer "@\s*\k*" contains=informAsm
191 if exists("inform_highlight_glulx")
192 syn keyword informAsm contained nop add sub mul div mod neg bitand bitor
193 syn keyword informAsm contained bitxor bitnot shiftl sshiftr ushiftr jump jz
194 syn keyword informAsm contained jnz jeq jne jlt jge jgt jle jltu jgeu jgtu
195 syn keyword informAsm contained jleu call return catch throw tailcall copy
196 syn keyword informAsm contained copys copyb sexs sexb aload aloads aloadb
197 syn keyword informAsm contained aloadbit astore astores astoreb astorebit
198 syn keyword informAsm contained stkcount stkpeek stkswap stkroll stkcopy
199 syn keyword informAsm contained streamchar streamnum streamstr gestalt
200 syn keyword informAsm contained debugtrap getmemsize setmemsize jumpabs
201 syn keyword informAsm contained random setrandom quit verify restart save
202 syn keyword informAsm contained restore saveundo restoreundo protect glk
203 syn keyword informAsm contained getstringtbl setstringtbl getiosys setiosys
204 syn keyword informAsm contained linearsearch binarysearch linkedsearch
205 syn keyword informAsm contained callf callfi callfii callfiii
207 syn keyword informAsm contained je jl jg dec_chk inc_chk jin test or and
208 syn keyword informAsm contained test_attr set_attr clear_attr store
209 syn keyword informAsm contained insert_obj loadw loadb get_prop
210 syn keyword informAsm contained get_prop_addr get_next_prop add sub mul div
211 syn keyword informAsm contained mod call storew storeb put_prop sread
212 syn keyword informAsm contained print_char print_num random push pull
213 syn keyword informAsm contained split_window set_window output_stream
214 syn keyword informAsm contained input_stream sound_effect jz get_sibling
215 syn keyword informAsm contained get_child get_parent get_prop_len inc dec
216 syn keyword informAsm contained print_addr remove_obj print_obj ret jump
217 syn keyword informAsm contained print_paddr load not rtrue rfalse print
218 syn keyword informAsm contained print_ret nop save restore restart
219 syn keyword informAsm contained ret_popped pop quit new_line show_status
220 syn keyword informAsm contained verify call_2s call_vs aread call_vs2
221 syn keyword informAsm contained erase_window erase_line set_cursor get_cursor
222 syn keyword informAsm contained set_text_style buffer_mode read_char
223 syn keyword informAsm contained scan_table call_1s call_2n set_colour throw
224 syn keyword informAsm contained call_vn call_vn2 tokenise encode_text
225 syn keyword informAsm contained copy_table print_table check_arg_count
226 syn keyword informAsm contained call_1n catch piracy log_shift art_shift
227 syn keyword informAsm contained set_font save_undo restore_undo draw_picture
228 syn keyword informAsm contained picture_data erase_picture set_margins
229 syn keyword informAsm contained move_window window_size window_style
230 syn keyword informAsm contained get_wind_prop scroll_window pop_stack
231 syn keyword informAsm contained read_mouse mouse_window push_stack
232 syn keyword informAsm contained put_wind_prop print_form make_menu
233 syn keyword informAsm contained picture_table
236 " Handling for different versions of VIM.
239 setlocal iskeyword+=$
240 command -nargs=+ SynDisplay syntax <args> display
243 command -nargs=+ SynDisplay syntax <args>
248 syn region informGrammarSection matchgroup=informGramPreProc start="\<Verb\|Extend\>" skip=+".*"+ end=";"he=e-1 contains=ALLBUT,informAsm
250 " Special character forms.
252 SynDisplay match informBadAccent contained "@[^{[:digit:]]\D"
253 SynDisplay match informBadAccent contained "@{[^}]*}"
254 SynDisplay match informAccent contained "@:[aouAOUeiyEI]"
255 SynDisplay match informAccent contained "@'[aeiouyAEIOUY]"
256 SynDisplay match informAccent contained "@`[aeiouAEIOU]"
257 SynDisplay match informAccent contained "@\^[aeiouAEIOU]"
258 SynDisplay match informAccent contained "@\~[anoANO]"
259 SynDisplay match informAccent contained "@/[oO]"
260 SynDisplay match informAccent contained "@ss\|@<<\|@>>\|@oa\|@oA\|@ae\|@AE\|@cc\|@cC"
261 SynDisplay match informAccent contained "@th\|@et\|@Th\|@Et\|@LL\|@oe\|@OE\|@!!\|@\?\?"
262 SynDisplay match informAccent contained "@{\x\{1,4}}"
263 SynDisplay match informBadStrUnicode contained "@@\D"
264 SynDisplay match informStringUnicode contained "@@\d\+"
265 SynDisplay match informStringCode contained "@\d\d"
267 " String and Character constants. Ordering is important here.
268 syn region informString start=+"+ skip=+\\\\+ end=+"+ contains=informAccent,informStringUnicode,informStringCode,informBadAccent,informBadStrUnicode
269 syn region informDictString start="'" end="'" contains=informAccent,informBadAccent
270 SynDisplay match informBadDictString "''"
271 SynDisplay match informDictString "'''"
273 " Integer numbers: decimal, hexadecimal and binary.
274 SynDisplay match informNumber "\<\d\+\>"
275 SynDisplay match informNumber "\<\$\x\+\>"
276 SynDisplay match informNumber "\<\$\$[01]\+\>"
279 syn match informComment "!.*" contains=informTodo
282 syn sync match informSyncRoutine grouphere NONE "\[\|\]"
283 syn sync match informSyncRoutine groupthere informGrammarSection "\<Verb\|Extend\>"
284 syn sync maxlines=500
286 delcommand SynDisplay
288 " The default highlighting.
289 if version >= 508 || !exists("did_inform_syn_inits")
291 let did_inform_syn_inits = 1
292 command -nargs=+ HiLink hi link <args>
294 command -nargs=+ HiLink hi def link <args>
297 HiLink informDefine Define
298 HiLink informType Type
299 HiLink informInclude Include
300 HiLink informPreCondit PreCondit
301 HiLink informPreProc PreProc
302 HiLink informGramPreProc PreProc
303 HiLink informAsm Special
304 HiLink informPredicate Operator
305 HiLink informSysFunc Identifier
306 HiLink informSysConst Identifier
307 HiLink informConditional Conditional
308 HiLink informRepeat Repeat
309 HiLink informStatement Statement
310 HiLink informOperator Operator
311 HiLink informKeyword Keyword
312 HiLink informGrammar Keyword
313 HiLink informDictString String
314 HiLink informNumber Number
315 HiLink informError Error
316 HiLink informString String
317 HiLink informComment Comment
318 HiLink informAccent Special
319 HiLink informStringUnicode Special
320 HiLink informStringCode Special
321 HiLink informTodo Todo
322 if !exists("inform_highlight_simple")
323 HiLink informLibAttrib Identifier
324 HiLink informLibProp Identifier
325 HiLink informLibObj Identifier
326 HiLink informLibRoutine Identifier
327 HiLink informLibVariable Identifier
328 HiLink informLibConst Identifier
329 HiLink informLibAction Identifier
331 HiLink informBadDictString informError
332 HiLink informBadAccent informError
333 HiLink informBadStrUnicode informError
338 let current_syntax = "inform"