summaryrefslogtreecommitdiff
path: root/compiler/parser
Commit message (Collapse)AuthorAgeFilesLines
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-0410-10/+10
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-0310-20/+20
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-0110-0/+70
|
* FIX: family instances for infix type constructorsManuel M T Chakravarty2007-08-191-4/+5
| | | | - Fixed test "Infix" in the testsuite, which Roman added
* Make :i (->) work; fixes trac #1587Ian Lynagh2007-08-171-0/+1
|
* Add a deprecated warning for _scc_Ian Lynagh2007-08-162-7/+11
|
* Change standalone deriving syntax and semantics; fixes trac #1481Ian Lynagh2007-08-102-6/+1
| | | | | You now say deriving instance Cxt => Head
* Warning police: eliminate all defaulting within stage1Isaac Dupree2007-08-071-1/+1
| | | | | | | | Defaulting makes compilation of multiple modules more complicated (re: #1405) Although it was all locally within functions, not because of the module monomorphism-restriction... but it's better to be clear what's meant, anyway. I changed some that were defaulting to Integer, to explicit Int, where Int seemed appropriate rather than Integer.
* Rename Opt_TH to Opt_TemplateHaskell to match the language nameIan Lynagh2007-08-041-1/+1
|
* Rename Opt_FFI to Opt_ForeignFunctionInterface to match the language nameIan Lynagh2007-08-041-1/+1
|
* FIX #1215: GHC fails to respect the maximal munch rule while lexing ↵Simon Marlow2007-07-241-32/+1
| | | | | | | | | | | | | | | | | | | "qualified reservedids" I didn't actually fix this to respect Haskell 98, instead I changed it to follow the proposal for Haskell': http://hackage.haskell.org/cgi-bin/haskell-prime/trac.cgi/wiki/QualifiedIdentifiers Rationale: - We didn't respect Haskell 98 with respect to qualified symbols either - The Haskell' change makes things much cleaner - Obeying the Haskell 98 spec literally has some unintended consequences (e.g. M.where must lex as "M.wher" "e") - Any programs that compiled before this change and do not compile after it were illegal according to Haskell 98 anyway.
* FIX #1555: Remove "exp -> pat" production in stmtsSimon Marlow2007-07-231-3/+0
| | | | | | | It looks like this was an experiment that accidentally got committed, somewhere between 6.0 and 6.2.
* Implement -XStandaloneDeriving, the lexer is now glaexts-freeIan Lynagh2007-07-102-36/+33
|
* 'a'# syntax is enabled by the MagicHash extensionIan Lynagh2007-07-101-2/+2
|
* "Foo"# syntax is enabled by the MagicHash extensionIan Lynagh2007-07-101-2/+2
|
* 5# syntax is enabled by the MagicHash extensionIan Lynagh2007-07-101-9/+9
|
* {| and |} are -fgenerics syntaxIan Lynagh2007-07-101-3/+6
|
* Rank 2 and rank n types enable explicit forall syntaxIan Lynagh2007-07-101-0/+2
|
* RULES pragmas only need explicitForallEnabled, no -fglasgow-extsIan Lynagh2007-07-101-6/+7
|
* Implement unboxed tuples flagsIan Lynagh2007-07-091-2/+10
| | | | | | -XUnboxedTuples -XExpressionSignaturesUnboxedTuples -XTypeSynonymUnboxedTuples
* Add -XExistentialQuantification flagIan Lynagh2007-07-091-0/+1
|
* Implement -XPolymorphicComponentsIan Lynagh2007-07-091-0/+1
|
* rename tv -> explicitForallIan Lynagh2007-07-091-6/+7
|
* Implement -XUnicodeSyntaxIan Lynagh2007-07-091-32/+39
|
* Implement -XRecursiveDoIan Lynagh2007-07-081-2/+5
|
* Implement -XKindSignaturesIan Lynagh2007-07-081-1/+4
|
* Support the MagicHash extension as a flag and LANGUAGE pragmaIan Lynagh2007-07-081-24/+27
|
* FIX read040: patterns with type sig on LHS of do-bindingsimonpj@microsoft.com2007-06-211-1/+1
| | | | | | | | | | | | | | f () = do { x :: Bool <- return True; ... } For some reason the production for 'pat' required 'infixexp' on the LHS of a do-notation binding. This patch makes it an 'exp', which thereby allows an expression with a type sig. Happily, there are no new shift-reduce errors, so I don't think this will break anything else.
* Add several new record featuresLemmih2007-06-212-29/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Record disambiguation (-fdisambiguate-record-fields) In record construction and pattern matching (although not in record updates) it is clear which field name is intended even if there are several in scope. This extension uses the constructor to disambiguate. Thus C { x=3 } uses the 'x' field from constructor C (assuming there is one) even if there are many x's in scope. 2. Record punning (-frecord-puns) In a record construction or pattern match or update you can omit the "=" part, thus C { x, y } This is just syntactic sugar for C { x=x, y=y } 3. Dot-dot notation for records (-frecord-dot-dot) In record construction or pattern match (but not update) you can use ".." to mean "all the remaining fields". So C { x=v, .. } means to fill in the remaining fields to give C { x=v, y=y } (assuming C has fields x and y). This might reasonably considered very dodgy stuff. For pattern-matching it brings into scope a bunch of things that are not explictly mentioned; and in record construction it just picks whatver 'y' is in scope for the 'y' field. Still, Lennart Augustsson really wants it, and it's a feature that is extremely easy to explain. Implementation ~~~~~~~~~~~~~~ I thought of using the "parent" field in the GlobalRdrEnv, but that's really used for import/export and just isn't right for this. For example, for import/export a field is a subordinate of the *type constructor* whereas here we need to know what fields belong to a particular *data* constructor. The main thing is that we need to map a data constructor to its fields, and we need to do so in the renamer. For imported modules it's easy: just look in the imported TypeEnv. For the module being compiled, we make a new field tcg_field_env in the TcGblEnv. The important functions are RnEnv.lookupRecordBndr RnEnv.lookupConstructorFields There is still a significant infelicity in the way the renamer works on patterns, which I'll tackle next. I also did quite a bit of refactoring in the representation of record fields (mainly in HsPat).***END OF DESCRIPTION*** Place the long patch description above the ***END OF DESCRIPTION*** marker. The first line of this file will be the patch name. This patch contains the following changes: M ./compiler/deSugar/Check.lhs -3 +5 M ./compiler/deSugar/Coverage.lhs -6 +7 M ./compiler/deSugar/DsExpr.lhs -6 +13 M ./compiler/deSugar/DsMeta.hs -8 +8 M ./compiler/deSugar/DsUtils.lhs -1 +1 M ./compiler/deSugar/MatchCon.lhs -2 +2 M ./compiler/hsSyn/Convert.lhs -3 +3 M ./compiler/hsSyn/HsDecls.lhs -9 +25 M ./compiler/hsSyn/HsExpr.lhs -13 +3 M ./compiler/hsSyn/HsPat.lhs -25 +63 M ./compiler/hsSyn/HsUtils.lhs -3 +3 M ./compiler/main/DynFlags.hs +6 M ./compiler/parser/Parser.y.pp -13 +17 M ./compiler/parser/RdrHsSyn.lhs -16 +18 M ./compiler/rename/RnBinds.lhs -2 +2 M ./compiler/rename/RnEnv.lhs -22 +82 M ./compiler/rename/RnExpr.lhs -34 +12 M ./compiler/rename/RnHsSyn.lhs -3 +2 M ./compiler/rename/RnSource.lhs -50 +78 M ./compiler/rename/RnTypes.lhs -50 +84 M ./compiler/typecheck/TcExpr.lhs -18 +18 M ./compiler/typecheck/TcHsSyn.lhs -20 +21 M ./compiler/typecheck/TcPat.lhs -8 +6 M ./compiler/typecheck/TcRnMonad.lhs -6 +15 M ./compiler/typecheck/TcRnTypes.lhs -2 +11 M ./compiler/typecheck/TcTyClsDecls.lhs -3 +4 M ./docs/users_guide/flags.xml +7 M ./docs/users_guide/glasgow_exts.xml +42
* #1318: lex negative unboxed literalsIsaac Dupree2007-05-261-30/+50
| | | | | | I reorganized the lexing of numeric literals a bit so the code didn't get too ugly, after trying a few ways, and also considering possible plans to be able to conditionally lex negative _boxed_ literals.
* #1318: remove negative-prim-literal old hackish implementationIsaac Dupree2007-05-262-16/+3
|
* parseInteger->parseUnsignedInteger to clarify meaningIsaac Dupree2007-05-261-7/+7
| | | | | | | | I decided against adding parseSignedInteger since octal and hex literals often have junk between the '-' and the digits, but, compare to Util.readRational which does handle signed numbers. Also since Integers - mathematically and in Haskell - can be negative, normally.
* -findexed-types -> -ftype-familiesManuel M T Chakravarty2007-05-141-11/+11
| | | | | | . This change tracks our current terminology. It'll break all programs using the old option, sorry. But this has only been an experimental feature in the HEAD so far.
* Documented the Unicode tricks that are being played in the lexersMichael D. Adams2007-05-101-6/+9
|
* Remove the distinction between data and newtype familiesManuel M T Chakravarty2007-05-111-6/+4
| | | | | | | | | - This patch removes "newtype family" declarations. - "newtype instance" declarations can now be instances of data families - This also fixes bug #1331 ** This patch changes the interface format. All libraries and all of ** ** Stage 2 & 3 need to be re-compiled from scratch. **
* Warning fix for unused and redundant importsMichael D. Adams2007-05-103-5/+0
|
* FIX parsing of Haddock comments (broken by me in the previous patch)Simon Marlow2007-05-081-1/+12
|
* FIX: #1253 (Can't use non-layout at top level)Simon Marlow2007-05-071-2/+6
|
* properly fix leakage of Haddock comment syntax (see #1091, test: read044)Simon Marlow2007-05-071-16/+9
|
* Make records work properly with type familiessimonpj@microsoft.com2007-05-021-1/+1
| | | | | | | This fixes Trac #1204. There's quite a delicate interaction of GADTs, type families, records, and in particular record updates. Test is indexed-types/should_compile/Records.hs
* restore the correct Unicode ellipsis characterSimon Marlow2007-04-261-1/+1
| | | | | It looks like this was accidentally replaced with '?' in the patch "HsSyn clean up for indexed types". (see bug #1294)
* Retain inline-pragma information on unfoldings in interface filessimonpj@microsoft.com2007-04-251-3/+3
| | | | | | | | | | | | | | | | | | | | WARNING: this patch changes interface-file formats slightly you will need to recompile your libraries Duncan Coutts wanted to export a function that has a NOINLNE pragma in a local let-defintion. This works fine within a module, but was not surviving across the interface-file serialisation. http://www.haskell.org/pipermail/glasgow-haskell-users/2007-March/012171.html Regardless of whether or not he's doing something sensible, it seems reasonable to try to retain local-binder IdInfo across interface files. This initial patch just retains inline-pragma info, on the grounds that other IdInfo can be re-inferred at the inline site. Interface files get a tiny bit bigger, but it seesm slight.
* tab, verttab, formfeed, and CR are not allowed in stringsSimon Marlow2007-04-161-5/+5
| | | | See #1277
* Fix external core syntax (though not full compilation)Aaron Tomb2006-11-133-45/+75
| | | | | | | | | This patch updates the External Core creator, pretty-printer, and parser to agree on a concrete syntax for External Core, including the constructs required by the change to System FC. Code to create valid ASTs from External Core files will come later, as will bits for renaming, typechecking, and desugaring.
* Remove code that is dead, as we require __GLASGOW_HASKELL__ >= 504Ian Lynagh2007-04-064-70/+1
|
* Emit a decent error message when there is a decl-splice inside a decl-bracketsimonpj@microsoft.com2007-03-232-13/+13
| | | | | | | | | | | | | | | | | | This fixes Trac #1065. The fix is just to emit a decent error message rather than crash. The situation is this: f x = ... [d| $(..stuff..); f x = v :: T |] ... TH wants to rename and typecheck the bracket; but it can't run the nested splice yet. That seems hard, because we know nothing about v, T, which are, presumably bound by the splice. The original TH paper says this isn't allowed, and now it's checked for properly (in the parser, in fact) rather than causing a crash. In the fullness of time we might want to do something more flexible, but not now.
* Fix parsing of parallel array literalsManuel M T Chakravarty2007-02-241-4/+15
|
* Make HsRecordBinds a data type instead of a synonym.lennart@augustsson.net2007-02-042-8/+8
|
* Fix Trac #1122; spot absence of TyCon in data/newtype headersimonpj@microsoft.com2007-01-301-8/+7
|
* Add support for overloaded string literals.lennart@augustsson.net2006-12-212-2/+5
| | | | | | | | | | The class is named IsString with the single method fromString. Overloaded strings work the same way as overloaded numeric literals. In expressions a string literals gets a fromString applied to it. In a pattern there will be an equality comparison with the fromString:ed literal. Use -foverloaded-strings to enable this extension.