Skip to content

Instantly share code, notes, and snippets.

@wilbowma
Last active May 24, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilbowma/76fab994605ac2d909277efacb6eefc1 to your computer and use it in GitHub Desktop.
Save wilbowma/76fab994605ac2d909277efacb6eefc1 to your computer and use it in GitHub Desktop.
;; fix indentation of inference rules with no hypothesis in Redex
(defun add-hyphens-as-racket-function (number-of-hyphens)
(when (> number-of-hyphens 1)
(put (intern (make-string number-of-hyphens ?-)) 'racket-indent-function
(lambda (state indent-point normal-indent)
(goto-char (elt state 1))
(list (1+ (current-column)) (elt state 1))))
(add-hyphens-as-racket-function (1- number-of-hyphens))))
(add-hyphens-as-racket-function 102)
; Instead of getting a judgment rule formatted as:
; [--------------- "Rule-name"
; (judgment...)]
; get
; [--------------- "Rule-name"
; (judgment...)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment