Commit Graph

42 Commits

Author SHA1 Message Date
Neil Brown
c8b724d2be Merged the latest set of changes from the trunk into the Polyplate branch
I also added the import list to all the Data.Generics imports in the tests (as I did for the other modules recently)
2009-04-10 20:38:29 +00:00
Neil Brown
ccb6c7aa1d Fixed the types in various test modules to work with Polyplate 2008-12-14 19:18:00 +00:00
Neil Brown
ddbec737f2 Got all the tests compiling again after recent changes
For some reason, the usage check tests are now very slow to run (perhaps because of all the operator definitions added to each one?), which needs further investigation.
2009-04-10 19:29:40 +00:00
Neil Brown
e457d82f0c Changed FUNCTIONs and PROCs to have optional bodies, and put all the externals into the AST (without bodies)
This may seem like an odd change, but it simplifies the logic a lot.  I kept having problems with passes not operating on externals (e.g. functions-to-procs, adding array sizes, constant folding in array dimensions) and adding a special case every time to also process the externals was getting silly.

Putting the externals in the AST therefore made sense, but I didn't want to just add dummy bodies as this would cause them to throw up errors (e.g. in the type-checking for functions).  So I turned the bodies into a Maybe type, and that has worked out well.

I also stopped storing the formals in csExternals (since they are now in csNames, and the tree), which streamlined that nicely, and stopped me having to keep them up to date.
2009-04-04 14:56:35 +00:00
Neil Brown
78606faaae Reintroduced the transformRangeRep pass, and fixed the transformEachRange pass (along with fixing the relevant tests) 2009-02-03 12:31:54 +00:00
Neil Brown
4f83187549 Fixed up all the tests in light of the new recursive procs 2009-01-29 00:56:32 +00:00
Neil Brown
10e6b4ce02 Updated all the tests to work with the new recursive functions 2009-01-29 00:34:12 +00:00
Neil Brown
2c6f624ea3 Changed the occam type-checker and the Rain stuff to be okay with the new step count 2009-01-28 23:47:36 +00:00
Neil Brown
0e7a6c5b98 Added a NameSource field for NameDef that indicates where a name comes from 2008-11-25 17:36:42 +00:00
Neil Brown
4c726352a4 Removed an obsolete failing Rain test 2008-06-04 18:44:07 +00:00
Neil Brown
41ff60cb78 Removed the Rep constructor from Structured and instead added a Rep constructor to SpecType
This way, all replicators are declared like other names, and their scope is considered replicated.  This simplifies the code a little.

Fixes #55
2008-06-04 17:00:43 +00:00
Neil Brown
ba66cce89f Moved all the remaining pass information to be with the passes themselves, and adjusted the tests accordingly
All the passes now have their information (name, pre-requisites and post- properties) stored at the point where the pass is declared, which means the pass lists are just a simple list of pass functions.

The main consequence of this change was that the tests had to be changed.  Now, instead of taking a "pass applied to data" item (type: PassM b), they take both the pass (type: Pass) and source data (type: b), and apply them later.  This was the decision that involved the simplest changes to the existing tests (simply unbracketing the application of the pass to the source).  I also had to include a few old-style versions though (testPass', testPassShouldFail') for where the functions were being used to test things that weren't actually passes (mainly StructureOccam).

Fixes #48
2008-06-02 14:31:19 +00:00
Adam Sampson
13ea7f2c4b Resolve conflicts after merge. 2008-06-02 10:28:26 +00:00
Adam Sampson
36e7353ee7 Take NameType out of NameDef.
NameType is only really needed in the parser, so this takes it out of
NameDef, meaning that later passes defining names no longer need to
set an arbitrary NameType for them. The parser gets slightly more
complicated (because some productions now have to return a SpecType
and a NameType too), but lots of other code gets simpler.

The code that removed free names was the only thing outside the parser
using NameType, and it now makes a more sensible decision based on the
SpecType. Since unscoped names previously didn't have a SpecType at
all, I've added an Unscoped constructor to it and arranged matters
such that unscoped names now get a proper entry in csNames.

Fixes #61.
2008-06-02 10:13:14 +00:00
Neil Brown
d4938a166c Fixed some more Rain tests related to the old method of inferring types 2008-06-01 17:21:14 +00:00
Neil Brown
f79cba0616 Changed the parameter type checking to use type unification 2008-05-18 09:43:12 +00:00
Adam Sampson
3283b7db41 Remove the Type/AbbrevMode information from Actual*.
It's redundant, since you can always compute them from the variable, and it
makes the code that deals with actuals rather cleaner.

On the other hand, it slightly complicates some of the tests, because any names
you use in an Actual need to be defined...
2008-03-26 18:16:09 +00:00
Neil Brown
0511c852da Added a couple of reminders to RainPassesTest 2008-03-21 20:16:48 +00:00
Neil Brown
1f6311d33e Fixed a lot of tests in RainPassesTest 2008-03-20 12:38:59 +00:00
Neil Brown
db0467f1ca Adjusted the rain passes to use the new array constructor type, and weaned a few of them off everywhereM 2008-03-19 13:24:15 +00:00
Neil Brown
3d1aae72fc Fixed a couple of tests for a Rain pass 2008-03-09 18:43:22 +00:00
Neil Brown
ba75f5b06c Removed the initialiser expression on the Declaration item in the AST 2008-03-09 00:23:13 +00:00
Neil Brown
dcf419744a Renamed the transformFunction pass into checkFunction, and adjusted the tests for it accordingly 2008-02-25 21:17:37 +00:00
Neil Brown
1edaacae89 Altered the AST to allow a function to be either an ExpressionList (classical occam) or a Process (Rain/proposed new occam) 2008-02-24 19:29:31 +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
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
6c4e7ee713 Added a few more TestLabels 2008-02-05 16:19:16 +00:00
Neil Brown
741a01de5a Removed various tab characters and replaced them with spaces 2008-01-26 19:38:24 +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
14cb5d7642 Changed some Named Patterns to use the new @@ operator 2007-11-21 14:26:08 +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
16df6a1774 Fixed some conflicts between some branches, in RainPassesTest 2007-10-28 18:34:28 +00:00
Neil Brown
25f2efb94c Changed the existing Rain code (and tests) to use the new List type rather than the Array type 2007-10-25 10:13:17 +00:00
Neil Brown
6b95827cab Added an optional initialiser-expression to Declaration in the AST, and changed the rest of the code accordingly 2007-10-24 23:50:00 +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
a5c2dedb24 Changed the testPass* functions in TestUtil to return Assertion instead of Test 2007-09-15 13:35:51 +00:00
Neil Brown
4221b0d698 Moved a function from RainPassesTest into TestUtil 2007-09-15 11:24:49 +00:00
Neil Brown
01f763373d Rain: added a new pass for folding constants 2007-09-15 09:36:50 +00:00
Neil Brown
4d09fd4a85 Rain: added a pass that moves declarations inside par blocks to being outside the par blocks (so that they are in scope for the whole of the par block) 2007-09-14 13:03:59 +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