Skip to content

Commit

Permalink
Review feedback: docs and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasin committed Nov 5, 2024
1 parent 7fc69b1 commit ec39ea7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
16 changes: 16 additions & 0 deletions lib/Normalize_std_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
open Parser_standard
open Std_ast

(* CR jane-syntax: Soon we will import the PR eliminating the rest of the
attribute-based jane syntax mechanism
(https://github.com/ocaml-flambda/flambda-backend/pull/3162), and the
person who does that will have some work to do in this file.
Currently, this file doesn't explicitly handle much of what remains in
jane syntax (e.g., immutable arrays and module strengthening). But it is
surprising that it doesn't - it must be the case that these features are
undertested or the obvious normalization problems they create when erasing
jane syntax are masked by the broken round-trip check.
To fix that, it will likely be necessary to add explicit normalization
logic for the remaining jane street extensions to this file. At the same
time, [is_erasable_jane_syntax] below, which is currently just handling
[curry] attributes, should probably be inlined or renamed. *)

let is_doc = function
| {attr_name= {Location.txt= "ocaml.doc" | "ocaml.text"; _}; _} -> true
| _ -> false
Expand Down
2 changes: 1 addition & 1 deletion vendor/parser-extended/parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ let prepare_error err =
| Constrained_types ->
Format.fprintf ppf "constrained types are not supported"
| Private_types ->
Format.fprintf ppf "private types are not supported"
Format.fprintf ppf "private types are not supported"
| Not_with_type ->
Format.fprintf ppf "only %s constraints are supported"
"with type t ="
Expand Down
9 changes: 8 additions & 1 deletion vendor/parser-jane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ Just run:
./parser-jane/repatch.sh {path-to-flambda-backend}
```
Additional steps may be necessary if you are adding or removing files - see the
top-level HACKING.jst.md
top-level HACKING.jst.md.

Note: The import script tries to apply a patch to the newly imported parser that
restores the changes needed by ocamlformat. This diff may fail to apply cleanly,
for example if the same parts of the parser have changed in flambda-backend.
In that case, you will see in the script's output that some parts of the patch
haven't been applied and it will create ".rej" files describing them. You must
manually look at and apply these rejected portions.

### Manually

Expand Down

0 comments on commit ec39ea7

Please sign in to comment.