Commit Graph

2688 Commits

Author SHA1 Message Date
Kodi Arfer
efed0b6c23 Move Python 3.5 tests to py3_only_tests.hy 2019-03-17 18:33:06 -04:00
Kodi Arfer
85f203ba43 Remove checks in tests for Python 3.5 2019-03-17 18:30:42 -04:00
Kodi Arfer
0fe7f42efc Remove internal checks for Python 3.5 2019-03-17 18:28:39 -04:00
Brandon T. Willard
9203fcaeb5 Check arguments in with-decorator tag
Fixes #1757.
2019-03-16 23:19:49 -05:00
Kodi Arfer
49c9d8a845
Merge pull request #1752 from TristanCacqueray/master
Add array indexes cut tutorial
2019-03-13 09:12:30 -04:00
Tristan Cacqueray
5d7b069ecb Add collections indexes and slices tutorial
This change adds to the tutorial the hy way of accessing array.
2019-03-13 03:50:06 +00:00
Kodi Arfer
d1aad33cbd
Merge pull request #1749 from Kodiologist/fstrings
Format strings
2019-03-04 14:05:07 -05:00
Kodi Arfer
83e56de0c5 Document format strings 2019-02-27 12:05:19 -05:00
Kodi Arfer
5bfc140b4d Implement format strings 2019-02-26 14:04:24 -05:00
Kodi Arfer
56f51a9a20 Implement hy.lex.parse_one_thing 2019-02-26 13:57:50 -05:00
Kodi Arfer
997321d31c Fix .end_line and .end_column of single-token models 2019-02-24 10:13:17 -05:00
Kodi Arfer
a338e4c323 Clean up a lexing test 2019-02-24 10:13:17 -05:00
Kodi Arfer
952ca3a727
Merge pull request #1750 from digikar99/master
added documentation for defclass docstring
2019-02-20 12:52:40 -05:00
digikar99
d312dd5df2 Fix a ReST underline 2019-02-20 12:47:27 -05:00
digikar99
247e64950d Clean up the documentation of defclass 2019-02-20 12:47:25 -05:00
Kodi Arfer
ebcb374c1e
Merge pull request #1742 from Kodiologist/release
Hy 0.16.0
2019-02-12 16:11:18 -05:00
Kodi Arfer
6769dda4b5 Clean up NEWS 2019-02-07 14:06:58 -05:00
Kodi Arfer
e2d6640e8c
Merge pull request #1687 from brandonwillard/clean-up-exceptions
Generate more concise syntax and compiler errors
2019-02-07 14:03:24 -05:00
Kodi Arfer
96d1b9c3fa Update README 2019-02-07 13:50:30 -05:00
Brandon T. Willard
9e62903d8a Add special exception and handling for wrapper errors 2019-02-07 13:45:41 -05:00
Brandon T. Willard
4ae4baac2a Cache command line source for exceptions
Source entered interactively can now be displayed in traceback output.  Also,
the REPL object is now available in its namespace, so that, for instance,
display options--like `spy`--can be turned on and off interactively.

Closes hylang/hy#1397.
2019-02-07 13:45:41 -05:00
Brandon T. Willard
fb6feaf082 Improve correspondence with Python errors and console behavior
Compiler and command-line error messages now reflect their Python counterparts.
E.g. where Python emits a `SyntaxError`, so does Hy; same for `TypeError`s.
Multiple tests have been added that check the format and type of raised
exceptions over varying command-line invocations (e.g. interactive and not).

A new exception type for `require` errors was added so that they can be treated
like normal run-time errors and not compiler errors.

The Hy REPL has been further refactored to better match the class-structured
API.  Now, different error types are handled separately and leverage more base
class-provided functionality.

Closes hylang/hy#1486.
2019-02-07 13:45:41 -05:00
Brandon T. Willard
cadfa4152b Make colored output configurable
Colored exception output is now disabled by default and configurable through
`hy.errors._hy_colored_errors` and the environment variable
`HY_COLORED_ERRORS`.

Likewise, Hy model/AST color printing is now configurable and disabled by
default.  The corresponding variables are `hy.models._hy_colored_ast_objects`
and `HY_COLORED_AST_OBJECTS`.

Closes hylang/hy#1429, closes hylang/hy#1510.
2019-02-07 13:43:58 -05:00
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
51c7efe6e8 Retain compiled source and file information for exceptions
This commit refactors the exception/error classes and their handling.
It also retains Hy source strings and their originating file information, when
available, all throughout the core parser and compiler functions.

As well, with these changes, calling code is no longer responsible for providing
source and file details to exceptions,

Closes hylang/hy#657.
2019-02-07 13:43:58 -05:00
Kodi Arfer
902926c543 Use ._syntax_error in place of HyTypeError.
And standardize the indentation of these calls.
2019-02-07 13:43:57 -05:00
Ryan Gonzalez
09b7f6f2df
Merge pull request #1745 from Kodiologist/update-copyright-years
Update copyright years
2019-02-07 08:30:29 -06:00
Kodi Arfer
62638b44a3 Update copyright years 2019-02-07 08:57:35 -05:00
Kodi Arfer
b9a2ab2972
Merge pull request #1736 from edouardklein/patch-1
Correct documentation of earmuff behavior
2019-02-05 13:20:52 -05:00
edouardklein
7d72e2fe74 Correct documentation of earmuff behavior
Another piece of fix #1714
2019-02-05 13:20:20 -05:00
Kodi Arfer
24a56ff15f
Merge pull request #1734 from Kodiologist/rply-077
Upgrade rply to avoid a deprecation warning
2019-02-05 13:18:27 -05:00
Kodi Arfer
d7c6fd8fa1 Upgrade rply to avoid a deprecation warning 2019-02-05 13:06:12 -05:00
Kodi Arfer
5eda96d7d3
Merge pull request #1733 from Kodiologist/py2-tokenize
Fix a Python 2 crash
2019-02-03 14:20:34 -05:00
Kodi Arfer
f1e693c96b Fix a Python 2 crash 2019-02-03 14:13:48 -05:00
Kodi Arfer
ada524e887
Merge pull request #1729 from Kodiologist/recursive-require-star
Make (require [foo [*]]) pull in macros required by `foo`
2019-01-31 13:37:52 -05:00
Kodi Arfer
983ea2dda2 Make (require [foo [*]]) pull in macros required by foo 2019-01-31 12:42:40 -05:00
Kodi Arfer
a5ed98f5b9
Merge pull request #1731 from Quelklef/master
Some documentation additions
2019-01-29 08:27:37 -05:00
Eli
e4fd74af1b Clarifying &optional documentation (fixes #1722) 2019-01-20 17:11:52 -05:00
Eli
3d2be62d4b Add synonyms for argument unpacking, for text-search purposes 2019-01-19 13:33:54 -05:00
Kodi Arfer
a42e17a025
Merge pull request #1715 from Kodiologist/interop-docs
Fix an example in interop.rst
2019-01-12 12:06:49 -05:00
Kodi Arfer
70747a58c3 Fix an example in interop.rst 2018-12-29 19:57:18 -05:00
Kodi Arfer
c4f73f061f
Merge pull request #1710 from Kodiologist/low-mangling
Fix mangling of characters below 0xFF
2018-12-29 19:56:37 -05:00
Kodi Arfer
b777972a0e Fix mangling of characters below 0xFF 2018-12-14 15:54:23 -05:00
Kodi Arfer
55ec6a0552
Merge pull request #1708 from brandonwillard/defmain-args-fix
Make `defmain` args optional or variadic when empty
2018-12-11 10:32:18 -05:00
Brandon T. Willard
f040bbe96f Update NEWS 2018-11-29 14:37:52 -06:00
Brandon T. Willard
b8b02c9df9 Handle empty defmain args
Closes hylang/hy#1707.
2018-11-29 14:37:52 -06:00
Kodi Arfer
9efd2a9d61
Merge pull request #1700 from brandonwillard/reuse-compiler-instances
Reuse Hy compiler instances
2018-11-28 19:04:41 -05:00
Brandon T. Willard
690416b3d6 Update description of eval in core.rst 2018-11-28 17:08:10 -06:00
Brandon T. Willard
3d0659b723 Update NEWS 2018-11-28 16:35:42 -06:00
Brandon T. Willard
15c68455ec Use a fixed compiler in HyREPL
These changes make `HyREPL` use a single `HyASTCompiler` instance, instead of
creating one every time a valid source string is processed.

This change avoids the unnecessary re-initiation of the standard library
`import` and `require` steps that currently occur within the module tracked by a
`HyREPL` instance.

Also, one can now pass an existing compiler instance to `hy_repl` and
`hy_compiler`.

Closes hylang/hy#1698.
2018-11-28 16:35:42 -06:00