[web-devel] ANN, WARNING: new boomerang 1.3.0 silently breaks your code

Jeremy Shaw jeremy at n-heptane.com
Mon Mar 5 01:43:45 CET 2012


I just uploaded boomerang-1.3.0. The only change is that 'anyString'
no longer has an implied 'eos'.

It is common to want to write:

> rPair . anyString </> anyString

to parse, ["foo","bar"] to ("foo","bar") or to unparse ("foo","bar")
to ["foo","bar"].

however, that did not work before because anyString implied eos. So
you actually had to write the less obvious:

> rPair . anyString . anyString

to get similar behavior. I have changed 'anyString' so that it no
longer implies 'eos', which means that the first example now works as
expected.

Unfortunately, it means that any parsers currently using anyString
will (probably) start failing.

There is also a second downside. The new behavior of:

> rPair . anyString . anyString

is somewhat ill defined. That is because unparse will convert
("foo","bar") to ["foobar"]. But when you try to parse ["foobar"], you
get ("foobar","").

In general you should always follow 'anyString' by 'eos' or </>.
Unfortunately, I do not see a way to enforce that at compile time.

Something to think about for boomerang 2 though.

- jeremy



More information about the web-devel mailing list