haskell / happy

The Happy parser generator for Haskell
Other
276 stars 84 forks source link

%shift pragma for lowest priority rules #153

Closed int-index closed 4 years ago

int-index commented 4 years ago

GHC Merge Request 1856 resolves shift/reduce conflicts in GHC by using the precedence machinery of happy, marking certain rules as %prec shift.

However, the downside of this approach is that it requires a listing of all lookahead tokens. With a dedicated pragma %shift, we can avoid this.

bgamari commented 4 years ago

https://gitlab.haskell.org/ghc/ghc/merge_requests/1867 is currently blocked on a release with this.

int-index commented 4 years ago

The AppVeyor CI failure is unrelated to the patch and is fixed in #154

goldfirere commented 4 years ago

This looks like it's a user-facing feature addition to happy. Have you updated the manual?

simonmar commented 4 years ago

I'd be happy to merge this, but can we have documentation and a test please?

int-index commented 4 years ago

I'd be happy to merge this, but can we have documentation and a test please?

I'm on it – setting up DocBook locally proved to be a bit of a challenge. Will push an update today.

int-index commented 4 years ago

There's a test case and a section in the manual now.

goldfirere commented 4 years ago

As someone who has taught happy to undergraduates, I have an interest in a clear manual. And that interest is satisfied by this change -- thanks @int-index.