summaryrefslogtreecommitdiff
path: root/compiler/utils/StringBuffer.lhs
Commit message (Collapse)AuthorAgeFilesLines
* compiler: de-lhs utils/Austin Seipp2014-12-031-259/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Update Foreign.* for Safe Haskell now that they're safe by defaultDavid Terei2014-11-211-0/+4
|
* Return nBytes instead of nextAddr from utf8DecodeCharThomas Miedema2014-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: While researching D176, I came across the following simplification opportunity: Not all functions that call utf8DecodeChar actually need the address of the next char. And some need the 'number of bytes' read. So returning nBytes instead of nextAddr should save a few addition and subtraction operations, and makes the code a bit simpler. Test Plan: it validates Reviewers: simonmar, ezyang, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D179
* StringBuffer should not contain initial byte-order mark (BOM)Thomas Miedema2014-09-011-13/+32
| | | | | | | | | | | | | | | | | | | | Summary: Just skipping over a BOM, but leaving it in the Stringbuffer, is not sufficient. The Lexer calls prevChar when a regular expression starts with '^' (which is a shorthand for '\n^'). It would never match on the first line, since instead of '\n', prevChar would still return '\xfeff'. Test Plan: validate Reviewers: austin, ezyang Reviewed By: austin, ezyang Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D176 GHC Trac Issues: #6016
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-1/+1
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* GHC 7.4 is now required for building HEADIan Lynagh2012-07-201-4/+0
|
* Define FastString on top of FastBytesIan Lynagh2012-07-151-1/+1
| | | | | | Although we currently break the abstraction a lot in the FastString operations, this is a step towards ultimately being able to replace FastBytes with ByteString.
* SafeHaskell: Fix validation errors when unsafe base usedDavid Terei2011-06-171-1/+1
|
* SafeHaskell: Fix validation errors when Safe base used.David Terei2011-06-171-3/+6
|
* SafeHaskell: Even more fixing to work with safe baseDavid Terei2011-06-171-0/+1
|
* More modules that need LANGUAGE BangPatternssimonpj@microsoft.com2010-11-121-0/+1
|
* Refactoring and tidyup of HscMain and related things (also fix #1666)Simon Marlow2010-10-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to fix #1666 (-Werror aborts too early) I decided to some tidyup in GHC/DriverPipeline/HscMain. - The GhcMonad overloading is gone from DriverPipeline and HscMain now. GhcMonad is now defined in a module of its own, and only used in the top-level GHC layer. DriverPipeline and HscMain use the plain IO monad and take HscEnv as an argument. - WarnLogMonad is gone. printExceptionAndWarnings is now called printException (the old name is deprecated). Session no longer contains warnings. - HscMain has its own little monad that collects warnings, and also plumbs HscEnv around. The idea here is that warnings are collected while we're in HscMain, but on exit from HscMain (any function) we check for warnings and either print them (via log_action, so IDEs can still override the printing), or turn them into an error if -Werror is on. - GhcApiCallbacks is gone, along with GHC.loadWithLogger. Thomas Schilling told me he wasn't using these, and I don't see a good reason to have them. - there's a new pure API to the parser (suggestion from Neil Mitchell): parser :: String -> DynFlags -> FilePath -> Either ErrorMessages (WarningMessages, Located (HsModule RdrName))
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-241-1/+1
| | | | | For now we only get a warning, rather than an error, because the alex and happy templates don't follow the new rules yet.
* Tweak a Show instanceIan Lynagh2009-04-071-1/+1
|
* Move some flags from the Makefile into module pragmasIan Lynagh2008-07-101-0/+4
|
* FIX #1736, and probably #2169, #2240Simon Marlow2008-07-071-4/+6
| | | | | | | | | | | | | appendStringBuffer was completely bogus - the arguments to copyArray were the wrong way around, which meant that corruption was very likely to occur by overwriting the end of the buffer in the first argument. This definitely fixes #1736. The other two bugs, #2169 and #2240 are harder to reproduce, but we can see how they could occur: in the case of #2169, the options parser is seeing the contents of an old buffer, and in the case of #2240, appendStringBuffer is corrupting an interface file in memory, since strng buffers and interface files are both allocated in the pinned region of memory.
* Remove code that isn't used now that we assume that GHC >= 6.4Ian Lynagh2008-06-201-8/+0
|
* Fix warnings in StringBufferIan Lynagh2008-02-181-13/+6
|
* Whitespace onlyIan Lynagh2008-02-181-39/+39
|
* Use nilFSIan Lynagh2008-01-231-2/+2
|
* lots of portability changes (#1405)Isaac Dupree2008-01-171-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-recording to avoid new conflicts was too hard, so I just put it all in one big patch :-( (besides, some of the changes depended on each other.) Here are what the component patches were: Fri Dec 28 11:02:55 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * document BreakArray better Fri Dec 28 11:39:22 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * properly ifdef BreakArray for GHCI Fri Jan 4 13:50:41 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * change ifs on __GLASGOW_HASKELL__ to account for... (#1405) for it not being defined. I assume it being undefined implies a compiler with relatively modern libraries but without most unportable glasgow extensions. Fri Jan 4 14:21:21 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * MyEither-->EitherString to allow Haskell98 instance Fri Jan 4 16:13:29 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * re-portabilize Pretty, and corresponding changes Fri Jan 4 17:19:55 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Augment FastTypes to be much more complete Fri Jan 4 20:14:19 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * use FastFunctions, cleanup FastString slightly Fri Jan 4 21:00:22 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Massive de-"#", mostly Int# --> FastInt (#1405) Fri Jan 4 21:02:49 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * miscellaneous unnecessary-extension-removal Sat Jan 5 19:30:13 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * add FastFunctions
* FIX #1744: ignore the byte-order mark at the beginning of a fileSimon Marlow2007-11-301-6/+16
|
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | 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-011-0/+7
|
* 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.
* Warning PoliceMichael D. Adams2007-07-051-1/+0
|
* remove #if branches for pre-ghc-6.0Isaac Dupree2007-06-051-15/+0
| | | | | | I skipped utils/hsc2hs/Main.hs since its ifs also involved checking for old versions of nhc98 (I don't want to figure that out), but removed everything else I found relating to building with pre-6.0
* parseInteger->parseUnsignedInteger to clarify meaningIsaac Dupree2007-05-261-3/+3
| | | | | | | | 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.
* only comments, spacing, alpha-renamingIsaac Dupree2007-05-261-4/+6
|
* Module header tidyup #2Simon Marlow2006-10-111-1/+1
| | | | Push this further along, and fix build problems in the first patch.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+240
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.