package styled-ppx
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Type-safe styled components for ReScript and Melange
Install
dune-project
Dependency
Authors
Maintainers
Sources
styled-ppx-0.61.0.tbz
sha256=c6eba770e9e9bb9002bf3f759f99ebcec6d7b4132c6c2ad562886c88b6839bab
sha512=8a1776181f6ef292518a0b96b1fae7927cf5767dee75dc04bc05d99d297866e45a5943455bea9ce500a04a635bd179d2b2bec8bccebc55dc1e696a23b3efad69
doc/src/styled-ppx.css-parser/Parser_location.ml.html
Source file Parser_location.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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59let to_ppxlib_location ?(loc_ghost = false) (start_pos : Lexing.position) (end_pos : Lexing.position) : Ppxlib.location = { loc_start = start_pos; loc_end = end_pos; loc_ghost } let print_location label ({ loc_start; loc_end; _ } : Ppxlib.location) = let loc_start_column = loc_start.pos_cnum - loc_start.pos_bol in let loc_end_column = loc_end.pos_cnum - loc_end.pos_bol in Printf.sprintf "%s start %d %d %d (L:%d c:%d) end %d %d %d (L:%d c:%d)" label loc_start.pos_lnum loc_start.pos_bol loc_start.pos_cnum loc_start.pos_lnum loc_start_column loc_end.pos_lnum loc_end.pos_bol loc_end.pos_cnum loc_end.pos_lnum loc_end_column let intersection (loc1 : Ppxlib.location) (loc2 : Ppxlib.location) : Ppxlib.location = let start_pos = Lexing. { pos_fname = loc1.loc_start.pos_fname; pos_lnum = loc1.loc_start.pos_lnum + loc2.loc_start.pos_lnum - 1; pos_bol = loc1.loc_start.pos_bol + loc2.loc_start.pos_bol; pos_cnum = loc1.loc_start.pos_cnum + loc2.loc_start.pos_cnum; } in let end_pos = Lexing. { pos_fname = loc1.loc_end.pos_fname; pos_lnum = loc1.loc_start.pos_lnum + loc2.loc_end.pos_lnum - 1; pos_bol = loc1.loc_start.pos_bol + loc2.loc_end.pos_bol; pos_cnum = loc1.loc_start.pos_cnum + loc2.loc_end.pos_cnum; } in { Ppxlib.Location.loc_start = start_pos; loc_end = end_pos; loc_ghost = false; } let update_loc_with_delimiter (loc : Ppxlib.location) delimiter : Ppxlib.location = let offset = match delimiter with None -> 0 | Some s -> String.length s + 1 in let loc_start = { loc.loc_start with pos_cnum = loc.loc_start.pos_cnum + offset } and loc_end = { loc.loc_end with pos_cnum = loc.loc_end.pos_cnum + offset } in { loc_start; loc_end; loc_ghost = false } let update_pos_lnum (a : Ppxlib.location) (b : Ppxlib.location) = let loc_start = { a.loc_start with pos_lnum = a.loc_start.pos_lnum + b.loc_start.pos_lnum - 1; } in let loc_end = { a.loc_end with pos_lnum = a.loc_end.pos_lnum + b.loc_start.pos_lnum - 1 } in { a with loc_start; loc_end }
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>