Commit Graph

40 Commits

Author SHA1 Message Date
Neil Brown
4ef1ff7196 Changed to a state monad for warnings, and added a runPassM function to remove duplicate code for running passes 2008-04-03 12:21:59 +00:00
Neil Brown
20843f70a4 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +00:00
Neil Brown
d66fb79796 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Neil Brown
8fe152bf98 Merged the type-checking on time-related statements in Rain into the pass that checks types in communications 2008-03-24 15:15:28 +00:00
Neil Brown
b316a7d3f4 Added some tests for checking that constants can't be assigned to in Rain 2008-03-23 12:14:34 +00:00
Neil Brown
af4a66e2e4 Corrected the spelling of the name of one of the Rain passes 2008-03-20 16:46:45 +00:00
Neil Brown
0e3465afc0 Corrected some Rain tests to avoid using the Int type 2008-03-20 16:42:25 +00:00
Neil Brown
185f68e96d Adjusted the tests for the annotateListLiteralTypes pass 2008-03-20 16:34:44 +00:00
Neil Brown
bd26f758b4 Added tests for annotating the types of list literals and ranges in Rain 2008-03-20 14:44:19 +00:00
Neil Brown
c778ff0031 Fixed some unused module import warnings, now that PassM is not build of monad transformers 2008-03-10 17:19:45 +00:00
Neil Brown
9f18b348e8 Corrected all the tests to use the new PassM monad 2008-03-10 17:07:48 +00:00
Neil Brown
6d4f1dd702 Added labels to all the top-level tests that didn't have one 2008-02-28 16:11:01 +00:00
Neil Brown
74f3cb7fc2 Removed the export of "m" in TestUtils, instead moving the definition to each module that uses it (less confusing that way) 2008-02-24 18:55:44 +00:00
Neil Brown
f17ff5071c Added a Warn monad for warnings, and incorporated a WriterT monad into the PassM stack to support the Warn monad, then changed all the rest of the code accordingly, including adding a Warn instance for the GenParser parser that hides it in the state 2008-02-08 13:22:23 +00:00
Neil Brown
acd57d74de Changed the A.Structured type to be parameterised
This patch is actually an amalgam of multiple (already large) patches.  Those patches conflicted (parameterised Structured vs. changes to usage checking and FlowGraph) and encountered a nasty bug in darcs 1 involving exponential time (see http://wiki.darcs.net/DarcsWiki/ConflictsFAQ for more details).  Reasoning that half an hour (of 100% CPU use) was too long to apply patches, I opted to re-record the parameterised Structured changes as this new large patch.  Here are the commit messages originally used for the patches (which, as mentioned, were already large patches):

A gigantic patch switching all the non-test modules over to using parameterised A.Structured
Changed the FlowGraph module again to handle any sort of Structured you want to pass to it (mainly for testing)
A further gigantic patch changing all the tests to work with the new parameterised Structured
Fixed a nasty bug involving functions being named incorrectly inside transformInputCase
Added a hand-written instance of Data for Structured that allows us to use ext1M properly
Fixed a few warnings in the code
2008-02-05 19:40:27 +00:00
Neil Brown
26dd2fa5c4 Renamed the TestUtil and TreeUtil modules to TestUtils and TreeUtils, to be consistent with the Utils module 2007-12-13 19:05:29 +00:00
Neil Brown
4c20f99ac3 Changed some tests to use the new mSeq matching helpers 2007-11-28 14:30:56 +00:00
Neil Brown
1a7d77d9c4 Added more documentation to the tests for the Rain frontend passes 2007-11-12 15:45:07 +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
c38978c123 Rain: added tests for checking types in wait guards 2007-09-26 23:42:16 +00:00
Neil Brown
41ac788601 Rain: added tests for checking the types in wait statements 2007-09-26 23:08:37 +00:00
Neil Brown
5c827fdacb Rain: added testing for correct types in input statements in alts 2007-09-26 22:37:03 +00:00
Neil Brown
4cc0628757 Corrected the name of one of the RainTypesTest tests 2007-09-26 22:24:01 +00:00
Neil Brown
4e635d84ba Rain: added a pass for checking the types in GetTime processes 2007-09-19 11:36:55 +00:00
Neil Brown
5eb149d598 Rain: added type-checker tests for the Time type 2007-09-19 11:23:41 +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
c61f2ea617 Rain: added checks that types match in input and output statements 2007-09-16 11:46:01 +00:00
Neil Brown
337ad7fd32 Rain: added type-checking tests for if and while conditionals 2007-09-16 09:59:30 +00:00
Neil Brown
5354c99a4e Rain: added a function and tests for checking the types involved in assignments 2007-09-16 09:18:12 +00:00
Neil Brown
3301207a97 Rain: added more type-checkers tests, all of which pass 2007-09-15 21:19:16 +00:00
Neil Brown
15ce5fee06 Rain: added more type-checker tests and made them pass 2007-09-15 21:01:10 +00:00
Neil Brown
eeacaf1de4 Rain: added tests for type-checking monadic integer expressions, and made them pass 2007-09-15 20:30:41 +00:00
Neil Brown
f9c21dc4c7 Rain: fixed a nasty copy-and-paste mistake in RainTypesTest 2007-09-15 18:35:13 +00:00
Neil Brown
2bef926238 Tidied up and expanded the expression type-checker tests 2007-09-15 13:37:53 +00:00
Neil Brown
a5c2dedb24 Changed the testPass* functions in TestUtil to return Assertion instead of Test 2007-09-15 13:35:51 +00:00
Neil Brown
f9c88cbe90 Rain: added tests for a pass that type-checks expressions 2007-09-15 13:13:00 +00:00
Neil Brown
97cc82e235 Rain: added tests for a pass to fix the types of (folded) integer literals 2007-09-15 10:40:00 +00:00
Neil Brown
989f12b051 Rain: fixed the constant folding pass to work with constant sub-expressions 2007-09-15 10:26:52 +00:00
Neil Brown
e35873f01c Rain: tidied up the tests for the constant folding pass 2007-09-15 10:07:48 +00:00
Neil Brown
01f763373d Rain: added a new pass for folding constants 2007-09-15 09:36:50 +00:00