File: init.ml

package info (click to toggle)
hol-light 20190729-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,676 kB
  • sloc: ml: 637,078; cpp: 439; makefile: 301; lisp: 286; java: 279; sh: 239; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (11 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
(* ------------------------------------------------------------------------- *)
(* Set up a quotation expander for my `...` quotes.                          *)
(* ------------------------------------------------------------------------- *)

let quotexpander s =
  if String.sub s 0 1 = ":" then
    "parse_type \""^
    (String.escaped (String.sub s 1 (String.length s - 1)))^"\""
  else "parse_term \""^(String.escaped s)^"\"";;

Quotation.add "tot" (Quotation.ExStr (fun x -> quotexpander));;