package embedded_ocaml_templates
EML is a simple templating language that lets you generate text with plain OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
0.7.tar.gz
md5=c262b84b429163b6441e76554db18104
sha512=018abfb99112e355153ff00ecb5199921f01cd1311bc0943c54cba172fe66be72153f69433c3a3b440fecca02ca8be573b59b6419f4329e70dff6b2b67c66f7a
doc/src/ppx_eml/ppx_eml.ml.html
Source file ppx_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
module Parser_ = Parser open Ppxlib (* Not present before 4.11 *) let set_position lexbuf position = Lexing.( lexbuf.lex_curr_p <- {position with pos_fname= lexbuf.lex_curr_p.pos_fname} ; lexbuf.lex_abs_pos <- position.pos_cnum) let name = "eml" let expand ~loc ~path:_ (s : string) = let startpos = loc.loc_start in (* let startpos = {loc.loc_start with pos_lnum= loc.loc_start.pos_lnum - 1} in *) match Common.Template_builder.of_string ~startpos s with | Error lexbuf -> Common.Template_builder.handle_syntax_error lexbuf ; exit 1 | Template template -> let buffer = Lexing.from_string (Common.Compile.compile_to_string template) in set_position buffer loc.loc_start ; Parser_.parse_expression Lexer.token buffer |> Selected_ast.Of_ocaml.copy_expression let ext = Extension.declare name Extension.Context.expression Ast_pattern.(single_expr_payload (estring __)) expand let () = Ppxlib.Driver.register_transformation name ~extensions:[ext]
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>