Commit Graph

19 Commits

Author SHA1 Message Date
Konrad Hinsen
a3847191b6 Merge branch 'master' into spy-mode 2013-08-20 10:12:23 +02:00
Julien Danjou
e158fba865 Merge pull request #265 from rwtolbert/hyc_args_fix
Add CL handling to hyc
2013-08-20 01:10:44 -07:00
Konrad Hinsen
3321daa4cf Add "spy mode" to REPL
With the command-line option --spy, the Hy REPL prints the Python
equivalent of each expression before evaluating it.
2013-08-19 15:27:55 +02:00
Nicolas Dandrimont
81af09d002 Wire the rply parser
Amend the tests to account for the changes
2013-07-28 17:36:36 +02:00
Bob Tolbert
d960dc963f Add CL handling to hyc
This adds real command line handling to 'hyc' for issue #256

This fix catches missing/unreadable files and prints a nice
error message instead of a nasty stack trace when trying to
compile a non-existent file.

Also add this non-existent file check to hy to prevent the
current stack trace from something like "hy foobarbaz" when
"foobarbaz" doesn't exist.

also changes the failure return value to 2 to match Python.
2013-07-26 08:40:56 -06:00
Bob Tolbert
df7bb1d29a Provide bin scripts for both Windows and *nix
Summary: This update does away with the scripts in bin and changes
setup.py to use entry_points in cmdline.py for the scripts 'hy' and
'hyc'.

This fixes installing and running on Windows.

The tests are updated to run the 'hy' script produced by setup.py
and not from bin/hy. This is more correct and makes the tox tests
run on both Window and *nix.

For running hy or nosetests directly in the source tree, you do have
to run 'python setup.py develop' first. But since tox runs and builds
dists, all tox tests pass on all platforms.

Also, since there is no built-in readline on Windows, the setup.py
only on Windows requires 'pyreadline' as a replacement.

Switched from optparse to argparse in cmdline.py

Instead of trying to manually separate args meant for
hy from args meant for a hy script, this switches from
optparse to argparse for the CLI.

argparse automatically peels out args meant for hy and leaves
the rest, including the user hy script in options.args.

This fixes the issue @paultag found running "hy foo" where
foo is not a real file. Also added a test that makes sure
trying to run a non-existent script exits instead of dropping
the user into the REPL.

Added argparse as setup.py resource (and removed from tox.ini) as well as removed uses of deprecated setf
2013-07-14 09:06:42 -06:00
Paul Tagliamonte
b78be9a594 Jank @olasd's hack, clean up core.
The core shall from now on be only for the core language bits. Macro
 bits shall live in hy.macros and in hy.compiler. This cleans up
 garbage.
2013-07-06 14:00:11 -04:00
Paul Tagliamonte
2c4c95725e Style fixes. 2013-07-06 13:43:05 -04:00
Ralph Moritz
748f54b2f9 Move code from hy.readline_helpers into new hy.completer.completion context
manager so we can "wrap" readline completion around REPL interaction.
2013-07-06 18:02:01 +02:00
Paul Tagliamonte
56ccdf97e3 Style fixes. 2013-07-04 21:31:17 -04:00
Ralph Moritz
888dc19882 Get Hy working on Windows by making readline use conditional. 2013-07-01 22:41:56 +02:00
Morten Linderud
42468051f5 Builtins fix for 2 and 3, tests aswell 2013-06-25 17:02:02 +02:00
Konrad Hinsen
269da19d76 Make macros module-specific.
A macro is available in the module where it was defined and
in any module that does a require of the defining module.
Only macros defined in hy.core are globally available.
Fixes #181
2013-05-16 15:34:14 +02:00
Nicolas Dandrimont
0986f9001e Change macros to be called with separate arguments
This provides free argument-length checking for macros.
2013-05-11 09:09:34 +02:00
Will Kahn-Greene
07dec18dc3 Fix "hy -c CMD" to show lex errors; add tests
* tells you there's a lex error, but doesn't tell you much else
* adds tests for all new bin/hy functionality
2013-04-24 22:23:12 -04:00
Will Kahn-Greene
08b30e8195 Back-figuring the license/copyright info
I did a git log thing to figure out who touched bin/hy and copied
those people over here since the bulk of the code came from bin/hy.
2013-04-24 09:03:56 -04:00
Will Kahn-Greene
3f7f241097 Fix license header 2013-04-24 08:57:51 -04:00
Will Kahn-Greene
fb8140b6bc Add license to new file 2013-04-24 08:32:03 -04:00
Will Kahn-Greene
4e59af0033 Redid command line code
This supports:

* -h, --help
* --version
* -c cmd
* -i cmd
* file
* -

Plus it's easy to add new options.

Also, now we can do ridiculous things like have projects where
the installation is:

$ curl -s http://example.com/install-hypster-program | hy
2013-04-23 22:02:41 -04:00