Simplified API for parsing arbitrary _nt_ productions #9

wants to merge 1 commit into


None yet
3 participants

A simple modification in one line gives parse a root option. With it one can simply type

  def setup ; @parser = ; end
  result = @parser.parse text, root: :function

instead of

  @parser.root = "function"
  result = @parser.parse text
  @parser.root = "program"

The existing/old interface is unchanged, so no code breaks.

anibali commented Nov 4, 2010

I too would like to see this nicety included, particularly for writing tests.


cjheath commented Nov 22, 2010

Sorry it took time to incorporate - you provided no test and hadn't done the equivalent thing with consume_all_input. The latest GH version and gem contain both these, with tests.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment