ParseTree will not work with ruby ​​1.9. What for?

According to this parsetree will not work in ruby ​​1.9. I have no experience in computer science, but I have been programming for several years. Can someone explain in a bit more detail why parsetree will not work in ruby ​​1.9.

+3
source share
3 answers

The ruby ​​1.8 interpreter is designed and then passed over the abstract syntax tree, while the ruby ​​1.9 interpreter is a bytecode. Therefore, parsetree does not have AST in runtime.

+3
source

ngty has published a gem called sourcify, which provides many ParseTree features in Ruby 1.9.

, sexp, . , , , Proc :

## The old ParseTree way
# proc.to_ruby
## The sourcify way - but may raise NoMatchingProcError or MultipleMatchingProcsPerLineError
# proc.to_source
## The sourcify way - giving :attached_to a symbol to help it find the correct Proc
proc.to_source :attached_to => :name_of_proc

, ParseTree Ruby 1.9.

+3

ParseTree seems to be dead due to some changes inside Ruby 1.9, according to this link: http://blog.zenspider.com/2009/04/parsetree-eol.html

Although, perhaps some people will come up with some workarounds for its part.

+2
source

Source: https://habr.com/ru/post/1717735/


All Articles