Fix a check for empty input in macroexpand
The equality check hasn't done the right thing since HyExpression became tuple-backed (#1804).
This commit is contained in:
parent
2ed1e8b8e7
commit
48d481b5d3
2
NEWS.rst
2
NEWS.rst
@ -13,6 +13,8 @@ Bug Fixes
|
|||||||
* Improved support for nesting anaphoric macros by only applying
|
* Improved support for nesting anaphoric macros by only applying
|
||||||
symbol replacement where absolutely necessary.
|
symbol replacement where absolutely necessary.
|
||||||
* Quoted f-strings are no longer evaluated prematurely.
|
* Quoted f-strings are no longer evaluated prematurely.
|
||||||
|
* Fixed a regression in the production of error messages for empty
|
||||||
|
expressions.
|
||||||
|
|
||||||
0.18.0
|
0.18.0
|
||||||
==============================
|
==============================
|
||||||
|
@ -308,10 +308,7 @@ def macroexpand(tree, module, compiler=None, once=False):
|
|||||||
|
|
||||||
assert not compiler or compiler.module == module
|
assert not compiler or compiler.module == module
|
||||||
|
|
||||||
while True:
|
while isinstance(tree, HyExpression) and tree:
|
||||||
|
|
||||||
if not isinstance(tree, HyExpression) or tree == []:
|
|
||||||
break
|
|
||||||
|
|
||||||
fn = tree[0]
|
fn = tree[0]
|
||||||
if fn in ("quote", "quasiquote") or not isinstance(fn, HySymbol):
|
if fn in ("quote", "quasiquote") or not isinstance(fn, HySymbol):
|
||||||
|
Loading…
Reference in New Issue
Block a user