An expression like:
foo(1, fail, 2)
was failing to parse, because the parser was interpreting the comma
as the start of an expression that was an argument to fail, rather
than recognizing that the fail here has no arguments
Fixed this by using can_begin_expr to determine whether the next
token after a fail token suggests that this is a nullary fail or a
unary fail.
In addition, when translating calls, check before translating each
argument that the block still isn't terminated. This has the effect
that if an argument list includes fail, the back-end won't keep trying
to generate code for successive arguments and trip the !*terminated
assertion.
The code for translating a fail (for example) would call
Unreachable(), which terminates the block; if a fail appeared as an
argument, this would cause an LLVM assertion failure. Changed
trans_call to handle this situation correctly.
If the channel is associated with a port then the destructor will assert.
Additionally, destruction of the object is not always appropriate. This brings
the deref() method into sync with the behavior of generated rust code which
only invokes destroy() once the reference count goes to 0.
The macro with the extra dtor parameter is intended for structures like
rust_chan which may not necessarily delete themselves when the ref count
becomes 0. This functionality will be used in an upcoming changeset.
Only link attributes of the meta_list type are considered when matching crate
attributes. Instead of doing nothing we can at least log that link attributes
of other types were ignored.
(Using the * operator.)
This makes tags more useful as nominal 'newtype' types, since you no
longer have to copy out their contents (or construct a cumbersome
boilerplate alt) to access them.
I could have gone with a scheme where you could dereference individual
arguments of an n-ary variant with ._0, ._1, etc, but opted not to,
since we plan to move to a system where all variants are unary (or, I
guess, nullary).
This is a preparation for tags-as-nominal-types. A tag that has only a
single variant is now represented, at run-time, as simply a tuple of
the variant's parameters, with the variant id left off.