Class OperatorPositionMap
java.lang.Object
org.ek9lang.compiler.common.OperatorPositionMap
Maps EK9 operators to their syntactic position (prefix vs suffix/postfix).
Used to detect when operators are used in the wrong position and provide helpful error messages.
In EK9:
- PREFIX operators come BEFORE the expression:
#< list,$ value,~ number - SUFFIX operators come AFTER the expression:
value?
Common mistakes this helps detect:
list#<instead of#< listvalue$instead of$value?valueinstead ofvalue?
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPositionSensitiveOperator(String operator) Check if this is a position-sensitive operator (either prefix or suffix).static booleanisPrefixOperator(String operator) Check if an operator is a prefix operator (must come BEFORE expression).static booleanisSuffixOperator(String operator) Check if an operator is a suffix operator (must come AFTER expression).
-
Method Details
-
isPrefixOperator
Check if an operator is a prefix operator (must come BEFORE expression). -
isSuffixOperator
Check if an operator is a suffix operator (must come AFTER expression). -
isPositionSensitiveOperator
Check if this is a position-sensitive operator (either prefix or suffix).
-