Commit Graph

17 Commits

Author SHA1 Message Date
Neil Brown
e61a23855a Fixed all the conflicts while merging into the Polyplate branch 2009-04-09 11:01:39 +00:00
Neil Brown
9fbbe87fd4 Fixed the reading of floating point literals to work for negative numbers 2009-04-03 17:53:10 +00:00
Neil Brown
2edf5cc43d Fixed constant folding to resolve any user types involved
Due to awkward module dependencies, some functions had to be moved around to accommodate this change.  Two from Types have gone to EvalLiterals, and two to CompState.  Everything still compiles just as before though.
2009-03-31 16:11:00 +00:00
Neil Brown
d35825ec50 Added support for constant-folding reals, and for constant-folding RETYPES 2009-03-26 18:33:14 +00:00
Neil Brown
8de2dbca88 Adjusted the modules in common to match the new array constructor change 2009-02-01 21:52:13 +00:00
Neil Brown
9145c993ea Fixed the constant folding to use a type for Int based on the compilation target rather than just assuming Int32
However, it is possible that there will still be a problem if the C and C++ compiler have different int sizes, because the constant folding has to know the type at compile time, and thus we have to arbitrarily choose to use the C version.  In future, we could perhaps swap all Ints for the appropriate substiution (e.g. Int64) at run-time, based on the flags and prior knowledge about C/C++ int sizes
2009-01-23 15:50:06 +00:00
Adam Sampson
9e9459cb4a Clean up EvalLiterals.
In particular, evalSimpleLiteral is now much nicer, and the error
messages should be a bit more comprehensible.

The signed types previously used a different version of fromRead that
passed an extra argument that it then didn't use; I've switched back to
the old version now, since it appears not to need it any more.
2008-04-08 00:29:23 +00:00
Adam Sampson
f1e9ffe230 In the evaluator, handle byte literals of any type. 2008-04-08 00:10:45 +00:00
Adam Sampson
1977e7880b Move evalIntExpression into EvalConstants, now that Types doesn't need it.
It now uses the full expression evaluator rather than the literal-only version.
2008-04-06 13:31:37 +00:00
Adam Sampson
2fdf749be0 Handle Infer in evalSimpleLiteral. 2008-04-06 02:28:43 +00:00
Adam Sampson
e9d95aa0fd Tidy up OccValue a bit. 2008-04-06 00:48:02 +00:00
Neil Brown
245e4536bc Fixed signed hexed values in the constant folder 2008-02-27 14:00:28 +00:00
Neil Brown
a3ebd96a86 Changed all the functions in the EvalLiterals, Types and ShowCode modules to use CSMR (instead of CSM) 2008-02-08 11:24:37 +00:00
Neil Brown
edc3a7e910 Removed the die function (that has no source position) and as far as possible replaced all its uses with dieP and a valid position 2008-01-28 17:21:13 +00:00
Neil Brown
38c409d378 Added the -fwarn-unused-imports compiler option to warn about unused imports, and then set about pruning and ordering (mostly in my code) the import lists for all the modules 2007-09-27 13:13:46 +00:00
Neil Brown
c97d1d00c8 Changed the error type from String to ErrorReport throughout the code
ErrorReport is of type (Maybe Meta, String), thereby adding an optional code position to error messages.

Die has been changed so that die and dieP are now implemented in terms of dieReport (:: ErrorReport -> m a).  This involved changing less code than changing die to be of type ErrorReport -> m a.  All that had to be changed directly was that Die instances now implement dieReport instead of die.

Any bits of code that "caught" errors has been changed so that it handles ErrorReport instead of String.  This ErrorReport is eventually, in Main, passed to dieIO, which will soon be changed to read the file in and provide the context.  Accordingly, MonadIO m has been added as a constraint to dieIO, and dieInternal has been changed to no longer use dieIO (because really we can't add the MonadIO constraint to dieInternal).

Various error messages have been changed.  Notably, all instances of fail in ParseOccam have been changed to use die or, wherever possible, dieP.  A similar thing has been done in EvalConstants and EvalLiterals.
2007-09-18 10:17:38 +00:00
Neil Brown
2ff46a9041 Rearranged the Rain source files, renamed a couple of Rain files, and changed the Makefile accordingly. 2007-09-10 17:28:57 +00:00