Fuzzer fixes - #145
Merged
Merged
Conversation
314eter
force-pushed
the
ocamlgrammarfuzzer
branch
from
June 21, 2026 23:21
3e1b21b to
838c8f4
Compare
|
Very nice! The weird difference between the two module type constraints (parsed as And this is probably accidental. I think it is worth reporting an issue on https://github.com/ocaml/ocaml, at least to raise awareness about this corner-case. |
314eter
force-pushed
the
ocamlgrammarfuzzer
branch
from
August 1, 2026 10:49
838c8f4 to
f7baaf6
Compare
Collaborator
Author
|
I updated the module type constraints fix according to ocaml/ocaml#14978. |
314eter
force-pushed
the
ocamlgrammarfuzzer
branch
from
August 1, 2026 11:23
f7baaf6 to
da5769a
Compare
314eter
force-pushed
the
ocamlgrammarfuzzer
branch
from
August 2, 2026 19:26
da5769a to
4c7622b
Compare
Collaborator
Author
|
Added some more fixes for issues found while fuzzing OxCaml syntax. |
314eter
force-pushed
the
ocamlgrammarfuzzer
branch
from
August 2, 2026 19:55
4c7622b to
322d14d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some issues found by ocamlgrammarfuzzer:
Include functor
As mentioned in #138 (comment), the
include functorsupport breaks some syntax that was previously valid but rejected by the type checker. Not really an issue in practice, but it's possible to support both by introducting a conflict.Open module in signatures
Until now, the
open_modulerule in structures and signatures was the same. But in reality they are slightly different, and it's not possible to support both with one rule. So there is now a separateopen_module_signature.Module type constraints
Weird behaviour by the OCaml parser:
The first one is parsed as
(T with module type T = T) -> T, the second one asT with module type T := (T -> T). I don't understand how that's possible (the rules look identical), but we should do the same.Range patterns
Range patterns were not supported everywhere they should be. This is accepted now:
Extra constructors
Until now, boolean literals (
true,false) and unit (()) were parsed as constants, but the OCaml parser handles them as special constructors. This is now accepted (but please don't):The downside is that
[]is not parsed as alist_expressionanymore but as theempty_listconstructor.