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

fix: liftCommandElabM now carries more state over #5800

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Oct 22, 2024

The liftCommandElabM : CommandElabM α -> CoreM α function now carries over macro scopes, the name generator, info trees, and messages.

Adds a flag throwOnError, which is true by default. When it is true, then if the messages contain an error message, it is converted into an exception. In this case, the infotrees and messages are not carried over; the motivation is that throwOnError is likely used for synthetic syntax, and so the info and messages on errors will just be noise.

The `liftCommandElabM : CommandElabM α -> CoreM α` function now carries over macro scopes, the name generator, info trees, and messages.

The infotrees and messages are updated only when `throwOnError` is false, which is a flag that causes `liftCommandElabM` to throw an error when a command logs an error message.
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Oct 22, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 22, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 22, 2024
@kmill kmill changed the title fix: liftCommandElabM now carries more state fix: liftCommandElabM now carries more state over Oct 22, 2024
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Oct 22, 2024
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Oct 22, 2024

Mathlib CI status (docs):

@kmill kmill enabled auto-merge October 24, 2024 23:00
@kmill kmill added this pull request to the merge queue Oct 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Oct 24, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Oct 24, 2024
Merged via the queue into leanprover:master with commit 0725cd3 Oct 24, 2024
15 checks passed
tobiasgrosser pushed a commit to opencompl/lean4 that referenced this pull request Oct 27, 2024
The `liftCommandElabM : CommandElabM α -> CoreM α` function now carries
over macro scopes, the name generator, info trees, and messages.

Adds a flag `throwOnError`, which is true by default. When it is true,
then if the messages contain an error message, it is converted into an
exception. In this case, the infotrees and messages are not carried
over; the motivation is that `throwOnError` is likely used for synthetic
syntax, and so the info and messages on errors will just be noise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants