Skip to content

Syntax patterns

Mwexim edited this page Dec 29, 2021 · 8 revisions

The real power of Skript comes from its intuitive design, mainly featuring the feature-rich syntax that feels really close to plain English. To achieve this, Skript has a lot of functionalities in place to create 'syntax patterns'. Each pattern can consist of multiple elements that interact with each other. The user will make the final decision on how he will use the different patterns in his code.

This means that the developer can create multiple possibilities, while the user can choose which to use and how to use it. Both parties are happy!

If you want to learn how the patterns are actually matched against each other, together with a briefer explanation of the different pattern elements, refer to 'Pattern matching'.

Creating syntax patterns

Developers can choose between multiple types of elements. These elements together will form the pattern. The user input will be matched, line by line, against the stored elements. Each element has its own strategy when matching. If a match fails, the parser moves on to the next pattern.

Text elements

Text elements consist of a plain text instance. The matched string must contain every character of this text instance, otherwise the match

Clone this wiki locally