lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

Double-backtick quotations with other syntax categories/parsers

Open Kha opened this issue 4 years ago • 2 comments

Currently ``(cat| ...) is not supported, i.e. it can only be used with command/term. I'd like to wait with this change until we have unified the | notation in a single parser supporting dynamic lookups.

It also doesn't work with macro's category inference yet.

Kha avatar Apr 28 '21 08:04 Kha

On the other hand, it is unlikely to work for categories other than term anyway without a massive number of custom precheck hooks. For example, even if it syntactically already supports command, we will need a custom hook for each non-macro command.

Kha avatar Apr 28 '21 08:04 Kha

This would be very helpful when referencing theorems inside tactic quotations. In the example below, there is no check that foo is actually available.

-- inside TacticM
evalTactic (← `(tactic|
  refine foo _ ?_
))

larsk21 avatar Aug 16 '22 08:08 larsk21