Re: Parser changes for supporting top-level SCC annotations

2016-07-19 Thread Ömer Sinan Ağacan
2016-07-19 9:57 GMT+00:00 Simon Peyton Jones : > Is there a ticket? A wiki page with a specification? I updated the user manual. There's no wiki, it just adds supports for SCC annotations at the top-level. ___ ghc-devs mailing

RE: Parser changes for supporting top-level SCC annotations

2016-07-19 Thread Simon Peyton Jones via ghc-devs
hanges for supporting top-level SCC annotations | | I managed to do this without introducing any new pragmas. I added a | new production that doesn't look for SCC annotations, for top-level | expressions. I then used it in decl_no_th and topdecl. | | I'm not sure if I broke anything though. I'll va

Re: Parser changes for supporting top-level SCC annotations

2016-07-19 Thread Ben Gamari
Ömer Sinan Ağacan writes: > I managed to do this without introducing any new pragmas. I added a new > production that doesn't look for SCC annotations, for top-level expressions. I > then used it in decl_no_th and topdecl. > Yay! I'll admit I wasn't a fan of the

Re: Parser changes for supporting top-level SCC annotations

2016-07-19 Thread Ömer Sinan Ağacan
I managed to do this without introducing any new pragmas. I added a new production that doesn't look for SCC annotations, for top-level expressions. I then used it in decl_no_th and topdecl. I'm not sure if I broke anything though. I'll validate in slow mode now. Patch is here:

Re: Parser changes for supporting top-level SCC annotations

2016-06-01 Thread Ömer Sinan Ağacan
I was actually trying to avoid that, thinking that it'd be best if SCC uniformly worked for top-levels and expressions. But then this new form: {-# SCC f "f_scc" #-} Would only work for toplevel SCCs.. So maybe it's OK to introduce a new pragma here. 2016-06-01 8:13 GMT-04:00 Richard

Re: Parser changes for supporting top-level SCC annotations

2016-06-01 Thread Richard Eisenberg
What about just using a new pragma? > {-# SCC_FUNCTION f "f_scc" #-} > f True = ... > f False = ... The pragma takes the name of the function (a single identifier) and the name of the SCC. If you wish both to have the same name, you can leave off the SCC name. It seems worth it to me to

Parser changes for supporting top-level SCC annotations

2016-05-30 Thread Ömer Sinan Ağacan
I'm trying to support SCCs at the top-level. The implementation should be trivial except the parsing part turned out to be tricky. Since expressions can appear at the top-level, after a {-# SCC ... #-} parser can't decide whether to reduce the token in `sigdecl` to generate a `(LHsDecl (Sig