-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPOL_eScript.sublime-syntax
More file actions
515 lines (448 loc) · 27.6 KB
/
POL_eScript.sublime-syntax
File metadata and controls
515 lines (448 loc) · 27.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: POL eScript
file_extensions:
- src
- inc
scope: source.polscript
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
- include: numbers
- include: operators
- include: strings
- include: keywords
- include: constants
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: modules
- include: includes
- include: script
script:
- include: function
- include: program
- include: enum
- include: if
- include: case
- include: while
- include: for
- include: foreach
- include: do
- include: repeat
- include: functions
- include: methods
- include: members
- include: groupers
groupers:
- include: braces
- include: brackets
- include: parens
keywords:
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '(?i)\b(var|const)\b\s*\b(\w*)\b'
captures:
1: storage.type.polscript
2: meta.function.parameters.polscript
- match: '(?i)\b(array|dictionary|struct|error)\b'
scope: storage.type.polscript
- match: '(?i)\b(return|exit)\b'
scope: keyword.control.conditional.polscript
# MAIN
function:
# FUNCTION statement balancing and exported keywords control
- match: '(?i)\b(exported\s*)?(function)\b'
captures:
1: entity.other.inherited-class.polscript
2: keyword.control.conditional.polscript
push: declare_function
- match: '(?i)\bendfunction\b'
scope: invalid.illegal.polscript
declare_function:
- match: (\w*)(\()
captures:
1: meta.function.polscript
2: keyword.control.conditional.polscript
set: param_function
- include: script
param_function:
- match: '\,*\s*\b(byref)\b\s*\b(\w*)\b\s*'
captures:
1: storage.type.polscript
2: meta.function.parameters.polscript
- match: \,
scope: keyword.control.conditional.polscript
- match: \)
scope: keyword.control.conditional.polscript
- match: $\n?
scope: keyword.control.conditional.polscript
set: inside_function
- include: functions
- include: methods
- include: members
- include: groupers
inside_function:
- meta_content_scope: source.script.polscript
- match: '(?i)\bendfunction\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
program:
# PROGRAM statement balancing control
- match: '(?i)\bprogram\b'
scope: keyword.control.conditional.polscript
push: declare_program
- match: '(?i)\bendprogram\b'
scope: invalid.illegal.polscript
declare_program:
- match: (\w*)(\()
captures:
1: meta.function.polscript
2: keyword.control.conditional.polscript
set: param_program
param_program:
- match: \w*
scope: meta.function.parameters.polscript
- match: \,
scope: keyword.control.conditional.polscript
- match: \)
scope: keyword.control.conditional.polscript
- match: $\n?
scope: keyword.control.conditional.polscript
set: inside_program
- include: functions
- include: methods
- include: members
- include: groupers
inside_program:
- meta_content_scope: source.script.polscript
- match: '(?i)\bendprogram\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
enum:
# ENUM statement balancing control
- match: '(?i)\benum\b'
scope: keyword.control.conditional.polscript
push: inside_enum
- match: '(?i)\bendenum\b'
scope: invalid.illegal.polscript
inside_enum:
- match: '(?i)\bendenum\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
# CONDITIONAL
if:
# IF statement balancing and else keywords control
- match: '(?i)\bif\b'
scope: keyword.control.conditional.polscript
push: inside_if
- match: '(?i)\b(elseif|else|endif)\b'
scope: invalid.illegal.polscript
inside_if:
- match: '(?i)\belseif\b'
scope: keyword.control.conditional.polscript
set: inside_elseif
- match: '(?i)\belse\b'
scope: keyword.control.conditional.polscript
set: inside_else
- match: '(?i)\bendif\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
inside_elseif:
- match: '(?i)\b(elseif)\b'
scope: keyword.control.conditional.polscript
- match: '(?i)\belse\b'
scope: keyword.control.conditional.polscript
set: inside_else
- match: '(?i)\bendif\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
inside_else:
- match: '(?i)\bendif\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
case:
# CASE statement balancing and options control
- match: '(?i)\bcase\b'
scope: keyword.control.conditional.polscript
push: inside_case
- match: '(?i)\bendcase\b'
scope: invalid.illegal.polscript
inside_case:
- match: '^\s*\w+:'
scope: constant.other.polscript
- match: '(?i)\bendcase\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
# LOOPS
while:
# WHILE statement balancing
- match: '(?i)\bwhile\b'
scope: keyword.control.conditional.polscript
push: inside_while
- match: '(?i)\bendwhile\b'
scope: invalid.illegal.polscript
inside_while:
- match: '(?i)\bendwhile\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
- include: inside_loop
for:
# FOR statement balancing
- match: '(?i)\bfor\b'
scope: keyword.control.conditional.polscript
push: inside_for_special
- match: '(?i)\bendfor\b'
scope: invalid.illegal.polscript
inside_for_special:
- match: '(?i)\bto\b'
scope: keyword.control.conditional.polscript
set: inside_for
- match: $\n?
set: inside_for
- include: script
inside_for:
- match: '(?i)\bendfor\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
- include: inside_loop
foreach:
# FOREACH statement balancing
- match: '(?i)\bforeach\b'
scope: keyword.control.conditional.polscript
push: inside_foreach_special
- match: '(?i)\bendforeach\b'
scope: invalid.illegal.polscript
inside_foreach_special:
- match: '(?i)\bin\b'
scope: keyword.control.conditional.polscript
set: inside_foreach
- match: $\n?
set: inside_foreach
- include: script
inside_foreach:
- match: '(?i)\bendforeach\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
- include: inside_loop
do:
# DO statement balancing
- match: '(?i)\bdo\b'
scope: keyword.control.conditional.polscript
push: inside_do
- match: '(?i)\bdowhile\b'
scope: invalid.illegal.polscript
inside_do:
- match: '(?i)\bdowhile\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
- include: inside_loop
repeat:
# REPEAT statement balancing
- match: '(?i)\brepeat\b'
scope: keyword.control.conditional.polscript
push: inside_repeat
- match: '(?i)\buntil\b'
scope: invalid.illegal.polscript
inside_repeat:
- match: '(?i)\buntil\b'
scope: keyword.control.conditional.polscript
pop: true
- include: script
- include: inside_loop
inside_loop:
# Generic loop control
- match: '(?i)\b(continue|next|break)\b'
scope: keyword.control.conditional.polscript
# BRACES & BRACKETS & PARENS
braces:
# BRACES {} balancing
- match: \{
scope: punctuation.section.braces.begin.polscript
push: inside_braces
- match: \}
scope: invalid.illegal.polscript
inside_braces:
- match: \}
scope: punctuation.section.braces.end.polscript
pop: true
- include: script
brackets:
# BRACKETS [] balancing
- match: \[
scope: punctuation.section.brackets.begin.polscript
push: inside_brackets
- match: \]
scope: invalid.illegal.polscript
inside_brackets:
- match: \]
scope: punctuation.section.brackets.end.polscript
pop: true
- include: script
parens:
# PARENTHESES () balancing
- match: \(
scope: punctuation.section.parens.begin.polscript
push: inside_parens
- match: \)
scope: invalid.illegal.polscript
inside_parens:
- match: \)
scope: punctuation.section.parens.end.polscript
pop: true
- include: script
# POL SPECIFICS
functions:
- match: '(?i)\b(AlterAttributeTemporaryMod|BaseSkillToRawSkill|CheckSkill|GetAttribute|GetAttributeBaseValue|GetAttributeCap|GetAttributeDefaultCap|GetAttributeIntrinsicMod|GetAttributeLock|GetAttributeName|GetAttributeTemporaryMod|RawSkillToBaseSkill|SetAttributeBaseValue|SetAttributeCap|SetAttributeLock|SetAttributeTemporaryMod|Bin|CAsc|CAscZ|CChr|CChrZ|CDbl|CInt|CStr|Compare|Find|Hex|Len|Lower|Pack|SizeOf|SplitWords|StrReplace|SubStr|SubStrReplace|Trim|TypeOf|TypeOfInt|Unpack|Upper|Print|BoatFromItem|MoveBoat|MoveBoatRelative|MoveBoatXY|RegisterItemWithBoat|SystemFindBoatBySerial|TurnBoat|AppendConfigFileElem|FindConfigElem|GetConfigInt|GetConfigIntArray|GetConfigIntKeys|GetConfigMaxIntKey|GetConfigReal|GetConfigString|GetConfigStringArray|GetConfigStringDictionary|GetConfigStringKeys|ListConfigElemProps|LoadTusScpFile|ReadConfigFile|UnloadConfigFile|PrintTextAboveCL|PrintTextAbovePrivateCL|SendSysMessageCL|CreateDataFile|ListDataFiles|OpenDataFile|UnloadDataFile|AppendToFile|CreateDirectory|CreateXmlFile|FileExists|ListDirectory|LogToFile|OpenBinaryFile|OpenXmlFile|ReadFile|WriteFile|CreateGuild|DestroyGuild|FindGuild|ListGuilds|QueryIP|QueryParam|WriteHtml|WriteHtmlRaw|ACos|ASin|ATan|Abs|Ceil|ConstE|ConstPi|Cos|DegToRad|Floor|FormatRealToString|Log10|LogE|Max|Min|Pow|RadToDeg|Root|Sin|Sqrt|Tan|CanMove|Face|GetProperty|IsLegalMove|MakeBoundingBox|Move|RunAwayFrom|RunAwayFromLocation|RunToward|RunTowardLocation|Say|SayUC|Self|SetAnchor|SetOpponent|SetProperty|SetWarMode|TurnAwayFrom|TurnAwayFromLocation|TurnToward|TurnTowardLocation|WalkAwayFrom|WalkAwayFromLocation|WalkToward|WalkTowardLocation|Wander|Clear_Event_Queue|Create_Debug_Context|Debugger|Events_Waiting|GetPid|GetProcess|Is_Critical|OpenConnection|OpenURL|Run_Script|Run_Script_To_Completion|Set_Critical|Set_Debug|Set_Event_Queue_Size|Set_Priority|Set_Script_Option|Sleep|Sleepms|Start_Script|Start_Skill_Script|SysLog|System_RPM|Unload_Scripts|Wait_For_Event|CreateParty|DisbandParty|SendPartyMsg|SendPrivatePartyMsg|AddRealm|CreatePacket|DeleteRealm|FormatItemDescription|GetCmdLevelName|GetCmdLevelNumber|GetItemDescriptor|GetPackageByName|IncRevision|ListTextCommands|ListenPoints|LogCPropProfile|MD5Encrypt|Packages|ReadMillisecondClock|Realms|ReloadConfiguration|SetSysTrayPopupText|CreateRootItemInStorageArea|CreateStorageArea|DestroyRootItemInStorageArea|FindRootItemInStorageArea|FindStorageArea|StorageAreas|mysql_affected_rows|mysql_close|mysql_connect|mysql_fetch_row|mysql_field_name|mysql_num_fields|mysql_num_rows|mysql_query|mysql_select_db|BroadcastUC|PrintTextAbovePrivateUC|PrintTextAboveUC|RequestInputUC|SendSysMessageUC|Accessible|AddAmount|AddMenuItem|ApplyConstraint|AssignRectToWeatherRegion|Attach|Broadcast|CanWalk|CancelTarget|CheckLineOfSight|CheckLosAt|CheckLosBetween|CloseGump|CloseTradeWindow|CloseWindow|ConsumeReagents|ConsumeSubstance|CoordinateDistance|CoordinateDistanceEuclidean|CreateAccount|CreateItemAtLocation|CreateItemCopyAtLocation|CreateItemInBackpack|CreateItemInContainer|CreateItemInInventory|CreateMenu|CreateMultiAtLocation|CreateNpcFromTemplate|DestroyItem|DestroyMulti|Detach|DisableEvents|DisconnectClient|Distance|DistanceEuclidean|EnableEvents|EnumerateItemsInContainer|EnumerateOnlineCharacters|EquipFromTemplate|EquipItem|EraseGlobalProperty|EraseObjProperty|FindAccount|FindObjtypeInContainer|FindPath|FindSubstance|GetAmount|GetCommandHelp|GetCoordsInLine|GetEquipmentByLayer|GetFacing|GetGlobalProperty|GetGlobalPropertyNames|GetHarvestDifficulty|GetMapInfo|GetMenuObjTypes|GetMidpointCircleCoords|GetMultiDimensions|GetObjProperty|GetObjPropertyNames|GetObjType|GetObjTypeByName|GetRegionLightLevelAtLocation|GetRegionName|GetRegionNameAtLocation|GetRegionString|GetSpellDifficulty|GetStandingHeight|GetStandingLayers|GetWorldHeight|GrantPrivilege|HarvestResource|IsStackable|ListAccounts|ListEquippedItems|ListGhostsNearLocation|ListHostiles|ListItemsAtLocation|ListItemsNearLocation|ListItemsNearLocationOfType|ListItemsNearLocationWithFlag|ListMobilesInBox|ListMobilesInLineOfSight|ListMobilesNearLocation|ListMobilesNearLocationEx|ListMultisInBox|ListObjectsInBox|ListOfflineMobilesInRealm|ListStaticsAtLocation|ListStaticsInBox|ListStaticsNearLocation|MoveItemToContainer|MoveItemToSecureTradeWin|MoveObjectToLocation|OpenPaperdoll|POLCore|PerformAction|PlayLightningBoltEffect|PlayMovingEffect|PlayMovingEffectEx|PlayMovingEffectXYZ|PlayMovingEffectXYZEx|PlayMusic|PlayObjectCenteredEffect|PlayObjectCenteredEffectEx|PlaySoundEffect|PlaySoundEffectPrivate|PlaySoundEffectXYZ|PlayStationaryEffect|PlayStationaryEffectEx|PrintTextAbove|PrintTextAbovePrivate|ReadGameClock|RegisterForSpeechEvents|ReleaseItem|RequestInput|ReserveItem|RestartScript|Resurrect|RevokePrivilege|SaveWorldState|SecureTradeWin|SelectColor|SelectMenuItem2|SendBuyWindow|SendCharProfile|SendCharacterRaceChanger|SendDialogGump|SendEvent|SendHousingTool|SendInstaResDialog|SendOpenBook|SendOpenSpecialContainer|SendOverallSeason|SendPacket|SendPopUpMenu|SendQuestArrow|SendSellWindow|SendSkillWindow|SendStatus|SendStringAsTipWindow|SendSysMessage|SendTextEntryGump|SendViewContainer|SetGlobalProperty|SetName|SetObjProperty|SetRegionLightLevel|SetRegionWeatherLevel|SetScriptController|Shutdown|SingleClick|SpeakPowerWords|StartSpellEffect|SubtractAmount|SystemFindObjectBySerial|Target|TargetCoordinates|TargetMultiPlacement|UpdateItem|UpdateMobile|UseItem|RandomDiceRoll|RandomFloat|RandomInt|RandomIntMinMax|StrFormatTime|ApplyDamage|ApplyRawDamage|ConsumeMana|ConsumeVital|GetVital|GetVitalMaximumValue|GetVitalName|GetVitalRegenRate|HealDamage|RecalcVitals|SetVital)\b\('
scope: entity.name.function.constructor.polscript
push: param_functions
param_functions:
- match: \,
scope: entity.name.function.polscript
- match: \)
scope: entity.name.function.destructor.polscript
pop: true
- include: functions
- include: methods
- include: members
- include: groupers
methods:
- match: '(?i)\.\b(addcharacter|ban|checkpassword|delete|deletecharacter|disable|enable|eraseprop|get_member|getcharacter|getprop|move_char|propnames|set_uo_expansion|setdefaultcmdlevel|setname|setpassword|setprop|split|unban|append|cycle|erase|exists|insert|randomentry|reverse|shrink|size|sort|sorted_insert|transmit|close|flush|getint16|getint32|getint8|getsint16|getsint32|getsint8|getstring|peek|seek|setint16|setint32|setint8|setsint16|setsint32|setsint8|setstring|tell|move_offline_mobiles|addbuff|attack_once|clearaggressorto|clearbuffs|clearlawfullydamagedto|cleargottenitem|compareversion|deaf|delbuff|disableskillsfor|enabled|getcorpse|getgottenitem|kill|privileges|removereportable|setaggressorto|setlawfullydamagedto|setcmdlevel|setcriminal|setfacing|setlightlevel|setmurderer|setparalyzed|setpoisoned|setseason|setswingtimer|setwarmode|spendgold|squelch|createelement|deleteelement|findelement|keys|open|toggle|addallyguild|addenemyguild|addmember|isallyguild|isenemyguild|ismember|removeallyguild|removeenemyguild|removemember|acceptcommit|add_component|addhousepart|cancelediting|erase_component|erasehousepart|setcustom|hasexistingstack|splitstackat|splitstackinto|appendpin|erasepin|getpins|insertpin|setmaster|getint16flipped|getint32flipped|getsize|getunicodestring|getunicodestringflipped|sendareapacket|sendpacket|setint16flipped|setint32flipped|setsize|setunicodestring|setunicodestringflipped|addcandidate|removecandidate|setleader|clear_script_profile_counters|log_profile|set_priority_divide|clear_event_queue|loadsymbols|sendevent|addspell|hasspell|removespell|spells|find|format|join|length|lower|upper|isa|set_member)\b\('
scope: entity.name.function.constructor.polscript
push: param_methods
param_methods:
- match: \,
scope: entity.name.function.polscript
- match: \)
scope: entity.name.function.destructor.polscript
pop: true
- include: functions
- include: methods
- include: members
- include: groupers
members:
- match: '(?i)\.(\+|-|\?)?\b(banned|defaultcmdlevel|enabled|name|uo_expansion|usernamepasswordhash|ar|ar_base|ar_mod|onhitscript|ip|components|has_offline_mobiles|hold|hull|items|mobiles|multiid|portplank|rope|rudder|sails|starboardplank|storage|tiller|tillerman|weaponslot|wheel|acct|acctname|active_skill|aggressorto|attached|backpack|candidate_of_party|carrying_capacity|carrying_capacity_mod|casting_spell|client|clientinfo|clienttype|clientver_detail|clientversion|cmdlevel|cmdlevelstr|concealed|connected|createdat|criminal|cursor|damage_cold|damage_cold_mod|damage_energy|damage_energy_mod|damage_fire|damage_fire_mod|damage_physical|damage_physical_mod|damage_poison|damage_poison_mod|dead|deafed|delay_mod|evasionchance_mod|followers|followers_max|frozen|gender|gold|guild|guildid|gump|hidden|hitchance_mod|house_editing|last_textcolor|lastcoord|lawfullydamaged|luck|mountedsteps|movecost_run_mod|movecost_run_mounted_mod|movecost_walk_mod|movecost_walk_mounted_mod|movemode|murderer|opponent|paralyzed|party|partycanloot|poisoned|prompt|race|reportables|resist_cold|resist_cold_mod|resist_energy|resist_energy_mod|resist_fire|resist_fire_mod|resist_physical|resist_physical_mod|resist_poison|resist_poison_mod|shield|skillcap|squelched|statcap|stealthsteps|temporally_criminal|tithing|title_guild|title_prefix|title_race|title_suffix|tradewindow|trading_with|truecolor|trueobjtype|uclang|uo_expansion_client|warmode|weapon|last_activity_at|last_packet_at|max_items_mod|max_slots_mod|max_weight_mod|no_drop_exception|corpsetype|ownerserial|isopen|intrinsic|errortext|allyguilds|enemyguilds|members|custom|house_parts|amount|buyprice|container|decayat|desc|doubleclickrange|equipscript|getgottenby|house|hp|insured|invisible|item_count|layer|maxhp|maxhp_mod|movable|name_suffix|newbie|no_drop|process|quality|saveonexit|sellprice|stackable|tile_layer|unequipscript|usescript|locked|editable|facetid|gumpheight|gumpwidth|xeast|xwest|ynorth|ysouth|footprint|alignment|eventmask|master|npctemplate|run_speed|script|speech_color|speech_font|use_adjustments|npcdesc|supports_http|version|candidates|leader|all_scripts|bytes_received|bytes_sent|combat_operations_per_min|compiledate|compiletime|error_creations_per_min|events_per_min|instr_per_min|iostats|itemcount|memory_usage|mobilecount|packages|pkt_status|priority_divide|queued_iostats|running_scripts|script_profiles|scripts_late_per_min|scripts_ontime_per_min|skill_checks_per_min|sysload|sysload_severity|systime|tasks_late_per_min|tasks_late_ticks_per_min|tasks_ontime_per_min|uptime|verstr|attached_to|call_depth|consec_cycles|controller|globals|instr_cycles|num_globals|pc|pid|sleep_cycles|state|var_size|count|totalcount|color|dirty|facing|graphic|height|multi|objtype|realm|serial|specific_name|weight|x|y|z|attribute|dmg_mod|hitscript|speed_mod)\b'
scope: keyword.operator.word.polscript
constants:
- match: '(?i)\b(ATTRIBUTE_LOCK_UP|ATTRIBUTE_LOCK_DOWN|ATTRIBUTE_LOCK_LOCKED|ATTRIBUTE_MAX_BASE|TRIM_LEFT|TRIM_RIGHT|TRIM_BOTH|OT_UNKNOWN|OT_UNINIT|OT_STRING|OT_LONG|OT_DOUBLE|OT_ARRAY|OT_APPLICPTR|OT_APPLICOBJ|OT_ERROR|OT_DICTIONARY|OT_STRUCT|OT_PACKET|OT_BINARYFILE|OT_XMLFILE|OT_XMLNODE|OT_XMLATTRIBUTES|OT_POLCOREREF|OT_ACCOUNTREF|OT_CONFIGFILEREF|OT_CONFIGELEMREF|OT_DATAFILEREF|OT_DATAELEMREF|OT_GUILDREF|OT_PARTYREF|OT_BOUNDINGBOX|OT_DEBUGCONTEXT|OT_SCRIPTEXREF|OT_PACKAGE|OT_MENUREF|OT_MOBILEREF|OT_OFFLINEMOBILEREF|OT_ITEMREF|OT_BOATREF|OT_MULTIREF|OT_CLIENTREF|OT_SQLCONN|OT_SQLRESULT|OT_SQLROW|BOAT_SPEED_ONE_TILE|BOAT_SPEED_SLOW|BOAT_SPEED_MEDIUM|BOAT_SPEED_FAST|_DEFAULT_CLFONT|_DEFAULT_CLCOLOR|DF_KEYTYPE_STRING|DF_KEYTYPE_INTEGER|LOG_DATETIME|OPENMODE_IN|OPENMODE_OUT|OPENMODE_ATE|OPENMODE_APP|OPENMODE_TRUNC|SEEKDIR_BEG|SEEKDIR_CUR|SEEKDIR_END|LITTLE_ENDIAN|BIG_ENDIAN|LISTDIR_LIST_DIRS|LISTDIR_DONT_LIST_DIRS|LISTDIR_NO_FILES|LISTDIR_ALL_FILES|SAY_TEXTTYPE_DEFAULT|SAY_TEXTTYPE_WHISPER|SAY_TEXTTYPE_YELL|SAY_LANG|SAY_DOEVENT_DISABLE|SAY_DOEVENT_ENABLE|FACE_NORMAL|FACE_FORCE|SCRIPTOPT_NO_INTERRUPT|SCRIPTOPT_DEBUG|SCRIPTOPT_NO_RUNAWAY|SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES|SCRIPTOPT_AUXSVC_ASSUME_STRING|MSGLEN_VARIABLE|_DEFAULT_UCFONT|_DEFAULT_UCCOLOR|JOURNAL_UC_PRINT_NAME|JOURNAL_UC_PRINT_YOU_SEE|CRMULTI_IGNORE_MULTIS|CRMULTI_IGNORE_OBJECTS|CRMULTI_IGNORE_WORLDZ|CRMULTI_IGNORE_ALL|CRMULTI_FACING_NORTH|CRMULTI_FACING_EAST|CRMULTI_FACING_SOUTH|CRMULTI_FACING_WEST|LH_FLAG_LOS|LH_FLAG_INCLUDE_HIDDEN|FP_IGNORE_MOBILES|FP_IGNORE_DOORS|VENDOR_SEND_AOS_TOOLTIP|VENDOR_BUYABLE_CONTAINER_FILTER|SENDDIALOGMENU_FORCE_OLD|LISTENPT_HEAR_GHOSTS|LISTENPT_HEAR_TOKENS|LISTENPT_NO_SPEECH|ITEMS_IGNORE_STATICS|ITEMS_IGNORE_MULTIS|LIST_IGNORE_Z|LISTEX_FLAG_NORMAL|LISTEX_FLAG_HIDDEN|LISTEX_FLAG_GHOST|LISTEX_FLAG_CONCEALED|LISTEX_FLAG_PLAYERS_ONLY|LISTEX_FLAG_NPC_ONLY|TILEDATA_FLAG_BACKGROUND|TILEDATA_FLAG_WEAPON|TILEDATA_FLAG_TRANSPARENT|TILEDATA_FLAG_TRANSLUCENT|TILEDATA_FLAG_WALL|TILEDATA_FLAG_DAMAGING|TILEDATA_FLAG_IMPASSABLE|TILEDATA_FLAG_WET|TILEDATA_FLAG_UNK|TILEDATA_FLAG_SURFACE|TILEDATA_FLAG_BRIDGE|TILEDATA_FLAG_STACKABLE|TILEDATA_FLAG_WINDOW|TILEDATA_FLAG_NOSHOOT|TILEDATA_FLAG_PREFIX_A|TILEDATA_FLAG_PREFIX_AN|TILEDATA_FLAG_INTERNAL|TILEDATA_FLAG_FOLIAGE|TILEDATA_FLAG_PARTIAL_HUE|TILEDATA_FLAG_UNK1|TILEDATA_FLAG_MAP|TILEDATA_FLAG_CONTAINER|TILEDATA_FLAG_WEARABLE|TILEDATA_FLAG_LIGHTSOURCE|TILEDATA_FLAG_ANIMATED|TILEDATA_FLAG_HOVEROVER|TILEDATA_FLAG_UNK2|TILEDATA_FLAG_ARMOR|TILEDATA_FLAG_ROOF|TILEDATA_FLAG_DOOR|TILEDATA_FLAG_STAIRBACK|TILEDATA_FLAG_STAIRRIGHT|MAPDATA_FLAG_NONE|MAPDATA_FLAG_MOVELAND|MAPDATA_FLAG_MOVESEA|MAPDATA_FLAG_BLOCKSIGHT|MAPDATA_FLAG_OVERFLIGHT|MAPDATA_FLAG_ALLOWDROPON|MAPDATA_FLAG_GRADUAL|MAPDATA_FLAG_BLOCKING|MAPDATA_FLAG_MORE_SOLIDS|MAPDATA_FLAG_WALKBLOCK|MAPDATA_FLAG_MOVE_FLAGS|MAPDATA_FLAG_DROP_FLAGS|MAPDATA_FLAG_ALL|MOVEOBJECT_NORMAL|MOVEITEM_IGNOREMOVABLE|MOVEOBJECT_FORCELOCATION|JOURNAL_PRINT_NAME|JOURNAL_PRINT_YOU_SEE|RESURRECT_FORCELOCATION|MOVETYPE_PLAYER|MOVETYPE_COREMOVE|MOVETYPE_CORECREATE|INSERT_ADD_ITEM|INSERT_INCREASE_STACK|DELETE_BY_PLAYER|DELETE_BY_SCRIPT|ENUMERATE_IGNORE_LOCKED|ENUMERATE_ROOT_ONLY|FINDSUBSTANCE_IGNORE_LOCKED|FINDSUBSTANCE_ROOT_ONLY|FINDSUBSTANCE_FIND_ALL|TE_CANCEL_DISABLE|TE_CANCEL_ENABLE|TE_STYLE_DISABLE|TE_STYLE_NORMAL|TE_STYLE_NUMERICAL|SYSFIND_SEARCH_OFFLINE_MOBILES|TGTOPT_CHECK_LOS|TGTOPT_NOCHECK_LOS|TGTOPT_HARMFUL|TGTOPT_NEUTRAL|TGTOPT_HELPFUL|POLCLASS_UOBJECT|POLCLASS_ITEM|POLCLASS_MOBILE|POLCLASS_NPC|POLCLASS_LOCKABLE|POLCLASS_CONTAINER|POLCLASS_CORPSE|POLCLASS_DOOR|POLCLASS_SPELLBOOK|POLCLASS_MAP|POLCLASS_MULTI|POLCLASS_BOAT|POLCLASS_HOUSE|POLCLASS_EQUIPMENT|POLCLASS_ARMOR|POLCLASS_WEAPON|RACE_HUMAN|RACE_ELF|RACE_GARGOYLE|_DEFAULT_TEXT_FONT|_DEFAULT_TEXT_COLOR|_DEFAULT_TEXT_REQUIREDCMD|_DEFAULT_REALM|REALM_BRITANNIA|REALM_BRITANNIA_ALT|REALM_ILSHENAR|REALM_MALAS|REALM_TOKUNO|REALM_TERMUR|ACTION_DIR_FORWARD|ACTION_DIR_BACKWARD|ACTION_NOREPEAT|ACTION_REPEAT|CANWALK_DIR|UPDATEMOBILE_RECREATE|UPDATEMOBILE_UPDATE|CLOSE_PAPERDOLL|CLOSE_STATUS|CLOSE_PROFILE|CLOSE_CONTAINER|CHARPROFILE_NO_UNEDITABLE_TEXT|CHARPROFILE_NO_EDITABLE_TEXT|DAMAGE_USE_REPSYS|DAMAGE_NO_REPSYS|DAMAGE_NO_SHOW|DAMAGE_SHOW|DAMAGE_USE_DEFAULT|RECALC_INTRINSIC_MOD|RECALC_NO_INTRINSIC_MOD|RECALC_VITALS|RECALC_NO_VITALS|SHARD_NAME|SHARD_WWWMAIN|SHARD_WWWRULES|SHARD_BUGSADDR|SHARD_HELPADDR|SHARD_MAILADDR|SHARD_WIKI|SHARD_TICKETS|SHARD_FORUM)\b'
scope: constant.language.polscript
modules:
- match: '(?i)(use)\s(attributes|basic|basicio|boat|cfgfile|cliloc|datafile|file|guild|http|math|npc|os|party|polsys|storage|mysql|unicode|uo|util|vitals)'
captures:
1: entity.name.namespace.polscript
2: support.class.polscript
includes:
- match: '(?i)(include)\s(\"[\:\/\w\s]+\")'
captures:
1: entity.name.namespace.polscript
2: string.quoted.double.polscript
# GENERAL
numbers:
- match: '(?i)\b0x[0-9ABCDEF]+\b'
scope: constant.numeric.hex.polscript
- match: '\b[0-9]+\.[0-9]+\b'
scope: constant.numeric.float.polscript
- match: '\b[0-9]+\b'
scope: constant.numeric.integer.polscript
operators:
- match: '(:=|\+=|-=|->)'
scope: keyword.operator.assignment.polscript
- match: '(\+|-|\*|/)'
scope: keyword.operator.arithmetic.polscript
- match: '(?i)(&&|\band\b|\|\||\bor\b|\bnot\b)'
scope: keyword.operator.bitwise.polscript
- match: '(==|!=|!|<=|<|>=|>)'
scope: keyword.operator.logical.polscript
- match: ;
scope: keyword.operator.polscript
strings:
# Strings begin and end with quotes, and use backslashes as an escape
# character.
- match: '"'
scope: punctuation.definition.string.begin.polscript
push: inside_string_double
inside_string_double:
- meta_include_prototype: false
- meta_scope: string.quoted.double.polscript
- match: '"'
scope: punctuation.definition.string.end.polscript
pop: true
- include: htmltags
htmltags:
- match: '(?i)<br>'
scope: support.class.polscript
- match: '(?i)<(\/)?(h[1-5]|b|i|u|center|body)>'
scope: support.class.polscript
- match: '(?i)<basefont'
scope: support.class.polscript
push:
- match: '(?i)(color=)((#)([0-9ABCDEF]{2})([0-9ABCDEF]{2})([0-9ABCDEF]{2})|\w*)'
captures:
1: entity.name.namespace.polscript
2: keyword.other.polscript
3: entity.name.namespace.polscript
4: keyword.other.polscript
5: entity.name.namespace.polscript
6: constant.numeric.hex.polscript
- match: '(?i)(face=)(UO_(Runic|Gargish)_(12|16|20)pt|[0-9]+)'
captures:
1: entity.name.namespace.polscript
2: keyword.other.polscript
- match: '(?i)(size=)([0-9]+)'
captures:
1: entity.name.namespace.polscript
2: keyword.other.polscript
- match: '>'
scope: support.class.polscript
pop: true
- match: '(?i)<\/basefont>'
scope: support.class.polscript
- match: '(?i)(<div)((\s(align=(left|center|right)))*)(>)'
captures:
1: support.class.polscript
2: entity.name.namespace.polscript
6: support.class.polscript
- match: '(?i)<\/div>'
scope: support.class.polscript
- match: '(?i)(<a)(\s((href=)(\w*))*)(>)'
captures:
1: support.class.polscript
2: entity.name.namespace.polscript
5: keyword.other.polscript
6: support.class.polscript
- match: '(?i)<\/a>'
scope: support.class.polscript
comments:
# Comments begin with a '//' and finish at the end of the line.
- match: '(//|#)'
scope: punctuation.definition.comment.polscript
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.double-slash.polscript
- match: $\n?
pop: true
# Comments begin with a '/*' and finish with '*/'.
- match: '/\*'
scope: punctuation.definition.comment.polscript
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.block.polscript
- match: '\*/'
pop: true