summaryrefslogtreecommitdiff
path: root/compiler/parser/Lexer.x
Commit message (Collapse)AuthorAgeFilesLines
...
| * Implemented MultiWayIf extension.Mikhail Vorozhtsov2012-07-161-0/+5
| |
| * Implemented \case expressions.Mikhail Vorozhtsov2012-07-161-22/+58
| |
* | Small refactoring for FastZStringsIan Lynagh2012-07-151-2/+2
| |
* | HsStringPrim now contains FastBytes, not FastStringIan Lynagh2012-07-141-5/+3
|/
* Parse error: suggest brackets and indentation.Eric Kow2012-06-291-1/+1
| | | | | | I have observed that whenever GHC tells me that I have possibly incorrect indentation, the real problem is often that I forgot to close some sort of bracket.
* Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-06-131-5/+2
|\ | | | | | | | | Fix conflicts in: compiler/main/DynFlags.hs
| * Revive 'mdo' expressions, per discussion in Trac #4148Simon Peyton Jones2012-06-121-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - mdo expressions are enabled by RecursiveDo pragma - mdo expressions perform full segmentation - 'rec' groups inside 'do' are changed so they do *not* perform any segmentation. - Both 'mdo' and 'rec' are enabled by 'RecursiveDo' 'DoRec' is deprecated in favour of 'RecursiveDo' (The 'rec' keyword is also enabled by 'Arrows', as now.) Thanks to Levent for doing all the work
* | Pass DynFlags down to mk_err_msgIan Lynagh2012-06-121-1/+1
|/
* Tweak the lexer: In particular, improve notFollowedBy and friendsIan Lynagh2012-05-151-7/+14
| | | | | | | | | | | | | We were hitting a problem when reading the LANGUAGE/OPTIONS pragmas from GHC.TypeLits, where the buffer ended "{-". The rules for the start-comment lexeme check that "{-" is not followed by "#", but the test returned False when there was no next character. Therefore we were lexing this as as an open-curly lexeme (only consuming the "{", and not reaching the end of the buffer), which meant the options parser think that it had reached the end of the options. Now we correctly lex as "{-".
* Support qualified identifiers in quasi-quotes (#5555).Paolo Capriotti2012-04-021-1/+24
|
* Add -XExplicitNamespaces to enable using 'type' in import/exports.Iavor S. Diatchki2012-03-241-0/+8
| | | | | | | | This extension is implied by: * TypeOperators: so that we can import/export things like (+) * TypeFamilies: because associated type synonyms use "type T" to name the associated type in a subordinate list.
* Only parse type literals when using `DataKinds`.Iavor S. Diatchki2012-03-181-0/+6
|
* Implement the CTYPE pragma; part of the CApiFFI extensionIan Lynagh2012-02-161-1/+3
| | | | | | | For now, the syntax is type {-# CTYPE "some C type" #-} Foo = ... newtype {-# CTYPE "some C type" #-} Foo = ... data {-# CTYPE "some C type" #-} Foo = ...
* Eliminate {| and |} vestiges in lexer/parserSimon Peyton Jones2012-01-171-2/+0
| | | | They weren't being lexed any more, but we still had productions!
* Implememt -fdefer-type-errors (Trac #5624)Simon Peyton Jones2012-01-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the idea of deferring (most) type errors to runtime, instead emitting only a warning at compile time. The basic idea is very simple: * The on-the-fly unifier in TcUnify never fails; instead if it gets stuck it emits a constraint. * The constraint solver tries to solve the constraints (and is entirely unchanged, hooray). * The remaining, unsolved constraints (if any) are passed to TcErrors.reportUnsolved. With -fdefer-type-errors, instead of emitting an error message, TcErrors emits a warning, AND emits a binding for the constraint witness, binding it to (error "the error message"), via the new form of evidence TcEvidence.EvDelayedError. So, when the program is run, when (and only when) that witness is needed, the program will crash with the exact same error message that would have been given at compile time. Simple really. But, needless to say, the exercise forced me into some major refactoring. * TcErrors is almost entirely rewritten * EvVarX and WantedEvVar have gone away entirely * ErrUtils is changed a bit: * New Severity field in ErrMsg * Renamed the type Message to MsgDoc (this change touches a lot of files trivially) * One minor change is that in the constraint solver we try NOT to combine insoluble constraints, like Int~Bool, else all such type errors get combined together and result in only one error message! * I moved some definitions from TcSMonad to TcRnTypes, where they seem to belong more
* Add a class HasDynFlags(getDynFlags)Ian Lynagh2011-12-191-2/+2
| | | | | | | | We no longer have many separate, clashing getDynFlags functions I've given each GhcMonad its own HasDynFlags instance, rather than using UndecidableInstances to make a GhcMonad m => HasDynFlags m instance.
* Merge branch 'master' of http://darcs.haskell.org/ghcDavid Waern2011-11-291-0/+5
|\
| * Implement a capi calling convention; fixes #2979Ian Lynagh2011-11-281-0/+5
| | | | | | | | | | | | | | | | | | In GHC, this provides an easy way to call a C function via a C wrapper. This is important when the function is really defined by CPP. Requires the new CApiFFI extension. Not documented yet, as it's still an experimental feature at this stage.
* | Merge branch 'master' of http://darcs.haskell.org/ghcDavid Waern2011-11-261-1/+13
|\ \ | |/
| * Decode escape sequences properly in line pragmas (see comment for details).Simon Marlow2011-11-231-1/+13
| |
* | Keep unicode characters in Haddock comments and comments in the token stream.David Waern2011-11-251-12/+12
|/
* Track #included files for recompilation checking (#4900, #3589)Simon Marlow2011-11-181-0/+6
| | | | | | | | | | This was pretty straightforward: collect the filenames in the lexer, and add them in to the tcg_dependent_files list that the typechecker collects. Note that we still don't get #included files in the ghc -M output. Since we don't normally lex the whole file in ghc -M, this same mechanism can't be used directly.
* New kind-polymorphic coreJose Pedro Magalhaes2011-11-111-10/+5
| | | | | | | | | This big patch implements a kind-polymorphic core for GHC. The current implementation focuses on making sure that all kind-monomorphic programs still work in the new core; it is not yet guaranteed that kind-polymorphic programs (using the new -XPolyKinds flag) will work. For more information, see http://haskell.org/haskellwiki/GHC/Kinds
* added NOUNPACK pragma (see #2338)Stefan Wehr2011-11-091-0/+2
|
* Setup new Safe Haskell interfaceDavid Terei2011-10-251-1/+1
|
* Unconditionally derive some instancesIan Lynagh2011-10-251-3/+1
| | | | They used to be only derived when DEBUG was on
* fix panic in string-gap lexing (#5425)Simon Marlow2011-10-101-2/+3
|
* Give a better error message for unterminated quasiquotations (fixes #5204).Geoffrey Mainland2011-09-291-5/+10
|
* Define a TraditionalRecordSyntax extension; fixes #3356Ian Lynagh2011-09-271-0/+6
| | | | | | This allows the extension (which is on by default) to be turned off, which gets us a small step closer to replacing Haskell98 records with something better.
* Implement -XConstraintKindMax Bolingbroke2011-09-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact, this patch adds a new kind Constraint such that: Show :: * -> Constraint (?x::Int) :: Constraint (Int ~ a) :: Constraint And you can write *any* type with kind Constraint to the left of (=>): even if that type is a type synonym, type variable, indexed type or so on. The following (somewhat related) changes are also made: 1. We now box equality evidence. This is required because we want to give (Int ~ a) the *lifted* kind Constraint 2. For similar reasons, implicit parameters can now only be of a lifted kind. (?x::Int#) => ty is now ruled out 3. Implicit parameter constraints are now allowed in superclasses and instance contexts (this just falls out as OK with the new constraint solver) Internally the following major changes were made: 1. There is now no PredTy in the Type data type. Instead GHC checks the kind of a type to figure out if it is a predicate 2. There is now no AClass TyThing: we represent classes as TyThings just as a ATyCon (classes had TyCons anyway) 3. What used to be (~) is now pretty-printed as (~#). The box constructor EqBox :: (a ~# b) -> (a ~ b) 4. The type LCoercion is used internally in the constraint solver and type checker to represent coercions with free variables of type (a ~ b) rather than (a ~# b)
* Update to work with Alex 3.0: basically disabling Alex's new UnicodeSimon Marlow2011-08-051-3/+12
| | | | | | support because we have our own, and defining alexGetByte instead of alexGetChar (actually we also define alexGetChar, for backwards compatibility).
* Remove all escape handling from quasiquotes; fixes Trac #5348Simon Peyton Jones2011-08-031-10/+6
| | | | There is a long discussion in the ticket.
* Separate the warning flags into their own datatypeIan Lynagh2011-07-141-4/+4
| | | | | | | The -w flag wasn't turning off a few warnings (Opt_WarnMissingImportList, Opt_WarnMissingLocalSigs, Opt_WarnIdentities). Rather than just adding them, I've separated the Opt_Warn* contructors off into their own type, so -w now just sets the list of warning flags to [].
* More Lexer.x tidy-upsIan Lynagh2011-07-141-8/+4
|
* Remove some unused, commented-out code from Lexer.xIan Lynagh2011-07-141-38/+7
|
* Whitespace in Lexer.xIan Lynagh2011-07-141-484/+485
|
* Remove 'threadsafe' FFI importsIan Lynagh2011-07-131-3/+0
| | | | They've been deprecated since GHC 6.12.
* Make an extension for interruptible FFI callsIan Lynagh2011-07-111-26/+29
|
* SafeHaskell: Add safe import flag (not functional)David Terei2011-06-171-1/+4
|
* Added a pragma {-# NOVECTORISE f #-} that suppresses vectorisation of ↵Manuel M T Chakravarty2011-06-131-1/+4
| | | | toplevel variable 'f'.
* Refactor SrcLoc and SrcSpanIan Lynagh2011-06-091-69/+74
| | | | | | | | | | | | | | | The "Unhelpful" cases are now in a separate type. This allows us to improve various things, e.g.: * Most of the panic's in SrcLoc are now gone * The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it knows that it has real locations and thus can assume that the line number etc really exists * Some of the more suspicious cases are no longer necessary, e.g. we no longer need this case in advanceSrcLoc: advanceSrcLoc loc _ = loc -- Better than nothing More improvements can probably be made, e.g. tick locations can probably use RealSrcSpans too.
* Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-genericsJose Pedro Magalhaes2011-05-171-7/+10
|\
| * Use FractionalLit more extensively to improve other pretty printersMax Bolingbroke2011-05-151-5/+8
| |
| * Record the original text along with parsed Rationals: fixes #2245Max Bolingbroke2011-05-151-3/+3
| |
* | Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-genericsJose Pedro Magalhaes2011-05-041-0/+1
|\ \ | |/ | | | | | | Fixed conflicts: compiler/prelude/PrelNames.lhs
| * Merge remote branch 'origin/master' into monad-compSimon Peyton Jones2011-04-281-21/+21
| |\ | | | | | | | | | | | | Conflicts: compiler/main/HscMain.lhs
| * | Preliminary monad-comprehension patch (Trac #4370)Simon Peyton Jones2011-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is the work of Nils Schweinsberg <mail@n-sch.de> It adds the language extension -XMonadComprehensions, which generalises list comprehension syntax [ e | x <- xs] to work over arbitrary monads.
* | | Use 'default' rather than 'generic' for default-method signaturesSimon Peyton Jones2011-04-281-13/+5
| | | | | | | | | | | | | | | | | | Also get rid of the old {| |} brackets in the lexer. Fewer keywords!
* | | Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-genericsJose Pedro Magalhaes2011-04-271-21/+21
|\ \ \ | | |/ | |/|
| * | Formatting fixes in Lexer.xDavid Terei2011-04-261-21/+21
| |/