36 Commits

Author SHA1 Message Date
Brandon T. Willard
e468d5f081 Refactor REPL error handling and filter Hy internal trace output
These changes make the Hy REPL more closely follow `code.InteractiveConsole`'s
class interface and provide minimally intrusive traceback print-out filtering
via a context manager that temporarily alters `sys.excepthook`.  In other words,
exception messages from the REPL will no longer show Hy internal
code (e.g. importer, compiler and parsing functions).

The boolean variable `hy.errors._hy_filter_internal_errors` dynamically
enables/disables trace filtering, and the env variable
`HY_FILTER_INTERNAL_ERRORS` can be used as the initial value.
2019-02-07 13:43:58 -05:00
Brandon T. Willard
8b6646d5c9 Remove hy.core compilation requirement from hy package
Previously, when importing `hy` (and any of its sub-packages/modules), Hy source
compilation for `hy.core.language` was necessarily triggered.  This, in turn,
would trigger compilation of the other standard library source files.

This commit removes that chain of events and allows the `hy` package to be
imported without any Hy compilation.

Furthermore, `read` and `read_str` are now implemented in Python and the Hy
standard library files now handle their own dependencies explicitly (i.e. they
`import` and/or `require` the other standard library files upon which they
depend).

The latter changes were necessary, because the automatically triggered
compilation of `hy.core.language` (and associated standard library files) was
serving--implicitly--as a means of producing bytecode in an order that just
happened to work for any compilation occurring afterward.  This chain of
events/dependencies was extremely cryptic, brittle, and difficult to debug, and
these changes should help to remedy that.

Closes hylang/hy#1697.
2018-11-28 14:12:33 -05:00
Brandon T. Willard
86fda31ab1 Move compilation and parsing functions out of importer.py
Functions and variables relating to compilation and parsing have been moved to
`compiler.py` and `lex/__init__.py`, respectively.  Those functions are
  - `hy_parse` from `hy.importer` to `hy.lex`
  - `hy_eval`, `ast_compile`, and `calling_module` from `hy.importer` to
  `hy.compiler`

Closes hylang/hy#1695.
2018-11-28 14:12:33 -05:00
Kodi Arfer
c93a60ede0 Remove support for cons cells 2018-04-12 16:45:17 -07:00
Kodi Arfer
85968e70dd Add mangle and unmangle as core functions 2018-03-13 14:55:55 -04:00
Jordan Danford
c67b8bccb9 Expose read, read_str, and eval in Python
- Expose `read`, `read_str`, and `eval` in Python
- Add string evaluation example to interop section of docs
- Add test for `eval`
- Explain `eof` keyword argument in `read` docstring
2017-08-05 17:29:15 -07:00
Kodi Arfer
2eb81864df Make all files comply with license-header policy 2017-04-27 14:16:57 -07:00
Kodi Arfer
8ecb17d1fd Fix bug: quoting a bytestring raises ImportError (#1245) 2017-03-04 19:04:28 -06:00
Kodi Arfer
ace125ee9b Consolidate hy.models.* and tests/models/* into one file apiece
They were a lot of similar, tiny files.
2017-02-16 19:43:00 -08:00
Kodi Arfer
23c457cee5 Generate hy.version using git describe 2016-10-12 17:11:44 -07:00
Ryan Gonzalez
c94c0e8b50 Add set literals (closes #827) 2015-07-14 23:59:29 +03:00
James King
277028cdd5 Remove HyLambdaListKeyword from the parser
It's not a syntactic element and doesn't belong in the parser. Parsing
lambda lists is now handled by the compiler alone.
2014-06-03 21:36:49 -04:00
Nicolas Dandrimont
52144820ca Add a cons object and related mechanisms
Closes: #183
2014-01-23 23:08:52 +01:00
Nicolas Dandrimont
51358e0f4b Add some machinery to avoid importing hy in setup.py 2013-07-28 19:34:59 +02:00
Nicolas Dandrimont
9278b24318 Allow quoting lambda list keywords.
This fixes an obvious bug where LambdaListKeywords couldn't be quoted.
2013-07-28 00:38:16 +02:00
Paul Tagliamonte
07cf0b72d1 0.9.10 release. Bugfix only. 2013-07-06 19:41:08 -04:00
Paul Tagliamonte
e005cb773c Preparing 0.9.9 2013-07-06 19:34:01 -04:00
Paul Tagliamonte
de85940114 Meh, 0.9.8 time. 2013-05-12 13:40:53 -04:00
Paul Tagliamonte
57430a7a86 awesome. 0.9.7 2013-05-05 23:04:51 -04:00
Paul R. Tagliamonte
4888589f59 Callin' this 0.9.6 2013-04-15 22:36:50 -04:00
Paul Tagliamonte
e4e61a463e Adding in the new models. 2013-04-12 09:18:25 -04:00
Paul R. Tagliamonte
65db83d1ff moving atoms around to make it easier for internals. 2013-04-10 20:04:58 -04:00
Paul R. Tagliamonte
997b32e18c Testing the behavior of (quote "foo") 2013-04-08 22:31:26 -04:00
Paul R. Tagliamonte
57fa5c8127 Time for 0.9.5 2013-04-07 19:45:50 -04:00
Paul R. Tagliamonte
d48c2b7cae Calling this 0.9.4 2013-04-05 20:47:25 -04:00
Paul R. Tagliamonte
82c4ac1b8f Moving to 0.9.3 2013-03-29 20:38:02 -04:00
Paul R. Tagliamonte
4cb4e7384e holy shit it's 2013 2013-03-18 10:27:14 -04:00
Paul R. Tagliamonte
da65ba4b4c Releasing 0.9.2 2013-03-15 15:35:25 -04:00
Paul R. Tagliamonte
84a7fbb301 Time for 0.9.1. 2013-03-11 21:14:45 -04:00
Paul R. Tagliamonte
85ffdbdb8a 0.9.0, screw it. 2013-03-10 17:42:11 -04:00
Paul Tagliamonte
fecf17960d unstaged changes 2013-03-05 09:08:13 -05:00
Paul R. Tagliamonte
9a31fc1f81 Futzin' with some things. 2013-03-04 22:35:07 -05:00
Paul R. Tagliamonte
159151f847 thingthings. like licensing. 2013-03-02 20:24:32 -05:00
Paul R. Tagliamonte
84453e75d2 Thinking about a refacotr. 2013-02-28 22:27:20 -05:00
Paul Tagliamonte
f5836da2a5 Kill everything 2013-02-27 19:00:52 -05:00
Paul Tagliamonte
925b9ec0a5 Initial import. 2012-12-15 14:48:16 -05:00