Module | Parslet::Atoms::CanFlatten |
In: |
lib/parslet/atoms/can_flatten.rb
|
A series of helper functions that have the common topic of flattening result values into the intermediary tree that consists of Ruby Hashes and Arrays.
This module has one main function, flatten, that takes an annotated structure as input and returns the reduced form that users expect from Atom#parse.
NOTE: Since all of these functions are just that, functions without side effects, they are in a module and not in a class. Its hard to draw the line sometimes, but this is beyond.