Commit Graph

435 Commits

Author SHA1 Message Date
Neil Brown
6c4e7ee713 Added a few more TestLabels 2008-02-05 16:19:16 +00:00
Neil Brown
093070454b Removed a use of the head function from PrettyShow 2008-02-05 16:19:00 +00:00
Neil Brown
c45b82be56 Removed the setting of csVerboseLevel in TestHarness that was accidentally committed 2008-02-04 08:05:16 +00:00
Neil Brown
1074407ef9 Added the ability to neatly print out a problem as a debug message 2008-02-03 15:41:29 +00:00
Neil Brown
1d9d47312a Implemented handling of replicators inside PARs in the control flow-graph building 2008-02-01 14:45:02 +00:00
Neil Brown
fdb612123c Added tests for parallel replicators in the flow-graph 2008-02-01 14:44:50 +00:00
Neil Brown
cb9aa03612 Fixed a nasty problem involving mixing the Meta tags while building the flow-graph, and added a comment about it 2008-02-01 14:34:17 +00:00
Neil Brown
30e890ef02 Corrected the bug involving replicated SEQs that are empty 2008-02-01 11:45:21 +00:00
Neil Brown
d3ad2e7af6 Added a couple more tests for empty replicated SEQs that show up a bug 2008-02-01 11:45:05 +00:00
Neil Brown
c663109378 Corrected how CASE options are handled in the flow-graph, and adjusted the accompanying tests 2008-02-01 11:34:03 +00:00
Neil Brown
2beda004b3 Corrected some more tests relating to the way empty A.Severals are handled 2008-02-01 11:21:43 +00:00
Neil Brown
e9a2143a28 Tweaked a slightly misleading error message when flow-graph tests fail 2008-02-01 11:14:54 +00:00
Neil Brown
5eb5a4c979 Corrected some tests to reflect the new way that empty A.Several items are handled when building the flow-graph 2008-02-01 11:12:31 +00:00
Neil Brown
0a22ebf34b Fixed up a couple of lines to properly handle the difference between Left False and Left True when building the flow-graph 2008-02-01 11:09:23 +00:00
Neil Brown
f8844edcb0 Corrected getNextParEdgeId in the flow-graph building to also actually increment the id ready for the next call 2008-02-01 11:08:53 +00:00
Neil Brown
83e04b92d4 Corrected the order the nodes are folded to match reality (rather than unintentionally reversing them) 2008-02-01 10:52:16 +00:00
Neil Brown
0672730894 Changed the way PARs are built up in the flow-graph, but haven't yet fixed the tests 2008-02-01 10:39:17 +00:00
Neil Brown
8fb60ff511 Added another test for PAR in FlowGraphTest 2008-01-30 20:47:27 +00:00
Neil Brown
5306e87463 Changed the tests for PAR in FlowGraphTest to match the intended new scheme 2008-01-30 20:37:47 +00:00
Neil Brown
a9427fe421 Corrected one test for SEQ in FlowGraphTest, and added another 2008-01-30 20:37:15 +00:00
Neil Brown
76e3a9b615 Corrected FlowGraphTest so it generates replicators inside IFs, not CASEs 2008-01-30 20:16:05 +00:00
Neil Brown
0dc94f9a32 Renamed the members of the OuterType data-type to be a little more distinctive 2008-01-30 19:58:20 +00:00
Neil Brown
b3cd170840 Fixed an oversight with duplicated Meta tags in testSeq in FlowGraphTest 2008-01-30 19:47:39 +00:00
Neil Brown
0f0be6e4a3 Added support for replicators to the quickcheck tests (actually applying the modification functions) 2008-01-30 19:14:33 +00:00
Neil Brown
c2c6bf24f8 Changed the QuickCheck flow-graph generators to generate a Process as the top level, rather than Structured, to make the test input more interesting 2008-01-30 18:57:00 +00:00
Neil Brown
0dc4b81be8 Corrected the item count for replicators in the QuickCheck FlowGraph tests 2008-01-30 18:56:33 +00:00
Neil Brown
45a8fa0b88 Added handling of sequential replicators when building the flow graph 2008-01-30 13:50:53 +00:00
Neil Brown
7c811f347c Added a couple of tests for sequential replicators 2008-01-30 13:50:28 +00:00
Neil Brown
b6132d6431 Added replicators to the flow graphs generated for the QuickCheck tests 2008-01-30 13:50:07 +00:00
Neil Brown
e94826c64e Added a function to GraphLabelFuncs for labelling replicators 2008-01-30 12:43:28 +00:00
Neil Brown
95d99706e3 Readjusted the parameters of flowAlgorithm so that the initial value for the starting node is passed in more obviously (since that was the only use of initVal, which has now been removed) 2008-01-29 21:05:37 +00:00
Neil Brown
28fd400d89 Adjusted the FlowGraph tests to check the roots of the graph, and added in the new root nodes where appropriate 2008-01-29 20:06:33 +00:00
Neil Brown
12b1617fec Added a new labelling function to FlowGraph for labelling the arguments of functions/processes 2008-01-29 20:05:38 +00:00
Neil Brown
5567d8cee0 Changed FlowGraph to keep a record of all the root nodes in the tree and return them in a list 2008-01-29 12:46:14 +00:00
Neil Brown
0a1270f109 Corrected a comment in FlowAlgorithms 2008-01-29 12:44:06 +00:00
Neil Brown
78a29de1d4 Added a couple of notes about replicators 2008-01-28 17:36:43 +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
f03702d937 Added an automatically-generated OrdAST module that provides an ordering for AST elements, ignoring Meta tags 2008-01-28 15:23:53 +00:00
Neil Brown
0f085b8d81 Added Ord instances for all simple types (all no-argument constructors) in the AST module 2008-01-28 15:22:58 +00:00
Neil Brown
7a30a2ceb5 Moved the usageCheckPass function into the new Check module 2008-01-28 13:15:36 +00:00
Neil Brown
4a8653cc41 Added the monads to the export list of ShowCode 2008-01-27 23:47:41 +00:00
Neil Brown
bc3ad29fed Added code to build the flow graph for procs and functions in specifications 2008-01-26 18:54:40 +00:00
Neil Brown
9dfa1611e0 Added various 4 and 5 parameter versions of the routing functions for building AST-modifying functions 2008-01-26 18:49:36 +00:00
Neil Brown
7c4b87e221 Added tests for proc specifications in FlowGraphTest and correctly an earlier test to not use an undefined specification 2008-01-26 18:48:49 +00:00
Neil Brown
3548167a83 Changed the testGraph function in FlowGraphTest to add a variant that takes an A.Structured directly 2008-01-26 18:48:09 +00:00
Neil Brown
41fb90dc33 Added labels to the tests in FlowGraphTest 2008-01-26 18:46:16 +00:00
Neil Brown
bdda623d7e Added types to all the cases where the monomorhpism restriction applied 2008-01-26 20:51:11 +00:00
Neil Brown
741a01de5a Removed various tab characters and replaced them with spaces 2008-01-26 19:38:24 +00:00
Neil Brown
178af1ca24 Changed the array usage checking to distinguish between read-from and written-to indexes, while also beginning to overhaul the system to make a more general usage-checking framework that operates on the control flow graph 2008-01-25 16:17:17 +00:00
Neil Brown
86b8185b1f Added a few more helper functions to the Utils module 2008-01-25 16:12:20 +00:00
Neil Brown
d2b427c268 Added some comments to the FlowGraph module 2008-01-25 15:58:32 +00:00
Neil Brown
75dd2afeb2 Added support for timing tests in the automatic test cases 2008-01-23 15:23:26 +00:00
Neil Brown
d1fa9fd71f Added a helper function for timing tasks in the TestUtils module 2008-01-23 15:23:00 +00:00
Neil Brown
9c9295fd74 Added the filename of an automatic test as its test-label 2008-01-22 22:42:29 +00:00
Neil Brown
fde2d8dc17 Changed the assertEquivalentProblems so that the sizes are displayed alongside the zipped lists 2008-01-16 16:25:57 +00:00
Neil Brown
a14a866502 Changed the test harness to get some tests inside the IO monad. This allows all the tests to be run, not just until the first failure 2008-01-16 11:15:05 +00:00
Neil Brown
9edc9fea78 Added a TestHarness module that easily allows full-compilation tests from external source files 2008-01-16 03:27:47 +00:00
Neil Brown
5988684c00 Moved the Pass list from Main to its own module (PassList) and included the usage-checking pass (when the appropriate option is turned on) 2008-01-16 03:26:20 +00:00
Neil Brown
b8e4864d08 Added an option for usage-checking to the CompState; currently turned off by default 2008-01-16 03:24:25 +00:00
Neil Brown
fa7ec6d407 Added a helper function (assertEqualCustomShow) to the TestUtils module 2008-01-15 18:09:49 +00:00
Neil Brown
d3fca1d610 Moved showMaybe to the Utils module and added a similar showListCustom function 2008-01-15 18:08:56 +00:00
Neil Brown
8cfa9e3cb0 Added a new helper function to Utils (transformTriple) 2008-01-15 17:05:45 +00:00
Neil Brown
8f1d1368af Stopped makeEquations unnecessarily producing duplicate equations 2007-12-17 02:22:09 +00:00
Neil Brown
91bfa4ae54 Added more helper functions to the Utils module, for dealing with arrays and maps 2007-12-17 02:08:37 +00:00
Neil Brown
140bd94ce3 Added various (QuickCheck) Result helper functions to the TestUtils module 2007-12-13 23:51:49 +00:00
Neil Brown
8d89a88735 Added a couple more functions to the Utils module 2007-12-13 23:51:11 +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
337f189b8a Separated the QuickCheck tests from the HUnit tests and made the number of test-cases configurable for the QuickCheck tests 2007-12-13 18:21:53 +00:00
Neil Brown
54721cd19b Added some QuickCheck helper functions and types to TestUtil 2007-12-13 18:19:02 +00:00
Neil Brown
b39fa8053b Added two more monadic helper functions to the Utils module 2007-12-12 13:50:55 +00:00
Neil Brown
a196b53e9e Added more helper functions (mostly Array-related) to the Utils module 2007-12-11 16:49:50 +00:00
Neil Brown
905e110e86 Added a function to FlowGraph for joining two sets of graph labelling functions together 2007-12-10 15:45:06 +00:00
Neil Brown
7ea3d2a7f9 Added an @@ operator for Named patterns, like in the Tock presentation 2007-11-21 14:25:32 +00:00
Douglas Warren
1d83167c01 Fixed some haddock parsing problems in the documentation 2007-11-14 16:26:47 +00:00
Douglas Warren
d82a80639d Removed the dependency on Control.Monad.State.Class package, since that isn't in the older Debian versions 2007-11-14 16:24:03 +00:00
Neil Brown
01c7f25f46 Added much more documentation to the FlowGraphTest module 2007-11-12 15:19:12 +00:00
Neil Brown
a248f58201 Turned off generating ASTS with Specs inside Case statements until they have been properly implemented and tested 2007-11-10 23:29:49 +00:00
Neil Brown
185f515cf7 Improved the error message when the graph building fails for QuickCheck 2007-11-10 23:18:21 +00:00
Neil Brown
089091d59b Added a safety check when building the flow graph 2007-11-10 23:18:01 +00:00
Neil Brown
ff01b24efd Added more items to the AST QuickCheck generator 2007-11-10 21:13:55 +00:00
Neil Brown
19ba2a321c Fixed another misplaced Meta tag problem, this time with Specification 2007-11-10 21:13:16 +00:00
Neil Brown
2c33e1e499 Fixed some meta-tag confusion with the While statement when building a flowgraph 2007-11-10 20:28:12 +00:00
Neil Brown
ac2bee7b48 Added a generator for A.Case to the flow-graph testing 2007-11-10 19:17:01 +00:00
Neil Brown
f050dadaec Added a type specifier to FlowGraphTest to match the changes to the flow-graph builder 2007-11-10 19:16:20 +00:00
Neil Brown
53826fb405 Changed the flow-graph builder to allow the monad for AlterAST to be different from the monad for GraphLabelFuncs (they always were separate internally anyway) 2007-11-10 19:07:43 +00:00
Neil Brown
7168799784 Fixed the use of the wrong meta tag in the handling of A.Choice when building the FlowGraph, which was confusing the QuickCheck tests 2007-11-10 18:31:16 +00:00
Neil Brown
7929715594 Added support for printing printing the results of QuickCheck test failures 2007-11-10 18:23:04 +00:00
Neil Brown
2a7662e46e Added code to build an AST properly for testing (esp. A.Structured) and implemented enough tests to get a failure 2007-11-10 01:31:56 +00:00
Neil Brown
85375c3c6c Changed the flow-graph testing quickcheck functions to use a size parameter when recursively building the trees 2007-11-09 23:48:12 +00:00
Neil Brown
d60d70cf82 Changed the unique identifiers in FlowGraphTest to be their own type, to reduce confusion 2007-11-09 20:05:06 +00:00
Neil Brown
83ab0c16f5 Added a couple more helper functions/operators to the Utils module 2007-11-09 19:45:03 +00:00
Neil Brown
1554d5c7ba Added an initial (slightly clumsy) attempt at using quickcheck to generate ASTs and test the flow-graph-based tree-altering functions 2007-11-09 17:47:10 +00:00
Neil Brown
2141a7d6f2 Added AlterAST to FlowGraph's export list 2007-11-09 17:45:19 +00:00
Neil Brown
a46c7a6fe3 Added more functions to the Utils function, for uncurrying functions and forming cartesian products 2007-11-09 17:26:55 +00:00
Neil Brown
572b53c3b6 Added another helper function to Utils; a version of modify that returns the old state 2007-11-09 17:13:58 +00:00
Neil Brown
af1574643d Added two more helper functions to the Utils module 2007-11-09 11:19:09 +00:00
Neil Brown
47f5e36f9c Added another helper function, seqPair, to the Utils module 2007-11-09 01:23:46 +00:00
Neil Brown
bacc3115e9 Added various general helper functions to the Utils module 2007-11-09 01:18:42 +00:00
Neil Brown
a5c02f36ec Removed the Metadata hack (where emptyMeta was "equal" to every other Meta data tag) 2007-11-10 14:14:18 +00:00
Neil Brown
fbbe539bc0 Changed the types in FlowGraphTest to match the changes to FlowGraph 2007-11-07 13:30:44 +00:00
Neil Brown
08a8f80722 Changed the types and implementation of the buildFlowGraph function to add the new ASTModifier functions.
This patch is very large, because it contains all the required changes.  Buried in there is a change in how Options are processed in Case statements; they are no longer shoe-horned into ExpressionLists, but rather create a Node for each Expression and chain them together.
2007-11-07 13:22:56 +00:00
Neil Brown
9ca3cf0f86 Changed the node type in the control flow graph to add a modification function, and adjusted the types of the other graph types accordingly 2007-11-07 13:17:15 +00:00
Neil Brown
4539745dff Introduced scoped type variables into the signature of flowAlgorithm 2007-11-07 13:00:10 +00:00
Neil Brown
13cf7df8bf Added functions for helping to decompose the AST and map functions over it 2007-11-07 11:26:07 +00:00
Neil Brown
5f57803616 Moved assertEither and assertEitherFail into TestUtil 2007-11-02 16:44:10 +00:00
Neil Brown
4bb2b2a407 Moved mapPair into Utils, and renamed it to transformPair (to be consistent with the pre-existing transformX functions) 2007-11-02 16:44:02 +00:00
Neil Brown
b291901f5c Changed the flowAlgorithm function to have an error return (of type String) 2007-11-02 14:00:45 +00:00
Neil Brown
de6bd021f0 Added the basics of an algorithm for doing iterate data-flow analysis 2007-11-01 11:41:17 +00:00
Neil Brown
d38c2aef08 Overhauled the usage checker to use sets of Strings for recording the used variables 2007-10-29 17:32:23 +00:00
Neil Brown
7433e49d49 Added support for List types to the C and C++ backend, in genType at least 2007-10-27 11:24:24 +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
a6cbdfeb94 Changed some functions in the Types module to handle the new List type 2007-10-25 10:11:19 +00:00
Neil Brown
201c6ab754 Added a List type to the AST 2007-10-25 10:02:50 +00:00
Neil Brown
cbc6a70b30 Changed the control-flow graph generation to use the proposed function dictionary, and add the scope-out nodes 2007-10-28 18:26:09 +00:00
Neil Brown
adafbd2cc4 Added support (and tests) for if statements in the control-flow graph generation 2007-10-28 17:24:26 +00:00
Neil Brown
49228150cf Refactored a couple of clauses in the building of the control-flow graph 2007-10-28 17:04:45 +00:00
Neil Brown
5c4bf74a75 Added support (and tests) for case statements in the control-flow graph 2007-10-28 16:31:15 +00:00
Neil Brown
bd14ed56ba Changed the edge-labelling scheme in the control-flow graph to have beginpar/endpar nodes with matching ids 2007-10-28 14:55:43 +00:00
Neil Brown
b6d525fbb8 Added tests for while loops in the control-flow graph 2007-10-28 12:39:26 +00:00
Neil Brown
cde83c83ae Added the capability of outputting graphviz scripts representing control-flow graphs 2007-10-28 12:11:27 +00:00
Neil Brown
25f13e6c6f Added more tests for the control-flow graph, for Specs in Structured items 2007-10-28 11:38:04 +00:00
Neil Brown
cf17814b98 Changed the types involved in the control-flow graph so that I can customise the Show implementation 2007-10-28 11:35:51 +00:00
Neil Brown
a0c54220e2 Added more tests for the Seq and Par blocks in the control-flow graph 2007-10-28 01:25:44 +00:00
Neil Brown
cb17d62018 Changed findMeta so that it now works when directly applied to a Meta tag 2007-10-28 01:23:10 +00:00
Neil Brown
d2e54ea483 Added another helper function to the Utils module 2007-10-28 01:22:55 +00:00
Neil Brown
aea462d41a Fixed some bugs in the test harness for the control-flow graph 2007-10-28 00:36:27 +00:00
Neil Brown
fbd297e23e Added more tests for the control-flow graph stuff (for basic Seq and Par blocks) 2007-10-28 00:13:15 +00:00
Neil Brown
9b1cd56050 Changed the identifiers/values on graph nodes in the control-flow graph to be produced monadically, and altered the tests accordingly 2007-10-27 23:59:33 +00:00
Neil Brown
8fa046798a Tidied up and simplified the test code in FlowGraphTest to operate on lists of nodes/edges, rather than decomposing the graph
When you decompose a graph, each edge only appears once; on one of the nodes it is attached to.  This meant our testing was not working properly.

The easier solution is to forget how the graph works underneath, get a list of nodes and a list of edges, then operate on those.
2007-10-27 23:56:44 +00:00
Neil Brown
f0c552663b Added the initial implementation of a module (and tests) for generating a control-flow graph from an AST
This implementation needs to be changed; it currently uses Meta as a primary key for nodes, but that isn't valid.
2007-10-27 21:18:55 +00:00
Neil Brown
9fd67023b7 Added some new general helper functions to the Utils module. 2007-10-27 21:15:04 +00:00
Neil Brown
7f59eec189 Changed the C and C++ backends (and tests) to handle declarations with initialisers properly 2007-10-25 00:27:12 +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
1f604781f5 Added an AST item for blanking mobiles 2007-10-24 20:50:44 +00:00
Neil Brown
31642036b7 Added support for the new AllocMobile item in the Types module 2007-10-24 19:31:07 +00:00
Neil Brown
00d48d27de Added an AST Expression for allocating mobiles 2007-10-24 19:30:44 +00:00
Neil Brown
f68a6cd31d Added cases for DerefVariable to some functions in Types 2007-10-24 15:57:03 +00:00
Neil Brown
f8006696b2 Added a dereferenced mobile item to Variable in the AST 2007-10-24 15:56:02 +00:00
Neil Brown
86054ba754 Added code for the Mobile types to the ShowCode module 2007-10-21 14:18:51 +00:00
Neil Brown
521730bf8b Added the Mobile type to the AST 2007-10-21 14:15:56 +00:00
Neil Brown
f0fdc05ff3 Added a large hunk of code in ShowCode that allows us to print out occam programs using the right indentation.
The code is messy, and not quite finished, but for now it isn't actually being used.  So I'm committing it, ready to be fixed up at a later date.
2007-10-18 09:33:37 +00:00
Neil Brown
acca3d03fd Removed the A.Main item from the AST entirely 2007-10-17 13:43:40 +00:00
Neil Brown
3727307a78 Changed the shared passes to operate on Structured items, rather than Process items 2007-10-17 13:24:42 +00:00
Neil Brown
a25824b601 Changed the passes to be of type Pass, rather than A.Process -> PassM A.Process 2007-10-17 13:09:16 +00:00
Neil Brown
4d6d6dc555 Added a new function (checkTempVarTypes) to the TestUtil module 2007-10-10 23:11:35 +00:00
Neil Brown
a68ecfb24b Added a new function (typeOfSpec) to the Types module 2007-10-10 23:10:46 +00:00
Neil Brown
c9da8942d5 Changed the default compilation mode from being just occam/Rain->C/C++ compilation to being occam/Rain->binary ("all-in-one") compilation 2007-10-09 00:41:13 +00:00
Neil Brown
c17cf0ce38 Added the first attempt at getting Tock to do an all-in-one compile, from occam/Rain all the way through into an executable binary 2007-10-08 21:18:07 +00:00
Neil Brown
f32471709d Fixed a few small unescaped slashes that were confusing haddock 2007-10-02 14:55:19 +00:00
Neil Brown
c59c2ed5f6 Removed an unused function (simplifyType) from the Types module 2007-10-02 14:48:09 +00:00
Neil Brown
15ecb2b178 Added the -fwarn-type-defaults compiler option (for when integer literals are given a default type) and fixed the few warnings that arose from doing so 2007-09-27 13:29:16 +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
47052d5f39 Fixed a bug where the default cases were left out for the recent "genericised" functions in the Types module 2007-09-27 10:59:35 +00:00
Neil Brown
be676060b9 Added a new wait guard (that matches the Rain wait guards exactly) to the AST 2007-09-26 23:18:57 +00:00
Neil Brown
13584ed2cb Added a wait statement to the AST, and added Rain tests for parsing wait statements 2007-09-26 23:00:09 +00:00
Neil Brown
c925774280 Changed the types code so that all the tests for the new Time type pass 2007-09-19 11:24:14 +00:00
Neil Brown
135a4d6bfd Added a helper function for marking when a test is a Rain test (which means any test output will be displayed as Rain code, not as occam code) 2007-09-19 11:08:25 +00:00
Neil Brown
c6217865b9 Added the Time type, and the GetTime process to the AST, and added showOccam/showRain lines for the Time type 2007-09-19 10:20:40 +00:00
Neil Brown
629137443f Scrapped some boilerplate in Types by changing a couple of functions (simplifyType, underlyingType) to use generics 2007-09-18 18:37:53 +00:00
Neil Brown
c899282873 Changed dieIO to print out context for the error when it is given a valid meta tag 2007-09-18 11:48:11 +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
1baecd7955 Moved findMeta into the Metadata module 2007-09-18 09:50:45 +00:00
Neil Brown
deef9dd209 Added documentation to PrettyShow and ShowCode, along with an export list for the latter. 2007-09-17 17:51:49 +00:00
Neil Brown
75ae6fa36f Removed an unused member of CompState (csLoadedFiles) 2007-09-17 17:42:48 +00:00
Adam Sampson
a78fb8e917 Add functions to pack Metas as string prefixes.
These will be useful for passing source positions through Parsec's string error
mechanism.
2007-09-17 23:05:47 +00:00
Neil Brown
1172bfd2a0 Added the pshowCode function that uses the ShowOccam and ShowRain classes to print out applicable parts of an AST 2007-09-17 10:38:30 +00:00
Neil Brown
3e342a621c Added ShowOccam and ShowRain type-classes, and changed existing code to use these new show methods in error messages
The function showCode shows code as either occam or Rain depending on the frontend.  This is then used by a formatCode function that acts similar to 
printf, which makes it easy to format error messages that use showCode.
2007-09-16 17:20:57 +00:00
Neil Brown
1c5ad805d3 Simplified the buildExprPattern function in TestUtil 2007-09-16 13:07:28 +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
a454aa78f8 Rain: implemented the checkExpression function and got it passing the tests so far 2007-09-15 18:57:02 +00:00
Neil Brown
7f9357d658 Rain: changed from using the isSafeConversion function to a more appropriate new function isImplicitConversionRain 2007-09-15 18:54:19 +00:00
Neil Brown
1ea59d40bd Created an export list for the Types module, and added documentation to all the exported functions 2007-09-15 14:31:33 +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
ff0291f28d Added a new function to TestUtil that allows you to specify an extra check to run on the result of a pass 2007-09-15 13:09:26 +00:00
Neil Brown
4221b0d698 Moved a function from RainPassesTest into TestUtil 2007-09-15 11:24:49 +00:00
Neil Brown
ebdc084810 Renamed a (currently unused) function in TestUtil 2007-09-15 11:24:17 +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
Neil Brown
117173f758 Added the basics needed to generate XML from the AST using HaXml and DrIFT 2007-09-14 19:13:15 +00:00
Neil Brown
7ef6d7728f Added helper functions for converting constructors into Constr items 2007-09-12 08:49:14 +00:00
Neil Brown
9b1fbc3f8f Added a helper function for creating passes that check the validity of the AST 2007-09-12 08:45:23 +00:00
Neil Brown
ad8aab723b Added a function for searching for particular constructors in a tree, and an associated test 2007-09-12 00:11:22 +00:00
Neil Brown
000270f4a8 Created a new module for tests in the common directory (named CommonTest) and moved testIsSafeConversion across 2007-09-11 23:34:45 +00:00
Neil Brown
dbdef53e31 Added a short comment explaining the choice of AnyDataItem in TreeUtil 2007-09-11 22:58:58 +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