Skip to content

Commit

Permalink
Children order: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Nov 15, 2024
1 parent a2fd4be commit 97eddcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/model/semantics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ let rec find_tag f = function
warn_unexpected_tag hd;
find_tag f tl)

let rec find_tags acc f = function
let rec find_tags acc ~filter = function
| [] -> List.rev acc
| hd :: tl -> (
match f hd.Location.value with
| Some x -> find_tags ((x, hd.location) :: acc) f tl
match filter hd.Location.value with
| Some x -> find_tags ((x, hd.location) :: acc) ~filter tl
| None ->
warn_unexpected_tag hd;
find_tags acc f tl)
find_tags acc ~filter tl)

let handle_internal_tags (type a) tags : a handle_internal_tags -> a = function
| Expect_status -> (
Expand All @@ -73,7 +73,7 @@ let handle_internal_tags (type a) tags : a handle_internal_tags -> a = function
| Expect_page_tags ->
let unparsed_lines =
find_tags []
(function `Children_order _ as p -> Some p | _ -> None)
~filter:(function `Children_order _ as p -> Some p | _ -> None)
tags
in
let lines =
Expand Down
4 changes: 3 additions & 1 deletion src/parser/test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ module Ast_to_sexp = struct
| `Return es ->
List (Atom "@return" :: List.map (at.at (nestable_block_element at)) es)
| `Children_order es ->
List (Atom "@return" :: List.map (at.at (nestable_block_element at)) es)
List
(Atom "@children_order"
:: List.map (at.at (nestable_block_element at)) es)
| `See (kind, s, es) ->
let kind =
match kind with
Expand Down

0 comments on commit 97eddcb

Please sign in to comment.