Class: JsxRosetta::AST::File

Inherits:
Node
  • Object
show all
Defined in:
lib/jsx_rosetta/ast/types.rb

Overview

Subclasses for the Babel node types where named accessors carry their weight (mostly the JSX subtree). Other Babel types fall through to the generic Node class — they’re still walkable, pattern-matchable, and field-addressable, just without bespoke methods.

As lowering passes need more ergonomic access to specific node fields, add a class here. Don’t pre-emptively wrap every Babel type.

Constant Summary

Constants inherited from Node

Node::TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Node

#raw

Instance Method Summary collapse

Methods inherited from Node

#==, #[], #children, #deconstruct_keys, #dig, #each_child, #end_pos, #hash, #initialize, #inspect, #loc, #range, register, #start_pos, #type, #walk, wrap

Constructor Details

This class inherits a constructor from JsxRosetta::AST::Node

Instance Method Details

#programObject



18
19
20
# File 'lib/jsx_rosetta/ast/types.rb', line 18

def program
  self[:program]
end