0.0
No commit activity in last 3 years
No release in over 3 years
rb-parsetree is the C extension part of ParseTree for Ruby 1.9. A patched version of Ruby 1.9.2 is required.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

rb-parsetree19

A C extension to support ParseTree in Ruby 1.9

Requirements

A patched version of Ruby 1.9.2 is needed. In fact the same patched version as needed by rb-threadframe (and thus trepanning).

Usage:

require 'parse_tree'
processor = ParseTree19.new(false)
processor.parse_tree_for_str('x=1; y=2', '(string'), 1)
  => [:scope, [:block, [:lasgn, :x, [:lit, 1]], [:block, [:lasgn, :y, [:lit, 2]]]]]
def five; 5 end
processor.parse_tree_for_method(method(:five), true)
  => [:scope, [:args, 0, [:args_aux]], [:lit, 5]]
puts processor.parse_tree_for_method(method(:five, false)
  => nil
###########################################################
## Do NOT use this node dump for any purpose other than  ##
## debug and research.  Compatibility is not guaranteed. ##
###########################################################

# @ NODE_SCOPE (line: 6)
# +- nd_tbl: (empty)
# +- nd_args:
# |   @ NODE_ARGS (line: 6)
# |   +- nd_frml: 0
# |   +- nd_next:
# |   |   @ NODE_ARGS_AUX (line: 6)
# |   |   +- nd_rest: (null)
# |   |   +- nd_body: (null)
# |   |   +- nd_next:
# |   |       (null node)
# |   +- nd_opt:
# |       (null node)
# +- nd_body:
#     @ NODE_LIT (line: 6)
#     +- nd_lit: 5