Zulip Chat Archive

Stream: lean4

Topic: Declaring new syntax for greater universes


Gabriel Ebner (May 10 2021 at 10:41):

I would have expected this to work (and it works if I swap term and level). Am I doing something wrong or is this a bug?

syntax "frob " term : level
-- unknown attribute [levelParser]

Mario Carneiro (May 10 2021 at 10:46):

syntax "frob" : level doesn't work either. I guess level isn't a syntax category?

Patrick Massot (May 10 2021 at 10:47):

mathlib4 is moving faster than I thought. I'd never think we'd already be doing Frobenius morphisms.

Kevin Buzzard (May 10 2021 at 10:56):

this is great news, because we're having trouble with them in Lean 3...

Sebastian Ullrich (May 10 2021 at 11:04):

Mario Carneiro said:

I guess level isn't a syntax category?

It is a category for builtin parsers only. Changing that wouldn't immediately be of any help because it does not have support for macros or elaborators (probably unnecessary?) either yet.

Gabriel Ebner (May 10 2021 at 11:15):

What I want is similar to Type (← frob). The ← frob is then lifted before expansion, so I wouldn't even need level macros.

Gabriel Ebner (May 10 2021 at 17:13):

For now I can live with the following workaround, but it would be really great if the level parsers were extensible.

syntax "Type" "(" "←" term ")" : term
syntax "Sort" "(" "←" term ")" : term

Last updated: Dec 20 2023 at 11:08 UTC