Strongly-typed AST types for Ruby, auto-generated from
tree-sitter-ruby's node-types.json.
This crate is generated by treesitter-types and is
automatically kept up to date when a new version of the grammar crate is released.
These types have been tested by parsing the Rails source code.
See the Tree-sitter project for more information about the underlying parser framework.
Example
use *;
// A minimal Ruby hello-world program.
let src = b"\
def greet(name)
puts \"Hello, #{name}!\"
end
greet(\"World\")
";
// Parse the source with tree-sitter and convert into typed AST.
let mut parser = new;
parser.set_language.unwrap;
let tree = parser.parse.unwrap;
let program = from_node.unwrap;
// The program has two top-level children:
// a method definition and a method call.
assert_eq!;
// Both statements start at column 0.
assert_eq!;
assert_eq!;
assert!;