From 33771bf25440eb12d5b3a3b6805ab544297dc438 Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Sat, 15 Dec 2012 18:59:11 -0500 Subject: [PATCH] OK, trying some grown-up work. --- bin/hy-lex-json | 12 ++++++++++++ test.hy | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100755 bin/hy-lex-json create mode 100644 test.hy diff --git a/bin/hy-lex-json b/bin/hy-lex-json new file mode 100755 index 0000000..f311a65 --- /dev/null +++ b/bin/hy-lex-json @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +from hy.lex.tokenize import tokenize +import json +import sys + + +print json.dumps( + tokenize(open(sys.argv[1], 'r').read()), + indent=4, + sort_keys=True +) diff --git a/test.hy b/test.hy new file mode 100644 index 0000000..ae8005b --- /dev/null +++ b/test.hy @@ -0,0 +1,8 @@ +; vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 filetype=lisp + +(ns test) + +(def square + (fn [x] (* x x))) + +(print (square 4))