package ppx_dream_eml
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
PPX to process Dream's Embedded ML syntax
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.0.tar.gz
md5=ff3c93a02b418ae319918c0629dcb21f
sha512=503ef7735fe4421ea234b7d7d57845cbf3e016cb6f29838edad162c96fefdaac6512a1da34cfd0a432638171eba10dc6f556edaf8a610ffaf45fc73646592814
doc/src/ppx_dream_eml/ppx_dream_eml.ml.html
Source file ppx_dream_eml.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37open Ppxlib open Eml (** Processes a Dream Embedded ML input string and produces OCaml output. This is lifted almost exactly from the Dream library's [process_file] function, but adjusted to take a string as input and produce a string as output. *) let process_string input_string = let input_stream = Stream.of_string input_string in Location.reset (); let x = ref "" in let append_output str = x := !x ^ str in let _ = input_stream |> Tokenizer.scan |> Transform.delimit |> Transform.unindent |> Transform.coalesce |> Transform.trim |> Generate.generate ~reason:false "" append_output in !x let expand ~ctxt eml = let _loc = Expansion_context.Extension.extension_point_loc ctxt in let out = process_string eml in out |> Lexing.from_string |> Parse.expression let ppx_dream_eml_extension = Extension.V3.declare "eml" Extension.Context.expression Ast_pattern.(single_expr_payload (estring __)) expand let rule = Ppxlib.Context_free.Rule.extension ppx_dream_eml_extension let () = Driver.register_transformation ~rules:[ rule ] "eml"
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>