-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrpl.sublime-syntax
49 lines (46 loc) · 5.54 KB
/
crpl.sublime-syntax
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
%YAML 1.2
---
#
name: CRPL
comment: "Creeper Reverse Polish Language Syntax: version 1.1
Multiple matches were used from: https://knucklecracker.com/forums/index.php?topic=14272.0"
file_extensions: [crpl]
scope: source.crpl
contexts:
main:
- match: '#.*$'
scope: comment.line.double-dash.crpl
- match: '\$(\w+):(?=\S)'
captures:
0: keyword.operator.crpl
1: variable.language.crpl
- match: ':\w+'
scope: entity.name.function
- match: '@\w+'
scope: support.function.crpl
- match: '(\->|<\-|\-\-|\-\?)(\w+)|(\-\-\?|\-\?!|<\-!|\->!)'
captures:
1: keyword.operator.crpl
2: variable.language.crpl
3: keyword.operator.crpl
- match: '\b(gte|gt|lte|lt|eq0|neq0|eq|neq|swap|dup2|dup|pop|ClearStack|StackSize|add|sub|mul|div|mod|abs|round|min|max|floor|ceil|sin|cos|tan|asint|acos|atan2|atan|pow|log10|ln|log|PI|E|ShortestAngle|asfloat|asin|approximately|neg|and|or|xor|not|f|sqrt)\b'
scope: keyword.operator.crpl
- match: '(?i)\b(CreateList|GetListElement|SetListElement|AppendToList|PrependToList|InsertListElement|RemoveListElement|AppendStackToList|GetListCount|GetTimer0|GetTimer1|GetTimer2|GetTimer2|SetTimer0|SetTimer1|SetTimer2|SetTimer3|GetKeyDown|GetKeyUp|GetKey|GetMouseButtonUp|GetMousePosition|GetMouseCell|QueueMove|GetQueuedMoveCount|AbortMove|SuspendMove|ClearQueuedMoves|GetWall|SetWall|GetVoid|SetVoid|IsTerrainLOS|Self|GetUnitAttribute|SetUnitAttribute|CurrentCoords|CurrentX|CurrentY|SetCurrentCoords|SetCurrentX|SetCurrentY|GetUnitCountInRange|GetCommandNodeCount|RandUnitCoords|GetUnitsInRange|GetEnemyUnitsInRange|GetCoresWithVar|CreateUnit|GetUnitType|GetUnitAt|ArtifactCollected|GetTechLimit|SetTechLimit|SetBuildLimit|CreateMist|GetScore|SetScore|GetAdditionalScore|AddAdditionalScore|AddScriptToUnit|GetScriptVar|SetScriptVar|SetImagePositionX|SetImagePositionY|SetImagePositionZ|SetImagePosition|SetImageScaleX|SetImageScaleY|SetImageScale|SetImageRotation|SetImageColor|SetImage|GetImagePositionX|GetImagePositionY|GetImagePositionZ|GetImagePosition|GetImageScaleX|GetImageScaleY|GetImageScale|GetImageRotation|GetImageColor|PlaySound|AddCreeper|SetCreeperNoLower|IsCreeperInRange|SetCreeperFlowRateRL|SetCreeperFlowRateUD|SetCreeperFlowRateOnDigitalisRL|SetCreeperFlowRateOnDigitalisUD|SetCreeperFlowRateOnDigitalis|SetCreeperFlowRate|SetCreeperEvaporationLimit|GetDeepestCreeperCell|GetPinFieldCell|SetPinFieldCell|SetFieldCell|GetFieldCell|SetCreeperColors|GetCreeperColors|GetCreeper|IsDigitalisConnected|GetDigitalisGrowth|SetDigitalisGrowth|CreateSpore|CreateRunner|GetRunnerCount|GetGlobalRunnerCount|Trace2|Trace3|Trace4|Trace5|TraceStack|Trace|ShowTraceLog|ClearTraceLog|HideTraceLog|AddConversationMessage|ShowConversation|ClearConversation|DestroyConversation|Destroy|MapHeight|MapWidth|ScreenHeight|ScreenWidth|ShowMessageDismissible|WasMessageDismissed|RandFloat|RandInt|RandXCoord|RandYCoord|RandCoordsInRange|RandCoords|CellToPixel|PixelToCell|Distance|GetUpdateCount|IsEditMode|ElapsedTime|ResetGameTime|InvocationCount|Concat|Substring|StartsWith|EndsWith|Split|StringToList|SetPopupTextAlwaysVisible|AscendToOrbit|ClearLocals|CreateEffectClipped|CreateEffect|CreateListStartingSize|CurrentPizelCoords|DamageCreeper|Damage|DisableTowerField|DropFromOrbit|EnableAlternateControlMode|EnableNormalZoomControl|EnableTowerField|FailMission|GetAllUnitsInRange|GetCameraZoom|GetCellOccupiedCount|GetCurrentBuildTab|GetDigitalisRaw|GetDigitalis|GetMouseButtonDown|GetMouseButton|GetMouseScreenPosition|GetMouseScreenPixelPosition|GetTechArtifactType|GetterrainOverride|GetTerrain|IsPaused|MakeRain|NotPersist|OperateWhilePaused|PauseGame|PersistCore|PrependStackToList|SetAdditionalScore|SetCameraZoom|SetCellOccupiedCount|SetCreeperMax|SetCreeper|SetDigitalisRaw|SetDigitalis|SetGameTimeFrames|SetPopupTextX|SetPopupTextY|SetPopupText|SetSystemInhibited|SetTechArtifactType|SetTerrainOverride|SetTerrain|SetTextAnchor|SetTextColor|SetTextSize|SetTextX|SetTextY|SetText|SetUnitSelectableOverride|SetWind|ShowGameEventTag|ShowMessageDialog|ShowMessage|StringLength|ToLower|UnpauseGame|SetScreenMode|SetScreenCoordX|SetScreenCoordY|SetScreenCoords|SetScreenPixelCoordY|SetScreenPixelCoordX|SetScreenPixelCoords|GetCameraPosition|SetCameraPosition|IsMessageDialogShowing)\b'
scope: support.function.crpl
- match: '\b(once|endonce|if|else|endif|do|loop|I|J|K|while|repeat|endwhile|break|return|delay)\b'
scope: keyword.control.crpl
- match: '\b(CONST_ACPACKETREQUESTDELAY|CONST_AMMOAC|CONST_AMMO|CONST_BUILDCOST|CONST_CANREQUESTAMMO|CONST_CELLHEIGHT|CONST_CELLWIDTH|CONST_CONNECTABLE|CONST_COORDX|CONST_COORDY|CONST_COUNTSFORVICTORY|CONST_CREATEPZ|CONST_DESTROYMODE|CONST_DESTROYONDAMAGE|CONST_HEALRATE|CONST_HEALTH|CONST_ISBUILDING|CONST_ISDESTROYED|CONST_ISLANDED|CONST_MAXAMMOAC|CONST_MAXAMMO|CONST_MAXHEALTH|CONST_NULLIFIERDAMAGES|CONST_PACKETREQUESTDELAY|CONST_PIXELCOORDX|CONST_PIXELCOORDY|CONST_REQUESTACPACKETS|CONST_REQUESTPACKETS|CONST_SHOWAMMOACBAR|CONST_SHOWAMMOBAR|CONST_SHOWHEALTHBAR|CONST_SNIPERTARGET|CONST_SUPPORTSDIGITALIS|CONST_TAKEMAPSPACE|CONST_THORTARGET|CONST_SNIPERIGNORELOS)\b'
scope: constant.language.crpl
- match: '(?:-?(\d+(\.\d*)?|\.\d+))|(?:true|false|TRUE|FALSE)'
scope: constant.language.crpl
- match: "\"[^\"]*+\"|'[^']*+'"
scope: string.quoted.crpl
- match: '"'
captures:
0: punctuation.definition.string.begin.crpl
push:
- meta_scope: string.quoted.double.crpl
- match: '"'
captures:
0: punctuation.definition.string.end.crpl
pop: true