This is a mildly scaring change, as it may horribly break things down
the line if we have ever relied on that information... However, the
value constructors inside each module are meant to reflect the own
module public API, and shouldn't be populated with Prelude stuff. Not
only does that mean this information is duplicated for all modules
(possibly significantly slowing things down), but it may also cause
weird scoping issues (e.g. one accessing a Prelude's constructor
through some random module).
Hence why I am isolating this change in this single commit, so it's
easier to troubleshoot if that ends up causing weird issues.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
We were mixing module names and package names in a very weird way but it was somehow working. However, the generated ASTs would vastly differ from what we would typically get from running those tests on a standard project -- which defies a bit the purpose of those tests.
Signed-off-by: KtorZ <matthias.benkort@gmail.com>
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.