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.
Closeshylang/hy#1486.
This allows macros to take a keyword dict containing useful things by
defining a keyword argument. This allows us to pass in new objects
which might be handy to have in macros.
This changeset refactors module_name to become `compiler`, so that we
can pass the compiler itself into the macros as `opts['compiler']`.
This allows the macro to both get the macro name
(`compiler.module_name`), as well as use the compiler to build AST.
In the future, this will enable us to create "super-macros" which return
AST, not HyAST, in order to manually create insane things from userland.
For userland macros (not `defmacro`) the core.language `macroexpand`
will go ahead and make a new compiler for you.
Added first iteration of reader macros
Refactored defmacro and defreader
Added test inn hy/tests/lex/test_lex.py
Added new test in hy/tests/native/tests
Added new test in hy/tests/macros.
changed the error given in the dispatch macro and added some handling for missing symbol and invalid characters
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