Skip to content

Commit

Permalink
Changed order of bultin functions, constants and operators in pattern…
Browse files Browse the repository at this point in the history
…s to always match the longest one (for example SetImageColor would match for SetImage)

Added \b at the end of those patterns to ensure the correct one would match (for example CreateListStartingSize would match as CreateList)
  • Loading branch information
KubeRoot committed Oct 3, 2017
1 parent f84a9f2 commit a7d1945
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crpl.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ contexts:
- match: '(\->|<\-)'
scope: keyword.operator.crpl

- match: 'gt|gte|lt|lte|eq|neq|eq0|neq0|swap|dup|dup2|pop|ClearStack|StackSize|add|sub|mul|div|mod|abs|round|min|max|floor|ceil|sin|cos|tan|asin|acos|atan|atan2|pow|log|ln|log10|PI|E|ShortestAngle|asfloat|asint|approximately|neg|CreateList|GetListElement|SetListElement|AppendToList|PrependToList|InsertListElement|RemoveListElement|GetListCount|and|or|xor|not|AppendStackToList|f|sqrt'
- match: '(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|CreateList|GetListElement|SetListElement|AppendToList|PrependToList|InsertListElement|RemoveListElement|GetListCount|and|or|xor|not|AppendStackToList|f|sqrt)\b'
scope: keyword.operator.crpl
- match: 'GetTimer0|GetTimer1|GetTimer2|GetTimer2|SetTimer0|SetTimer1|SetTimer2|SetTimer3|GetKey|GetKeyDown|GetKeyUp|GetMouseButton|GetMouseButtonUp|GetMousePosition|GetMouseCell|QueueMove|GetQueuedMoveCount|AbortMove|SuspendMove|ClearQueuedMoves|GetTerrain|SetTerrain|GetWall|SetWall|GetVoid|SetVoid|IsTerrainLOS|Self|GetUnitAttribute|SetUnitAttribute|CurrentCoords|CurrentX|CurrentY|SetCurrentCoords|SetCurrentX|SetCurrentY|GetUnitCountInRange|GetCommandNodeCount|RandUnitCoords|GetUnitsInRange|GetEnemyUnitsInRange|GetCoresWithVar|CreateUnit|Damage|Destroy|GetUnitType|GetUnitAt|ArtifactCollected|GetTechLimit|SetTechLimit|SetBuildLimit|CreateEffect|CreateMist|GetScore|SetScore|GetAdditionalScore|AddAdditionalScore|AddScriptToUnit|GetScriptVar|SetScriptVar|SetImage|SetImagePosition|SetImagePositionX|SetImagePositionY|SetImagePositionZ|SetImageScale|SetImageScaleX|SetImageScaleY|SetImageRotation|SetImageColor|GetImagePosition|GetImagePositionX|GetImagePositionY|GetImagePositionZ|GetImageScale|GetImageScaleX|GetImageScaleY|GetImageRotation|GetImageColor|PlaySound|AddCreeper|SetCreeperNoLower|IsCreeperInRange|SetCreeper|GetCreeper|SetCreeperFlowRate|SetCreeperFlowRateOnDigitalis|SetCreeperFlowRateRL|SetCreeperFlowRateUD|SetCreeperFlowRateOnDigitalisRL|SetCreeperFlowRateOnDigitalisUD|SetCreeperEvaporationLimit|GetDeepestCreeperCell|GetPinFieldCell|SetPinFieldCell|SetFieldCell|GetFieldCell|SetCreeperColors|GetCreeperColors|GetDigitalis|SetDigitalis|IsDigitalisConnected|GetDigitalisGrowth|SetDigitalisGrowth|CreateSpore|CreateRunner|GetRunnerCount|GetGlobalRunnerCount|Trace|Trace2|Trace3|Trace4|Trace5|TraceStack|ShowTraceLog|ClearTraceLog|HideTraceLog|AddConversationMessage|ShowConversation|ClearConversation|DestroyConversation|MapHeight|MapWidth|ScreenHeight|ScreenWidth|ShowMessage|ShowMessageDismissible|WasMessageDismissed|RandFloat|RandInt|RandCoords|RandXCoord|RandYCoord|RandCoordsInRange|CellToPixel|PixelToCell|Distance|GetUpdateCount|IsEditMode|ElapsedTime|ResetGameTime|InvocationCount|Concat|Substring|StartsWith|EndsWith|Split|StringToList|SetPopupText|SetPopupTextAlwaysVisible|AscendToOrbit|ClearLocals|CreateEffectClipped|CreateListStartingSize|CurrentPizelCoords|DamageCreeper|DisableTowerField|DropFromOrbit|EnableAlternateControlMode|EnableNormalZoomControl|EnableTowerField|FailMission|GetAllUnitsInRange|GetCameraZoom|GetCellOccupiedCount|GetCurrentBuildTab|GetDigitalisRaw|GetMouseButtonDown|GetMouseScreenPosition|GetMouseScreenPixelPosition|GetTechArtifactType|GetterrainOverride|IsPaused|MakeRain|NotPersist|OperateWhilePaused|PauseGame|PersistCore|PrependStackToList|SetAdditionalScore|SetCameraZoom|SetCellOccupiedCount|SetCreeperMax|SetDigitalisRaw|SetGameTimeFrames|SetPopupTextX|SetPopupTextY|SetSystemInhibited|SetTechArtifactType|SetTerrainOverride|SetText|SetTextAnchor|SetTextColor|SetTextSize|SetTextX|SetTextY|SetUnitSelectableOverride|SetWind|ShowGameEventTag|ShowMessageDialog|StringLength|ToLower|UnpauseGame'
- match: '(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)\b'
scope: support.function.crpl
- match: 'once|endonce|if|else|endif|do|loop|I|J|K|while|repeat|endwhile|break|return|delay'
- match: '(once|endonce|if|else|endif|do|loop|I|J|K|while|repeat|endwhile|break|return|delay)\b'
scope: keyword.control.crpl
- match: 'CONST_ACPACKETREQUESTDELAY|CONST_AMMO|CONST_AMMOAC|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_MAXAMMO|CONST_MAXAMMOAC|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'
- match: '(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'
Expand Down

0 comments on commit a7d1945

Please sign in to comment.