public final class ParenAndCommaRules extends Object implements LayoutRule
GFmtOpt.selectColumnlistComma.
Only top-level list commas are stacked: a comma whose paren (block)
depth equals the depth of its clause run's first token. This excludes commas
inside function arguments (count(a, b)) or nested parens — the
"nested paren handling" of S26.
Stacking only happens when GFmtOpt.selectColumnlistStyle is
TAlignStyle.AsStacked (the default). TAlignStyle.AsWrapped
(width-based wrapping) is deferred. Comma placement:
LfAfterComma — break before the next item (comma trails the line);LfBeforeComma — break before the comma (comma leads the next line);LfbeforeCommaWithSpace — break before the comma, with a leading space.Priority LayoutPriorities.JOIN_PAREN_COMMA. Needs the S19 block,
S20 sql, and S21 clause analyses attached to the context. Iterative; read-only.
Plan reference: §7.3/S26, §7.4/S26.
| Constructor and Description |
|---|
ParenAndCommaRules() |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(LayoutContext context)
Apply the rule, requesting layout decisions on the context.
|
String |
name()
Short, stable identifier for logging/diagnostics.
|
int |
priority()
The rule's precedence.
|
public ParenAndCommaRules()
public int priority()
LayoutRulepriority in interface LayoutRulepublic String name()
LayoutRulename in interface LayoutRulepublic void apply(LayoutContext context)
LayoutRuleapply in interface LayoutRule