Zulip Chat Archive

Stream: mathlib4

Topic: parsing ⇑


Scott Morrison (Dec 06 2022 at 01:00):

@Gabriel Ebner, parsing (from Mathlib/Coe.lean) is not working correctly: e.g. I have a ⇑e.toOrderEmbedding = e which is giving the error cannot coerce to function toOrderEmbedding e = RelIso.toRelEmbedding e. Changing this to (⇑e.toOrderEmbedding) = e works fine.

Mario Carneiro (Dec 06 2022 at 01:03):

that sounds like a precedence issue

Mario Carneiro (Dec 06 2022 at 01:03):

I would guess it needs a precedence in the range of 100

Mario Carneiro (Dec 06 2022 at 01:06):

It doesn't have a declared precedence, which I think means it is max on the left and 0 on the right, i.e. it consumes everything after it

Mario Carneiro (Dec 06 2022 at 01:08):

ah, actually it's leadPrec not maxPrec but it doesn't make much difference

Scott Morrison (Dec 06 2022 at 01:09):

How do I add the precedence?

Mario Carneiro (Dec 06 2022 at 01:09):

elab:leftPrec "⇑" x:term:rightPrec

Mario Carneiro (Dec 06 2022 at 01:11):

having the default (high) left prec seems fine but the right prec should be at least 70 so that it goes above the usual binary operators


Last updated: Dec 20 2023 at 11:08 UTC