method

parse

ruby latest stable - Class: RubyVM::AbstractSyntaxTree

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

parse(p1)
public

Parses the given string into an abstract syntax tree, returning the root node of that tree.

SyntaxError is raised if the given string is invalid syntax.

RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 1:9): >