Turns out the snapshot test would randomly fail because the expected
tokens are a HashSet, which is unordered by construction. So, using
the auto-derived `Debug` instance to compare it with snapshot would
only succeed if the tokens happened to be in the same order in the
HashSet, which only happens by accident.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
Somehow, we allow traces with no continuation after and currently
default to a Todo. That todo is completely invisible from a user
standpoint and return a generic `a`.
So it is pretty easy for someone to think their program is okay,
compiles, and have no issues, while simply crashing at runtime because
of an invisible todo.
Hence, I've changed that to default to `Void` instead, which is more
sensible as a default for an empty trace.
Also, I've made the parser fail with one puts a colon for label, but
doesn't add any value to display.
Fixes#1113.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
Has somewhat always been bothering me that it says 'compiling Aiken', which means kind of nothing in this context.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
While the feedback for human users is mostly the same, it does in fact
matter for the LSP since the quickfix will be different depending on
whether we look for a top-level identifier or if we look for a
constructor.
The typical case we see in the stdlib is the `VerificationKey` and
`Script` constructors for `Credential`, often being mixed with
their types counterparts in aiken/crypto!
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
Also, show it actually for UnknownTypeConstructor, and not
UnknownVariable. There's currently an error that wrongly assign an
'UnknownVariable' in place where it should be an
'UnknownTypeConstructor'. Fix coming in the next commit.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
The clones are cheap enough here that we likely don't need to worry about the cost of cloning; and this removes a significant foot-gun where you can wipe out the logs/labels by accessing the other field.
This refactors things so that eval_phase_two can expose logs even when the script succeeds.
It also enriches traces to be either Logs or Labels, so that we can tell the difference between the two when inspecting the traces.