Skip to content

Commit

Permalink
fix: typos in code in "a- Context free"
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin defargoth committed Nov 8, 2024
1 parent ee3fbd7 commit 16cccfd
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions examples/2 - Writing PPXs/a - Context Free/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ let from_string = function
- **Match the type declaration with pattern matching:**

```ocaml
let enum2 ~ctxt ast =
let enum ~ctxt ast =
let loc = Expansion_context.Deriver.derived_item_loc ctxt in
match ast with
| ( _,
Expand All @@ -253,20 +253,7 @@ let from_string = function
ptype_kind = Ptype_variant variants;
_;
};
] ) ->
(* the structure_item we are looking for is a PStr_type *)
match structure_item with
| (
(* Doesn't matter the rec_flag for us *)
_,
[
{
ptype_name = { txt = type_name; _ };
ptype_kind = Ptype_variant variants;
_;
};
] ) -> (* ... *)
| _ -> (* ... *)
] ) -> (*...*)
```

- **Create functions to generate the patterns:**
Expand Down

0 comments on commit 16cccfd

Please sign in to comment.