TriviaPlacement Module
Placement rules for trivia attached before declarations.
Functions and values
| Function or value |
Description
|
Full Usage:
TriviaPlacement.before node trivia
Parameters:
NodeBase
trivia : TriviaNode
Returns: TriviaNode
|
Applies ownLine when the node is a declaration and leaves trivia on other nodes, such as expressions, untouched.
|
|
|
Full Usage:
TriviaPlacement.declarationSingleNode node
Parameters:
ExprSingleNode
Returns: ExprSingleNode
|
An expression such as `do ...` gets its trivia while it is still an expression and only becomes a declaration when it is yielded into a class or module; returns a copy whose leading block comments are on their own line.
|
|
A block comment printed on the same line as a declaration pushes the declaration's keyword to the right, which breaks the offside rule for every declaration except the first one; keep it on its own line instead.
|
Fabulous.AST