This represents the result of a call to ::parse or ::parse_file. It contains the AST, any comments that were encounters, and any errors that were encountered.

Attributes
Read

The value that was generated by parsing. Normally this holds the AST, but it can sometimes how a list of tokens or other results passed back from the parser.

Read

The list of comments that were encountered during parsing.

The list of magic comments that were encountered during parsing.

Read

An optional location that represents the location of the content after the __END__ marker. This content is loaded into the DATA constant when the file being parsed is the main file being executed.

Read

The list of errors that were generated during parsing.

Read

The list of warnings that were generated during parsing.

Read

A Source instance that represents the source code that was parsed.

Class Methods

Create a new parse result object with the given values.

Instance Methods

Attach the list of comments to their respective locations in the tree.

Implement the hash pattern matching interface for ParseResult.

Returns true if there were errors during parsing and false if there were not.

Walk the tree and mark nodes that are on a new line.

Returns true if there were no errors during parsing and false if there were.