marcelog / ex_abnf

Parser for ABNF Grammars
Apache License 2.0
61 stars 12 forks source link

Missing clause in `Interpreter.num_concat` #11

Open niahoo opened 8 years ago

niahoo commented 8 years ago

Hi,

I have a bug with my grammar, but maybe it is a bug in you code. Sometimes num_concat is called with a list and no_input. So I added this clause and it works well :

  defp num_concat(_, [], _) do
    nil
  end
marcelog commented 8 years ago

Hello,

Please open a pull request with the fix, and add a unit test for the new code with a minimal example that reproduces it (grammar and/or any other code needed).

Thanks!

niahoo commented 8 years ago

Well I would like to, but I'm not sure what you code does there.

I think that there are bugs in my grammar file, but it's weird that ex_abnf fails this way whereas other grammar errors are handled properly.

I'll try to run the tests and let you know.

Edit: your test suite passes with the change. But I have no clue how to provide a valid use case to test it. It happens when the code tries to match stuff but it reaches end of input. (Not really sure about that).