Commit Graph

1299 Commits

Author SHA1 Message Date
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
Neil Brown
a4453fe3c3 Rain: changed parse errors to report using dieP (with a Meta position) instead of just dieIO 2007-09-17 11:18:38 +00:00
Neil Brown
d92e042159 Moved the functions for converting between Meta and SourcePos (from Parsec) into a common ParseUtils module 2007-09-17 11:15:17 +00:00
Adam Sampson
fd2109d548 Fix a dummy filename that I'd forgotten to change. 2007-09-17 23:12:23 +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
6c3864cdfd Rain: wired up the new type-checking passes 2007-09-16 12:09:22 +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
dd70fb315a Fixed the haddock command in the Makefile 2007-09-16 08:43:17 +00:00
Neil Brown
9ef8343c3a Rain: moved matchParamPass into RainTypes 2007-09-15 21:29:30 +00:00
Neil Brown
9965c7373e Rain: removed an outdated comment 2007-09-15 21:20:41 +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
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
f9c21dc4c7 Rain: fixed a nasty copy-and-paste mistake in RainTypesTest 2007-09-15 18:35:13 +00:00
Neil Brown
feedce5a24 Removed unnecessary dependencies of a few non-test modules on TestUtil 2007-09-15 14:33:23 +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
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
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
9ffb5b5931 Rain: corrected a comment in RainPasses 2007-09-15 11:25:35 +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
bad3f0818a Rain: implemented the pass to record the types of integer literals 2007-09-15 10:55:53 +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
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
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
3f573dabd5 Rain: corrected innerBlock to work sensibly with multiple declarations (particularly for the start of par blocks) 2007-09-14 12:53:26 +00:00
Neil Brown
ff9b0d6611 Rain: changed the innerBlock parser to work with the new rules for declarations in par blocks, and also simplified its output slightly 2007-09-14 12:22:12 +00:00
Neil Brown
59d86a0afc Rain: stopped semi-colon being a valid statement by itself 2007-09-14 11:46:18 +00:00
Neil Brown
8af4a9f687 Added generation of forward declarations to the C and C++ backends.
These declarations are necessary for recursive functions/procs, so that the (forward) declarations are visible to the implementations.

Later on, the declarations could be moved into header files, which would allow multiple source files to be compiled (generating multiple header files) and linked together using the gcc linker.  Alternatively, external C/C++ programs could use code originally written in occam/Rain by including the header files.
2007-09-12 12:09:35 +00:00
Neil Brown
aefb02caa6 Added missing cases for A.DirectedVariable in the C and C++ backends 2007-09-12 10:17:15 +00:00
Neil Brown
c40d94c655 Added a couple of passes that check the validity of the AST at the beginning and end of the Rain passes 2007-09-12 08:50:19 +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