Skip to content

Conversation

riaqn
Copy link

@riaqn riaqn commented Aug 27, 2025

See added tests.

@riaqn riaqn requested a review from dvulakh August 27, 2025 13:07
when there are no functor args, moving modes from constraint to
identifier should not be a semantic change

Signed-off-by: David Vulakh <[email protected]>
the normalization happens in the parsrer now

Signed-off-by: David Vulakh <[email protected]>
Comment on lines 436 to 437
(* Special case: when this module binding is not a functor, and the module expression
is a constraint with modes, move the modes to the binding *)
Copy link
Author

@riaqn riaqn Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to Fmt_ast or something? I think that parser-extended should represent user input faithfully (for better print back).
(In contrast, parser-standard is fine to manipulate user input)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant to this PR since we decided to wait for compiler support before moving these modes, but fwiw: we often do normalization directly in the extended parser to avoid duplicating normalization logic in fmt_ast and normalize_extended_ast (note that we already need to duplicate it in normalize_std_ast). For example, lists of modes are sorted alphabetically directly in the extended parser.

we will want to go back to putting modes on the ident when possible,
but need the compiler to type check them better first

Signed-off-by: David Vulakh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants