hy/tests/native_tests
Brandon T. Willard 010986e8ca Implement minimal macro namespacing and add tests
This commit adds just enough namespacing to resolve a macro first in the macro's
defining module's namespace (i.e. the module assigned to the `HyASTCompiler`),
then in the namespace/module it's evaluated in.  Namespacing is accomplished by
adding a `module` attribute to `HySymbol`, so that `HyExpression`s can be
checked for this definition namespace attribute and their car symbol resolved
per the above.

As well, a couple tests have been added that cover
- the loading of module-level macros
  - e.g. that only macros defined in the `require`d module are added
- the AST generated for `require`
  - using macros loaded from modules imported via bytecode
- the non-local macro namespace resolution described above
  - a `require`d macro that uses a macro `require` exclusively in its
    module-level namespace
- and that (second-degree `require`d) macros can reference variables within
  their module-level namespaces.

Closes hylang/hy#1268, closes hylang/hy#1650, closes hylang/hy#1416.
2018-11-08 22:57:17 -06:00
..
contrib Add a test for require in the body of a macro 2018-07-25 17:20:19 -05:00
extra Fixes #1605: remove macros ap-pipe and ap-compose 2018-05-20 13:52:51 -07:00
__init__.py Support PEP 328 2018-02-06 23:41:12 -05:00
comprehensions.hy Update uses of the old comprehension forms 2018-06-13 17:31:08 -07:00
core.hy Fix missing import in doc macro expansion 2018-09-24 16:39:13 -04:00
defclass.hy Fix defclass construction 2018-03-31 02:43:53 -04:00
language.hy Make HyKeyword callable 2018-07-24 09:19:37 -07:00
mangling.hy Fix indent 2018-04-04 12:04:34 -06:00
mathematics.hy Merge pull request #1473 from Kodiologist/new-year-2018 2018-02-05 15:11:59 +02:00
model_patterns.hy Add tests and docs for model patterns 2018-05-28 16:15:47 -07:00
native_macros.hy Implement minimal macro namespacing and add tests 2018-11-08 22:57:17 -06:00
operators.hy Mangle symbols at compile-time instead of parse-time 2018-03-13 14:55:15 -04:00
py3_only_tests.hy Remove for/a, for*, and for/a* 2018-06-13 17:31:08 -07:00
py35_only_tests.hy Update copyright years 2018-01-01 10:38:33 -05:00
py36_only_tests.hy Remove for/a, for*, and for/a* 2018-06-13 17:31:08 -07:00
quote.hy Add some missing imports 2018-04-21 12:25:29 -07:00
tag_macros.hy Update uses of the old comprehension forms 2018-06-13 17:31:08 -07:00
unless.hy Burninate the synonyms true, false, and nil 2016-11-23 18:35:17 -08:00
when.hy Burninate the synonyms true, false, and nil 2016-11-23 18:35:17 -08:00
with_decorator.hy Update copyright years 2018-01-01 10:38:33 -05:00
with_test.hy Update copyright years 2018-01-01 10:38:33 -05:00