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
41d4923e9c
Added support for the new Wait process to the C and C++ backends
2007-09-26 23:18:21 +00:00
Neil Brown
a65953ad89
Rain: added type-checking for wait statements
2007-09-26 23:08:55 +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
5af96110c7
Rain: implemented the parsing of wait statements
2007-09-26 23:00:58 +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
a12d46401a
Rain: implementing type checking for inputs inside alts
2007-09-26 22:37:32 +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
db4f05932b
Fixed a conflict between the old time-related patches and the new alt patches
2007-09-26 21:39:16 +00:00
Neil Brown
769dc3c79a
Rain: changed the if, while and each loops to require a block as their body, rather than just a statement.
2007-09-26 18:03:42 +00:00
Neil Brown
68c468fbea
Rain: added the parsing of else (skip) guards in alts
2007-09-26 19:56:22 +00:00
Neil Brown
420839ef1e
Rain: added tests for parsing else guards in alts
2007-09-26 19:56:11 +00:00
Neil Brown
9c87478110
Corrected a test number in ParseRainTest
2007-09-26 19:44:33 +00:00
Neil Brown
205b090cef
Rain: implemented the parsing of alt statements
2007-09-26 19:40:04 +00:00
Neil Brown
9cfbed3c6e
Rain: added tests for parsing alt statements
2007-09-26 19:39:37 +00:00
Neil Brown
1f298a8ff6
Rain: added parsing support for time
2007-09-19 12:04:11 +00:00
Neil Brown
ae262125da
Rain: added parse tests for things related to time
2007-09-19 12:03:55 +00:00
Neil Brown
ebf3040367
Rain: tidied up ParseRain a little
2007-09-19 12:03:24 +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
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
5eb149d598
Rain: added type-checker tests for the Time type
2007-09-19 11:23:41 +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
b280158e26
Added code in the C and C++ backends for handling the new Time type and GetTime statements in the AST
2007-09-19 10:34:49 +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
59962ee837
Removed some debug code that was accidentally left in a previous patch
2007-09-18 11:42:00 +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
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