[Git][ghc/ghc][wip/T18599] add AnnDot annotation to getField calc
Shayne Fletcher
gitlab at gitlab.haskell.org
Sun Oct 11 22:59:17 UTC 2020
Shayne Fletcher pushed to branch wip/T18599 at Glasgow Haskell Compiler / GHC
Commits:
47f0d165 by Shayne Fletcher at 2020-10-11T18:59:07-04:00
add AnnDot annotation to getField calc
- - - - -
1 changed file:
- compiler/GHC/Parser.y
Changes:
=====================================
compiler/GHC/Parser.y
=====================================
@@ -2619,19 +2619,17 @@ fexp :: { ECP }
-- See Note [Whitespace-sensitive operator parsing] in Lexer.x
| fexp TIGHT_INFIX_PROJ field
{% do { ; $1 <- runPV (unECP $1)
- -- Suppose lhs is an application term e.g. 'f a' and
- -- rhs is '.b'. Usually we want the parse 'f
- -- (a.b)' rather than '(f a).b.'. However, if lhs is
- -- a projection 'r.a' (say) then we want the parse
- -- '(r.a).b'.
- ; return . ecpFromExp $ case $1 of
- L _ (HsApp _ f arg)
- | not $ isGetField f ->
- let l = (comb2 arg $3) in
- L (getLoc f `combineSrcSpans` l)
- (HsApp noExtField f (mkGetField l arg $3))
- _ -> mkGetField (comb2 $1 $>) $1 $3
- }}
+ -- Suppose lhs is an application term e.g. 'f a'
+ -- and rhs is '.b'. Usually we want the parse 'f
+ -- (a.b)' rather than '(f a).b.'. However, if lhs
+ -- is a projection 'r.a' (say) then we want the
+ -- parse '(r.a).b'.
+ ; fmap ecpFromExp $ ams (case $1 of
+ L _ (HsApp _ f arg) | not $ isGetField f ->
+ let l = (comb2 arg $3) in
+ L (getLoc f `combineSrcSpans` l)
+ (HsApp noExtField f (mkGetField l arg $3))
+ _ -> mkGetField (comb2 $1 $>) $1 $3) [mj AnnDot $2] }}
| aexp { $1 }
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/47f0d165ffe4c0df16c10a8fbc5f7e9ba5c8dc19
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/47f0d165ffe4c0df16c10a8fbc5f7e9ba5c8dc19
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201011/bf8e11cb/attachment-0001.html>
More information about the ghc-commits
mailing list