Package org.ek9lang.compiler.repair.expressions
package org.ek9lang.compiler.repair.expressions
THE string-expression primitives the selection- and cursor-driven editors share (was the one grab-bag
StringExpressionClassifier): the + chain (IsAddExpression,
WholeAddChain), the single String literal
(StringLiteralOf,
IsSingleStringLiteral), and the finders - by selection
(ExpressionSpanningSelection) or by cursor
(ExpressionAtCursor,
ConcatAtCursor,
StringLiteralAtCursor,
TextMethodAtCursor), all over
SmallestExpression. Used by the string-concat rewrite, the E11068
repair, the MCP literal extractor and the IDE's right-click menu. Each is stateless: hold one.-
ClassDescriptionTHE whole
+chain (WholeAddChain) round the cursor: the smallest binary+expression containing it, then its chain (wasStringExpressionClassifier.findEnclosingConcatExpression).Does a rule's token range contain the cursor (line, col)? Both 1-based, the end inclusive.THE smallestEK9Parser.ExpressionContextwhose token range CONTAINS the cursor (line, col), 1-based - "what expression is the cursor inside" without an explicit selection (wasStringExpressionClassifier.findExpressionAtCursor;ExpressionSpanningSelectionis the exact-range form).THE smallestEK9Parser.ExpressionContextwhose token range exactly matches a selection - itsTokenRangeOfis[startLine, startCol, endLine, endCol], all 1-based (wasStringExpressionClassifier.findSmallestEnclosingExpression).Is this expression's outer operator a binary+with two operand expressions? THE "this is a concat chain" gate of the string-expression editors (wasStringExpressionClassifier.isAddExpression).Is this expression a single string-literal primary - double-quoted or backtick interpolation? The rewriter's idempotency check and the extractor's admission gate (wasStringExpressionClassifier.isSingleStringLiteral).Does the first rule's character span lie within the second's and differ from it - is it strictly smaller? (Was two identical private copies inStringExpressionClassifier.) By character index, not by tree ancestry - that isIsWithin.THE walk every string-expression finder shares: the smallestEK9Parser.ExpressionContextunder a root that passes a test, or null.THE smallest expression that both contains the cursor and is a single string literal (IsSingleStringLiteral; wasStringExpressionClassifier.findEnclosingStringLiteralExpression).THEstringLitof an expression that is a single string literal (double-quoted or backtick), or null when the expression is not one (wasStringExpressionClassifier.extractStringLit).THE text method round the cursor: the smallestEK9Parser.TextBodyDeclarationContextcontaining it, with the name of its enclosingEK9Parser.TextDeclarationContext(wasStringExpressionClassifier.findEnclosingTextMethodDeclaration).The resolved text-type and method names, ready to feed straight intoek9_edit_localized_textastextTypeName/methodName.THE token-range bounds of an expression as 1-based (line, col) coordinates,[startLine, startCol, endLine, endCol], inclusive on both ends - the shape MCP-tool selection parameters expect; null when the expression has missing token data (wasStringExpressionClassifier.tokenRange).THE whole+chain a+expression is part of - use it, never a private climb:+groups left to right, so"Hello " + name + "!"is("Hello " + name) + "!", and the chain is the outermost+reached by climbing while the parent is still one.