package p5scm
Scheme via camlp5
Install
Dune Dependency
Authors
Maintainers
Sources
0.4.0.tar.gz
md5=eb4ee666fd862f7c8057cca4a73daf44
sha512=d28ee892b8fc3241c42f531f9d372b1b007abbef128c3f3862fa5ad943a3eae1d655b34daac19940e1f9fad1ecfca1419a89c7507b6cbd40d9c0490c6aa6761e
doc/src/p5scm.lib/lexer_utils.ml.html
Source file lexer_utils.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
(* The MIT License Copyright (c) 2021 Jason D. Nielsen <drjdnielsen@gmail.com> *) open Lexing let ppos lexbuf = let p = lexbuf.lex_curr_p in Printf.printf "File: %s, line: %d, col: %d, token: %s \n" p.pos_fname p.pos_lnum (p.pos_cnum - p.pos_bol) (lexeme lexbuf) let pspos lexbuf = let p = lexbuf.lex_curr_p in Printf.sprintf "File: %s, line: %d, col: %d, token: %s" p.pos_fname p.pos_lnum (p.pos_cnum - p.pos_bol) (lexeme lexbuf) let lexeme lexbuf = Lexing.lexeme lexbuf let new_line lexbuf = Lexing.new_line lexbuf let dp_str str = string_of_float (float_of_string str) let p5_bool str = match str with | "true" -> "True" | "false" -> "False" | _ -> failwith "Not a boolean!" let extra_kwds = [ "define"; "definerec"; "lambda"; "lambda_match"; "let*"; "range"; "sum"; "values" ] let is_kwds kwds lst = List.mem kwds lst let map_ident str = match is_kwds str extra_kwds with | true -> Tokens.KEYWORD str | false -> Tokens.IDENT str let in_topl = ref false let topl_err lexbuf = print_endline "Toplevel commands only allowed in repl!"; pspos lexbuf let check_topl lexbuf = if not !in_topl then failwith (topl_err lexbuf)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>