Package ch.njol.skript.lang.parser
Class ExpressionParseCache
java.lang.Object
ch.njol.skript.lang.parser.ExpressionParseCache
A scoped cache for failed expression parse attempts.
Each parseExpression call pushes a new scope via push().
Failures cached within that scope are isolated from parent scopes,
ensuring that recursive sub-expression parsing does not interfere
with the parent's cache. The scope is removed via pop()
when the parseExpression call completes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA record representing a failed expression parse attempt. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ExpressionParseCache.Failure failure) Caches a failure in the current scope.voidclear()Clears all scopes.booleancontains(ExpressionParseCache.Failure failure) Checks whether the given failure is cached in the current scope.voidpop()Pops the current cache scope.voidpush()Pushes a new cache scope.
-
Constructor Details
-
ExpressionParseCache
public ExpressionParseCache()
-
-
Method Details
-
push
public void push()Pushes a new cache scope. Call at the start ofparseExpression. -
pop
public void pop()Pops the current cache scope. Call at the end ofparseExpression. -
contains
Checks whether the given failure is cached in the current scope. -
add
Caches a failure in the current scope. -
clear
public void clear()Clears all scopes.
-