Commit Graph

7 Commits

Author SHA1 Message Date
Neil Brown
b1daf41ecf Added a new function to CompState that allows you to specify a custom error when lookupName fails, and changed one example of this in ParseOccam 2007-08-24 15:04:31 +00:00
Adam Sampson
64f0e1f4cb Monadic - and MINUS are not the same operator.
Neil spotted this while using MonadicSubtr in the Rain frontend -- -(MOSTNEG
INT) should fail, MINUS (MOSTNEG INT) shouldn't. This adds a MonadicMinus.
2007-08-23 22:17:15 +00:00
Adam Sampson
82df59dcfb Fix makeLiteral for arrays inside records.
This was an "obvious" bug (a missing pattern) being masked by me doing a
pattern match inside an array constructor -- if the pattern doesn't match then
it'll skip that value, rather than causing an error like it does in a case.
2007-08-23 22:07:01 +00:00
Adam Sampson
9829183a7a Apply unique naming to unscoped names too.
This means that field names end up as "foo_u123" rather than "foo" in the
generated source -- which is a good thing, because some of the cgtests use
field names like "bool" and "int".
2007-08-22 16:41:03 +00:00
Adam Sampson
95e01e54d5 Make underlyingType merge array dimensions.
This fixes a bug that cgtest56 exposed, where an array of a user-defined type
that was itself an array wound up being an array of arrays rather than a single
array.

As part of this, makeArrayType is now called addDimensions, and takes a list of
dimensions to add rather than just one.
2007-08-22 15:00:54 +00:00
Adam Sampson
01929b3f35 Fix handling of array-of-record literals.
isValidLiteralType was a bit too simplistic before; it needs to look at array
types one dimension at a time rather than trying to do the whole lot at once.
2007-08-22 12:55:41 +00:00
Adam Sampson
da89323dbc Rename Parse to ParseOccam. 2007-08-22 01:59:51 +00:00