diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-10-30 08:44:34 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-11-27 11:32:18 +0300 |
commit | 8168b42a95ddf37c56958955eef065eb8747470f (patch) | |
tree | a677a67987372dac9732ea67f6ab37a77c02641a /testsuite/tests/plugins/simple-plugin | |
parent | 5a08f7d405bbedfdc20c07f64726899f594e9d07 (diff) | |
download | haskell-wip/whitespace-and-lookahead.tar.gz |
Whitespace-sensitive bang patterns (#1087, #17162)wip/whitespace-and-lookahead
This patch implements a part of GHC Proposal #229 that covers five
operators:
* the bang operator (!)
* the tilde operator (~)
* the at operator (@)
* the dollar operator ($)
* the double dollar operator ($$)
Based on surrounding whitespace, these operators are disambiguated into
bang patterns, lazy patterns, strictness annotations, type
applications, splices, and typed splices.
This patch doesn't cover the (-) operator or the -Woperator-whitespace
warning, which are left as future work.
Diffstat (limited to 'testsuite/tests/plugins/simple-plugin')
-rw-r--r-- | testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs index fce8b7d136..0d7e44b4b6 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs @@ -52,6 +52,7 @@ typecheckPlugin [name, "typecheck"] _ tc typecheckPlugin _ _ tc = return tc metaPlugin' :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc) +metaPlugin' opts (L l (HsPar x e)) = (\e' -> L l (HsPar x e')) <$> metaPlugin' opts e metaPlugin' [name, "meta"] (L _ (HsApp noExt (L l (HsVar _ (L _ id))) e)) | occNameString (getOccName id) == name = return e |