summaryrefslogtreecommitdiff
path: root/compiler/parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Make datatype contexts an extension (on by default) (DatatypeContexts)Ian Lynagh2010-07-073-8/+24
|
* Handle haddock headers when looking for LANGUAGE/OPTIONS_GHC pragmasIan Lynagh2010-07-071-1/+1
|
* Make pragState call mkPState, rather than duplicating everythingIan Lynagh2010-07-061-19/+3
| | | | | This also means that extsBitmap gets set, whereas is was just being set to 0 before.
* Make mkPState and pragState take their arguments in the same orderIan Lynagh2010-07-061-3/+4
|
* Remove an out-of-date commentIan Lynagh2010-07-061-1/+0
|
* Remove dead code (standalone deriving flag no longer used in parser)Ian Lynagh2010-07-011-6/+1
|
* Fix Trac #3966: warn about useless UNPACK pragmassimonpj@microsoft.com2010-05-061-1/+1
| | | | | | | | | | | | Warning about useless UNPACK pragmas wasn't as easy as I thought. I did quite a bit of refactoring, which improved the code by refining the types somewhat. In particular notice that in DataCon, we have dcStrictMarks :: [HsBang] dcRepStrictness :: [StrictnessMarks] The former relates to the *source-code* annotation, the latter to GHC's representation choice.
* Add a HsExplicitFlag to SpliceDecl, to improve Trac #4042simonpj@microsoft.com2010-05-061-2/+2
| | | | | | | | | | | | | | The issue here is that g :: A -> A f data A = A is treated as if you'd written $(f); that is the call of f is a top-level Template Haskell splice. This patch makes sure that we *first* check the -XTemplateHaskellFlag and bleat about a parse error if it's off. Othewise we get strange seeing "A is out of scope" errors.
* Remove the Unicode alternative for ".." (#3894)Simon Marlow2010-05-051-1/+0
|
* Minor refactoring of placeHolderPunRhssimonpj@microsoft.com2010-03-042-7/+6
|
* Add handling for | to the transitional alternative layout ruleIan Lynagh2010-03-021-0/+12
|
* Tweak alternative layout ruleIan Lynagh2010-03-021-8/+19
| | | | Now not only is if/then a bracketting pair, but then/else is too
* Add transitional rules for the alternative layout ruleIan Lynagh2010-03-021-1/+20
| | | | If enabled, these accept more layout, but give warnings
* Fix the alternative layout rule to handle explicit let/inIan Lynagh2010-03-021-8/+31
| | | | | | | It used to break on let {x = 'a'} in x as the 'in' token would keep closing contexts looking for an implicit 'let' layout.
* Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845simonpj@microsoft.com2010-02-102-12/+8
| | | | | | | | | | | | | | | | | | | | To print HsTypes correctly we should remember whether the Kind on a HsTyVarBndr came from type inference, or was put there by the user. See Note [Printing KindedTyVars] in HsTypes. So instead of changing a UserTyVar to a KindedTyVar during kind checking, we simply add a PostTcKind to the UserTyVar. The change was provoked by Trac #3830, although other changes mean that #3830 gets a diferent and better error message now. So this patch is simply doing the Right Thing for the future. This patch also fixes Trac #3845, which was caused by a *type splice* not remembering the free *term variables* mentioned in it. Result was that we build a 'let' when it should have been 'letrec'. Hence a new FreeVars field in HsSpliceTy. While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind on HsSpliceTy instead, just like on the UserTyVar.
* Simplify syntax for quasi-quotationsimonpj@microsoft.com2010-02-101-3/+4
| | | | | | | | | | | | | After some discussion we decided to make a quasi-quote look like [pads| ...blah... |] rather than [$pads| ...blah... |] as before. The new syntax is quieter, although it does not signal quite as clearly that there is a splice going on.
* Several TH/quasiquote changessimonpj@microsoft.com2010-02-102-94/+21
| | | | | | | | | | | | | | | | | | | | | | a) Added quasi-quote forms for declarations types e.g. f :: [$qq| ... |] b) Allow Template Haskell pattern quotes (but not splices) e.g. f x = [p| Int -> $x |] c) Improve pretty-printing for HsPat to remove superfluous parens. (This isn't TH related really, but it affects some of the same code.) A consequence of (a) is that when gathering and grouping declarations in RnSource.findSplice, we must expand quasiquotes as we do so. Otherwise it's all fairly straightforward. I did a little bit of refactoring in TcSplice. User-manual changes still to come.
* Teach the alternative layout rule about mdo and recIan Lynagh2010-01-161-0/+2
|
* Teach the alternative layout rule about $( ... )Ian Lynagh2010-01-161-7/+8
| | | | | It thought the ) needed to close something, but the $( hadn't opened anything.
* Clarify error message (Trac #3805)simonpj@microsoft.com2010-01-071-1/+1
|
* Make view patterns right-associatesimonpj@microsoft.com2010-01-061-1/+1
| | | | | | So that you can write f (v1 -> v2 -> pat)
* Improve the handling of default methodssimonpj@microsoft.com2010-01-061-0/+1
| | | | | | | | | | See the long Note [INLINE and default methods]. This patch changes a couple of data types, with a knock-on effect on the format of interface files. A lot of files get touched, but is a relatively minor change. The main tiresome bit is the extra plumbing to communicate default methods between the type checker and the desugarer.
* Improve error message (idea in Trac #3805)simonpj@microsoft.com2010-01-051-1/+13
| | | | | | | | If we see foreign export ccall foo :: ...blah... we now use the "foreign" to suggest -XForeignFunctionInterface
* Comments onlysimonpj@microsoft.com2010-01-051-5/+6
|
* Allow instance heads to use infix syntaxsimonpj@microsoft.com2009-12-221-2/+4
| | | | | | | class C a b instance Int `C` Bool This was accidentally disallowed before.
* Refactor PackageTarget back into StaticTargetBen.Lippmeier@anu.edu.au2010-01-042-3/+3
|
* Tag ForeignCalls with the package they correspond toBen.Lippmeier@anu.edu.au2010-01-021-4/+5
|
* Substantial improvements to coercion optimisationsimonpj@microsoft.com2010-01-042-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The main purpose of this patch is to add a bunch of new rules to the coercion optimiser. They are documented in the (revised) Appendix of the System FC paper. Some code has moved about: - OptCoercion is now a separate module, mainly because it now uses tcMatchTy, which is defined in Unify, so OptCoercion must live higehr up in the hierarchy - Functions that manipulate Kinds has moved from Type.lhs to Coercion.lhs. Reason: the function typeKind now needs to call coercionKind. And in any case, a Kind is a flavour of Type, so it builds on top of Type; indeed Coercions and Kinds are both flavours of Type. This change required fiddling with a number of imports, hence the one-line changes to otherwise-unrelated modules - The representation of CoTyCons in TyCon has changed. Instead of an extensional representation (a kind checker) there is now an intensional representation (namely TyCon.CoTyConDesc). This was needed for one of the new coercion optimisations.
* Fix #3751, also fix some lexical error SrcLocsSimon Marlow2009-12-171-35/+34
|
* Fix #3741, simplifying things in the processSimon Marlow2009-12-101-72/+46
| | | | | | | | | The problem in #3741 was that we had confused column numbers with byte offsets, which fails in the case of UTF-8 (amongst other things). Fortunately we're tracking correct column offsets now, so we didn't have to make a calculation based on a byte offset. I got rid of two fields from the PState (last_line_len and last_offs).and one field from the AI (alex input) constructor.
* Allow spaces at either end of the C import spec (#3742)Simon Marlow2009-12-101-2/+6
|
* Add some comments on the alternative layout rule stateIan Lynagh2009-12-051-0/+9
|
* Tweak layout for alternative layout ruleIan Lynagh2009-12-032-4/+4
|
* Add a GHC layout extension to the alternative layout ruleIan Lynagh2009-12-031-0/+9
|
* Tweak the alternative layout rule: {} contains commasIan Lynagh2009-11-291-0/+4
|
* Tweak alternative layout ruleIan Lynagh2009-11-291-2/+2
|
* Make the alternative layout rule cope with file pragmasIan Lynagh2009-11-291-1/+3
|
* Columns now start at 1, as lines already didIan Lynagh2009-11-272-2/+2
| | | | Also corrected a couple of line 0's to line 1
* Implement non-decreasing do indentation in the alternative layout ruleIan Lynagh2009-11-271-1/+7
|
* Apply patch from #2978: add more Unicode syntaxSimon Marlow2009-09-181-0/+8
|
* Fix a bug in alternative layout ruleIan Lynagh2009-11-251-0/+1
|
* Fix a bug in alternative layoutIan Lynagh2009-11-251-16/+9
| | | | And make the code simpler in the process!
* Bug fix for alternative layout ruleIan Lynagh2009-11-251-1/+1
|
* Tweak alternative layout ruleIan Lynagh2009-11-251-8/+11
|
* Add unboxed parentheses to the alternative layout ruleIan Lynagh2009-11-251-0/+6
|
* Tweak the warning suppression flags used in LexerIan Lynagh2009-11-251-9/+9
|
* Implement the alternative layout ruleIan Lynagh2009-11-251-11/+230
| | | | Caution: Largely untested
* Fix some warning in LexerIan Lynagh2009-11-241-9/+11
|
* * Refactor CLabel.RtsLabel to CLabel.CmmLabelBen.Lippmeier@anu.edu.au2009-11-061-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type of the CmmLabel ctor is now CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel - When you construct a CmmLabel you have to explicitly say what package it is in. Many of these will just use rtsPackageId, but I've left it this way to remind people not to pretend labels are in the RTS package when they're not. - When parsing a Cmm file, labels that are not defined in the current file are assumed to be in the RTS package. Labels imported like import label are assumed to be in a generic "foreign" package, which is different from the current one. Labels imported like import "package-name" label are marked as coming from the named package. This last one is needed for the integer-gmp library as we want to refer to labels that are not in the same compilation unit, but are in the same non-rts package. This should help remove the nasty #ifdef __PIC__ stuff from integer-gmp/cbits/gmp-wrappers.cmm
* Fix the buildIan Lynagh2009-11-061-1/+1
|