Class ExpressionElement
java.lang.Object
io.github.syst3ms.skriptparser.pattern.ExpressionElement
- All Implemented Interfaces:
PatternElement
A variable/expression, declared in syntax using %type%
Has :
- a
ListofPatternType - a field determining what type of values this expression accepts : literals, expressions or both (%*type%, %~type% and %type% respectively)
- a flag determining whether the expression resorts to default expressions or not, defaulting to null instead
- a flag determining whether the expression accepts condition expressions or not
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionExpressionElement(List<PatternType<?>> types, ExpressionElement.Acceptance acceptance, boolean nullable, boolean acceptsConditional) -
Method Summary
Modifier and TypeMethodDescriptionbooleanList<PatternType<?>> getTypes()intmatch(String s, int index, MatchContext context) Attempts to match thePatternElementto a string at a specified index.toString()
-
Constructor Details
-
ExpressionElement
public ExpressionElement(List<PatternType<?>> types, ExpressionElement.Acceptance acceptance, boolean nullable, boolean acceptsConditional)
-
-
Method Details
-
match
Description copied from interface:PatternElementAttempts to match thePatternElementto a string at a specified index. About the index, make sure to never increment the index by some arbitrary value when returning- Specified by:
matchin interfacePatternElement- Parameters:
s- the string to match this PatternElement againstindex- the index of the string at which this PatternElement should be matched- Returns:
- the index at which the matching should continue afterwards if successful. Otherwise, -1
-
equals
-
toString
-
getTypes
-