Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid useless errors in generated files #21

Merged
merged 4 commits into from
Jun 14, 2024
Merged

Conversation

bugarela
Copy link
Collaborator

Hello :octocat:

By trying the tool on a real-world contract, there is a bunch of small silly syntax/name errors that get in the way of figuring out what actually needs fixing. This PR addresses that by solving or avoiding a number of those problems, so the resulting model only has errors for things that are not trivial to fix.

Unfortunately, our test suite doesn't cover a lot of those. I need to introduce something like a "Super Contract" to our fixtures, so I can add cases for all of this things to it. This work was just a 1-day spike, and I don't really have time to set that up at this time.

Some of the fixes are:

  1. Wrap outputs like <missing-type> in quotes or use another value supported by Quint syntax so these don't result in syntax errors (that mess up Quint error reporting many times)
  2. Prevent scenarios like [, foo, bar] by filtering out empty strings in translate_list and others, as we use empty string for untranslated cases (i.e. Lifetimes)
  3. Support generics (at least the common case).
  4. Add height to BlockInfo since many contracts use that
  5. Create dummy types for completeness, so we have a way to translate useless things in a way it doesn't break the model: TraitObject, MultiIndex and IndexedMap. Also stop translating definitions that are only about indexes as they are completely useless in the model.
  6. Sanitize names that are reserved keywords in quint (i.e. action)(Closes Rename quint keywords #11)
  7. Improve initialization so we can generate types for enums and values that have type aliases as their type.

@bugarela bugarela requested a review from p-offtermatt June 13, 2024 18:58
@bugarela
Copy link
Collaborator Author

I'll merge this one without review since Philip is on vacation and it's pretty low risk.

@bugarela bugarela merged commit 13222c3 into main Jun 14, 2024
1 check passed
@bugarela bugarela deleted the gabriela/syntax-reliability branch June 14, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename quint keywords
1 participant