package alba
Alba compiler
Install
Dune Dependency
Authors
Maintainers
Sources
0.4.2.tar.gz
sha256=203ee151ce793a977b2d3e66f8b3a0cd7a82cc7f15550c63d88cb30c71eb5f95
md5=64367c393f80ca784f88d07155da4fb0
doc/src/alba.core/name_map.ml.html
Source file name_map.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 59 60 61 62 63 64
open Fmlib open Common type t = {map: int list String_map.t; has_locs: bool; cnt: int} let empty: t = {map = String_map.empty; has_locs = false; cnt = 0} let count (m:t): int = m.cnt let has_locals (m: t): bool = m.has_locs let find (name:string) (m:t): int list = match String_map.maybe_find name m.map with | None -> [] | Some lst -> lst let add_unnamed (m:t): t = {m with cnt = 1 + m.cnt; has_locs = true} let add (name:string) (global:bool) (m:t): t = assert (name <> ""); if name = "_" then add_unnamed m else { map = String_map.add name (match String_map.maybe_find name m.map with | None -> [m.cnt] | Some lst -> if global then m.cnt :: lst else [m.cnt]) m.map; has_locs = not global; cnt = 1 + m.cnt } let add_global (name:string) (m:t): t = assert (name <> ""); assert (not (has_locals m)); add name true m let add_local (name: string) (m:t) : t = assert (name <> ""); add name false m
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>