kschiess / parslet

A small PEG based parser library. See the Hacking page in the Wiki as well.
kschiess.github.com/parslet
MIT License
805 stars 95 forks source link

Transform rules should be inherited by subclasses. #127

Closed jturkel closed 9 years ago

jturkel commented 9 years ago

This changes allows transform rules to be inherited when subclassing a transform. Consider the following example:

class MyTransform < Parslet::Transform 
  rule(:a => simple(:x)) { ... }
  rule(:b => simple(:x)) { ... }
end

class MyTransformSubclass < MyTransform
  rule(:b => simple(:x)) { ... }
  rule(:c => simple(:x)) { ... }
end

MyTransformSubclass should inherit rule a, override rule b, and add rule c. This makes the behavior of subclassing a Parslet::Transform consistent with the behavior of subclassing a Parslet::Parser.

kschiess commented 9 years ago

Thanks for the contribution!

jturkel commented 9 years ago

No problem. Thanks for the awesome project. Any plans to release an updated gem soon?

kschiess commented 9 years ago

No, not currently. Check my twitter account for release notifications.