Module: ASTTransform::TransformationHelper

Included in:
AbstractTransformation, ThunkLowering
Defined in:
lib/ast_transform/transformation_helper.rb

Overview

The transform-authoring layer. Three shapes:

  • Constructors (+s+, s_at): type + children in, fresh node out.
  • The sequence combinator (+run_after+): sequence in, sequence out — the paved road for execution reordering.
  • The low-level reordering primitive (+thunk+): statements in, Thunk node out — for execution points inside expressions.

The contract these helpers serve: textual order is source order. The emitter places every loc-carrying statement at its source line; when execution order must differ from textual order, authors express it as a thunk instead of moving text.

Defined Under Namespace

Modules: Methods Classes: MissingLocationError

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



23
24
25
26
# File 'lib/ast_transform/transformation_helper.rb', line 23

def included(base)
  base.extend(Methods)
  base.include(Methods)
end