package liquid_parser
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
The parser for Liquid
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.1.2.tar.gz
md5=ddfb85944a4604cfe8e614363862f882
sha512=7a9e4582f8a773e953f6fb124c757a883f4528c130a1fc53c19c74b9a4006e505d4fcf0014393624c8e57c463a96db653e922f951cc88802f552a6fcef7eb097
doc/src/liquid_parser/parser_tools.ml.html
Source file parser_tools.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 37 38 39 40open Base open Liquid_syntax open Syntax open Tools let scan_until_eos tokens = let rec aux acc = function | hd :: tl when hd = Syntax.EOS -> acc, tl | hd :: tl -> aux (acc @ [hd]) tl | [] -> acc, [] in aux [] tokens let parse_variable_context tokens = let add acc id v = acc |> Ctx.add (List.hd_exn id) v in let rec aux acc = function | LexValue (LexId id) :: Colon :: LexValue (v) :: Comma :: tl -> let render_ctx = add acc id (lex_value_to_value v) in aux render_ctx tl | LexValue (LexId id) :: LexAs :: LexValue (LexId alias) :: Comma :: tl -> let render_ctx = add acc alias (Var id) in aux render_ctx tl | LexValue (LexId id) :: Colon :: LexValue (v) :: tl -> let render_ctx = add acc id (lex_value_to_value v) in render_ctx, tl | LexValue (LexId id) :: LexAs :: LexValue (LexId alias) :: tl -> let render_ctx = add acc alias (Var id) in render_ctx, tl | _ -> acc, [] in let (got, rest) = aux Ctx.empty tokens in if Ctx.is_empty got then None else Some (got, rest) let parse_single_body tag all_tokens = let tokens = [tag] @ all_tokens in let bounds = Bounds.find_bounds tokens 0 in let stop_point = Bounds.stop_point_from_bounds bounds in let body = List.sub all_tokens ~pos:0 ~len:stop_point in let rest = sub_list_suffix tokens stop_point in (body, rest)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>