File tree Expand file tree Collapse file tree
src/main/java/org/skriptlang/skript/lang/simplification Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import ch .njol .skript .lang .SyntaxElement ;
55import org .bukkit .event .Event ;
66
7+ /**
8+ * Represents an object that can be simplified to a simpler {@link SyntaxElement}. For example, a complex math equation
9+ * can be simplified to a single number {@link ch.njol.skript.lang.Literal} if all the inputs are
10+ * {@link ch.njol.skript.lang.Literal}s.
11+ * <br>
12+ * Simplification should never invalidate contracts. For example, any simplified expression should take care to return
13+ * the same or a more specific type than the original expression, never a more generic type. Likewise, be sure to
14+ * maintain the behavior of change() and acceptsChange(). Failure to do so can result in unexpected behavior and
15+ * tricky bugs.
16+ * @param <S> the type of the simplified object
17+ */
718public interface Simplifiable <S extends SyntaxElement > {
819
920 /**
You can’t perform that action at this time.
0 commit comments