chore(emacs/lean-info): fix indentation
This commit is contained in:
parent
cae2ab7dfb
commit
2fa8c1c709
1 changed files with 22 additions and 22 deletions
|
@ -29,8 +29,8 @@
|
||||||
(defun lean-info-type-parse (seq)
|
(defun lean-info-type-parse (seq)
|
||||||
(when (lean-info-type-p seq)
|
(when (lean-info-type-p seq)
|
||||||
(let ((header (lean-info-type-parse-header (car seq)))
|
(let ((header (lean-info-type-parse-header (car seq)))
|
||||||
(body (cdr seq)))
|
(body (cdr seq)))
|
||||||
`(TYPE ,header ,body))))
|
`(TYPE ,header ,body))))
|
||||||
(defun lean-info-type-body (typeinfo)
|
(defun lean-info-type-body (typeinfo)
|
||||||
(cl-third typeinfo))
|
(cl-third typeinfo))
|
||||||
(defun lean-info-type-body-str (typeinfo)
|
(defun lean-info-type-body-str (typeinfo)
|
||||||
|
@ -74,8 +74,8 @@
|
||||||
(defun lean-info-overload-parse (seq)
|
(defun lean-info-overload-parse (seq)
|
||||||
(when (lean-info-overload-p seq)
|
(when (lean-info-overload-p seq)
|
||||||
(let ((header (lean-info-overload-parse-header (car seq)))
|
(let ((header (lean-info-overload-parse-header (car seq)))
|
||||||
(body (-split-on "--" (cdr seq))))
|
(body (-split-on "--" (cdr seq))))
|
||||||
`(OVERLOAD ,header ,body))))
|
`(OVERLOAD ,header ,body))))
|
||||||
|
|
||||||
;; -- Test
|
;; -- Test
|
||||||
(cl-assert (lean-info-overload-p 'OVERLOAD))
|
(cl-assert (lean-info-overload-p 'OVERLOAD))
|
||||||
|
@ -113,15 +113,15 @@
|
||||||
"→ decidable (eq zero (succ m'))")))
|
"→ decidable (eq zero (succ m'))")))
|
||||||
'(121 2)))
|
'(121 2)))
|
||||||
(cl-assert (equal (lean-info-overload-names (lean-info-overload-parse
|
(cl-assert (equal (lean-info-overload-names (lean-info-overload-parse
|
||||||
'("-- OVERLOAD|121|2"
|
'("-- OVERLOAD|121|2"
|
||||||
"not (eq zero (succ m'))"
|
"not (eq zero (succ m'))"
|
||||||
"→ decidable (eq zero (succ m'))"
|
"→ decidable (eq zero (succ m'))"
|
||||||
"--"
|
"--"
|
||||||
"not (eq one (succ m'))"
|
"not (eq one (succ m'))"
|
||||||
"→ decidable (eq zero (succ m'))"
|
"→ decidable (eq zero (succ m'))"
|
||||||
"--"
|
"--"
|
||||||
"not (eq two (succ m'))"
|
"not (eq two (succ m'))"
|
||||||
"→ decidable (eq zero (succ m'))")))
|
"→ decidable (eq zero (succ m'))")))
|
||||||
'("not (eq zero (succ m'))\n→ decidable (eq zero (succ m'))"
|
'("not (eq zero (succ m'))\n→ decidable (eq zero (succ m'))"
|
||||||
"not (eq one (succ m'))\n→ decidable (eq zero (succ m'))"
|
"not (eq one (succ m'))\n→ decidable (eq zero (succ m'))"
|
||||||
"not (eq two (succ m'))\n→ decidable (eq zero (succ m'))")))
|
"not (eq two (succ m'))\n→ decidable (eq zero (succ m'))")))
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
(body (-split-on "--" (cdr seq)))
|
(body (-split-on "--" (cdr seq)))
|
||||||
(coerced-expr (cl-first body))
|
(coerced-expr (cl-first body))
|
||||||
(coerced-type (cl-second body)))
|
(coerced-type (cl-second body)))
|
||||||
`(COERCION ,header ,coerced-expr ,coerced-type))))
|
`(COERCION ,header ,coerced-expr ,coerced-type))))
|
||||||
(defun lean-info-coercion-expr (coercion)
|
(defun lean-info-coercion-expr (coercion)
|
||||||
(cl-third coercion))
|
(cl-third coercion))
|
||||||
(defun lean-info-coercion-expr-str (coercion)
|
(defun lean-info-coercion-expr-str (coercion)
|
||||||
|
@ -218,7 +218,7 @@
|
||||||
(cl-assert (equal
|
(cl-assert (equal
|
||||||
(lean-info-coercion-pos
|
(lean-info-coercion-pos
|
||||||
(lean-info-coercion-parse '("-- COERCION|417|15"
|
(lean-info-coercion-parse '("-- COERCION|417|15"
|
||||||
"of_nat")))
|
"of_nat")))
|
||||||
'(417 15)))
|
'(417 15)))
|
||||||
|
|
||||||
;; Identifier Information
|
;; Identifier Information
|
||||||
|
@ -386,13 +386,13 @@ Take out \"BEGININFO\" and \"ENDINFO\" and Use \"ACK\" as a delim."
|
||||||
(defun lean-get-partial-names (full-name)
|
(defun lean-get-partial-names (full-name)
|
||||||
"Given a full-name \"a.b.c.d\", return a set of partial names (\"a.b.c.d\" \"b.c.d\" \"c.d\" \"d\")"
|
"Given a full-name \"a.b.c.d\", return a set of partial names (\"a.b.c.d\" \"b.c.d\" \"c.d\" \"d\")"
|
||||||
(cl-labels ((helper(l1 l2 names)
|
(cl-labels ((helper(l1 l2 names)
|
||||||
(cond (l1 (helper
|
(cond (l1 (helper
|
||||||
(-butlast l1)
|
(-butlast l1)
|
||||||
(cons nil (-butlast l2))
|
(cons nil (-butlast l2))
|
||||||
(-zip-with (lambda (x y) (if y (concat x "." y) x))
|
(-zip-with (lambda (x y) (if y (concat x "." y) x))
|
||||||
names
|
names
|
||||||
(cons nil (-butlast l2)))))
|
(cons nil (-butlast l2)))))
|
||||||
(t (reverse names)))))
|
(t (reverse names)))))
|
||||||
(let ((items (reverse (split-string full-name "\\."))))
|
(let ((items (reverse (split-string full-name "\\."))))
|
||||||
(helper items items items))))
|
(helper items items items))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue