aantron / markup.ml

Error-recovering streaming HTML5 and XML parsers
http://aantron.github.io/markup.ml
MIT License
146 stars 16 forks source link

produce tree with location #70

Open craff opened 1 year ago

craff commented 1 year ago

Would be nice to be able to produce a tree with some location in it. The application I have in mind is generation of ocaml file what should use the line directive for error to point in the original file.

I would add tree_with_loc and trees_with_loc similar to tree and trees.

If you assign me, I will submit a PR ASAP.

aantron commented 1 year ago

I would be happy to merge it! Can you describe the application briefly in a bit more detail? I was unable to understand -- you are generating an OCaml file from HTML, and you'd like to point lines back to the HTML file?

craff commented 1 year ago

Anton Bachin @.***> writes:

I would be happy to merge it! Can you describe the application briefly in a bit more detail? I was unable to understand -- you are generating an OCaml file from HTML, and you'd like to point lines back to the HTML file?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.

Have a look at https://raffalli.eu/simple_httpd/simple_httpd/vfs_pack.html

A PR is on its way ...

-- Christophe Raffalli tél: +689 87 23 11 48 web: http://raffalli.eu

Ce mail est signé avec pgp (Pièce jointe signature.asc, clef sur https://raffalli.eu/pgp) This mail is signed with pgp (Attachment signature.asc, key on https://raffalli.eu/pgp)

craff commented 1 year ago

I did the PR and tested it in https://github.com/craff/simple_httpd. It seems to do the job.