Re-indent Hy code using hy-mode
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
9776b7133e
commit
27e74d43b1
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env hy
|
||||
; Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2013 under the terms
|
||||
; of the Expat license, a copy of which you have should have recieved with
|
||||
; the source.
|
||||
;; Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2013 under the terms
|
||||
;; of the Expat license, a copy of which you have should have received with
|
||||
;; the source.
|
||||
|
||||
|
||||
(import sys)
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env hy
|
||||
|
||||
; Very much a knockoff (straight port) of Dan Gulotta's 2013 MIT Mystery Hunt
|
||||
; puzzle "The Halting Problem". His Copyright terms are unclear, so presume
|
||||
; that this is distributable, but not free.
|
||||
;; Very much a knockoff (straight port) of Dan Gulotta's 2013 MIT Mystery Hunt
|
||||
;; puzzle "The Halting Problem". His Copyright terms are unclear, so presume
|
||||
;; that this is distributable, but not free.
|
||||
|
||||
|
||||
(defn evaluate [f] ((f (lambda [x] (+ x 1))) 0))
|
||||
|
@ -1,4 +1,4 @@
|
||||
; hello, rHy!
|
||||
;; hello, rHy!
|
||||
|
||||
|
||||
(defn fib [n]
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env hy
|
||||
; Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2013 under the terms
|
||||
; of the Expat license, a copy of which you have should have recieved with
|
||||
; the source.
|
||||
;; Copyright (c) Paul R. Tagliamonte <paultag@debian.org>, 2013 under the terms
|
||||
;; of the Expat license, a copy of which you have should have recieved with
|
||||
;; the source.
|
||||
|
||||
(import sys)
|
||||
(import [sunlight [openstates]]
|
||||
|
@ -1,5 +1,3 @@
|
||||
;
|
||||
|
||||
(import [tests.resources [kwtest function-with-a-dash]]
|
||||
[os.path [exists isdir isfile]]
|
||||
[sys :as systest])
|
||||
@ -8,9 +6,7 @@
|
||||
|
||||
(defn test-sys-argv []
|
||||
"NATIVE: test sys.argv"
|
||||
;
|
||||
; BTW, this also tests inline comments. Which suck to implement.
|
||||
;
|
||||
;; BTW, this also tests inline comments. Which suck to implement.
|
||||
(assert (isinstance sys.argv list)))
|
||||
|
||||
|
||||
@ -601,9 +597,9 @@
|
||||
(setf test-payload (quote (+ x 2)))
|
||||
(setf x 4)
|
||||
(assert (= 6 (eval test-payload)))
|
||||
; (assert (= 6 (eval (quote ((fn [] (+ 3 3)))))))
|
||||
; XXX: This must be commented out while we resolve stmts being run through
|
||||
; eval. Please fix me. -- PRT
|
||||
;; (assert (= 6 (eval (quote ((fn [] (+ 3 3)))))))
|
||||
;; XXX: This must be commented out while we resolve stmts being run through
|
||||
;; eval. Please fix me. -- PRT
|
||||
(assert (= 1 (eval (quote 1))))
|
||||
(assert (= "foobar" (eval (quote "foobar"))))
|
||||
(setv x (quote 42))
|
||||
@ -613,18 +609,18 @@
|
||||
(defn test-import-syntax []
|
||||
"NATIVE: test the import syntax."
|
||||
|
||||
; Simple import
|
||||
;; Simple import
|
||||
(import sys os)
|
||||
|
||||
; from os.path import basename
|
||||
;; from os.path import basename
|
||||
(import [os.path [basename]])
|
||||
(assert (= (basename "/some/path") "path"))
|
||||
|
||||
; import os.path as p
|
||||
;; import os.path as p
|
||||
(import [os.path :as p])
|
||||
(assert (= p.basename basename))
|
||||
|
||||
; from os.path import basename as bn
|
||||
;; from os.path import basename as bn
|
||||
(import [os.path [basename :as bn]])
|
||||
(assert (= bn basename))
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
; copyright ..
|
||||
|
||||
|
||||
(setv square (fn [x]
|
||||
(* x x)))
|
||||
|
||||
@ -9,7 +6,6 @@
|
||||
"NATIVE: Test basic math."
|
||||
(assert (= (+ 2 2) 4))))
|
||||
|
||||
|
||||
(setv test_mult (fn []
|
||||
"NATIVE: Test multiplication."
|
||||
(assert (= 4 (square 2)))))
|
||||
|
@ -1,5 +1,4 @@
|
||||
; This is a comment. It shall be ignored by the parser.
|
||||
|
||||
;; This is a comment. It shall be ignored by the parser.
|
||||
|
||||
(setv square (fn [x]
|
||||
(* x x)))
|
||||
|
Loading…
Reference in New Issue
Block a user