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

Antiquotes in block category do not work #257

Closed
eric-wieser opened this issue Dec 18, 2024 · 1 comment · Fixed by #264
Closed

Antiquotes in block category do not work #257

eric-wieser opened this issue Dec 18, 2024 · 1 comment · Fixed by #264
Labels
bug Something isn't working

Comments

@eric-wieser
Copy link

eric-wieser commented Dec 18, 2024

Minimized to be verso-free:

import Lean

open Lean.Parser (rawIdent)

declare_syntax_cat arg_val
syntax (name:=arg_str) str : arg_val

declare_syntax_cat argument
syntax (name:=anon) arg_val : argument
syntax (name:=named) ident ":=" arg_val : argument

declare_syntax_cat inline

declare_syntax_cat block
syntax (name:=directive) "directive{" rawIdent argument* "}" "[" block* "]": block

syntax (name:=header) inline* : block

example : Lean.TSyntax `block → Bool :=
  fun
  | `(block| directive{foo $args*}[$blocks]) => true
  | _ => false

which fails with "invalid 'many' parser combinator application, parser did not consume anything".

Changing

-syntax (name:=header) inline* : block
+syntax (name:=header) inline+ : block

makes the problem goes away.

@david-christiansen david-christiansen added the bug Something isn't working label Jan 6, 2025
@david-christiansen
Copy link
Collaborator

Thanks for a great bug report!

david-christiansen added a commit that referenced this issue Jan 6, 2025
All of the syntax declarations used for Verso are now used for
pattern-matching in the main elaborator, which is reason to believe
that they're now reasonably comprehensive. This should make it much
easier for others to use them to write Verso extensions.

Closes #257
david-christiansen added a commit that referenced this issue Jan 6, 2025
All of the syntax declarations used for Verso are now used for
pattern-matching in the main elaborator, which is reason to believe
that they're now reasonably comprehensive. This should make it much
easier for others to use them to write Verso extensions.

Closes #257
david-christiansen added a commit that referenced this issue Jan 6, 2025
All of the syntax declarations used for Verso are now used for
pattern-matching in the main elaborator, which is reason to believe
that they're now reasonably comprehensive. This should make it much
easier for others to use them to write Verso extensions.

Closes #257
david-christiansen added a commit that referenced this issue Jan 6, 2025
All of the syntax declarations used for Verso are now used for
pattern-matching in the main elaborator, which is reason to believe
that they're now reasonably comprehensive. This should make it much
easier for others to use them to write Verso extensions.

Closes #257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants