Skip to content

add the list of opened elements to report#75

Open
craff wants to merge 5 commits intoaantron:masterfrom
craff:detail_reports
Open

add the list of opened elements to report#75
craff wants to merge 5 commits intoaantron:masterfrom
craff:detail_reports

Conversation

@craff
Copy link

@craff craff commented Jul 17, 2023

This could help with issue #74.

@craff
Copy link
Author

craff commented Jul 17, 2023

We could use report/detailed_report to avoid mapping the list of open_elements at each report if detailed_report is not demanded by the user ?

@craff
Copy link
Author

craff commented Jul 17, 2023

Here is an example of use!

let parse_html ~dynamic ~filename s =
  let detailed_report opens (line,col) err =
    match opens, err with
    | ((_,"ml"), _, _)::_, (`Bad_token _ | `Bad_content _) -> ()
    | _ ->
       Printf.eprintf "File %S, line %d, characters %d:\n %s\n%!"
         filename line col (Error.to_string err);
       exit 1;
  in
  let element = element ~dynamic ~filename in
  let context = if dynamic then Some `Document else None in
  s |> parse_html ~detailed_report ?context |>
    trees_with_loc ~element ~text ~comment ~pi ~xml ~doctype

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.

1 participant