Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prelisp cannot handle empty lists #93

Open
GlowingScrewdriver opened this issue Jul 30, 2024 · 2 comments
Open

Prelisp cannot handle empty lists #93

GlowingScrewdriver opened this issue Jul 30, 2024 · 2 comments

Comments

@GlowingScrewdriver
Copy link
Contributor

Prelisp recursively tests the first element of each list to determine whether it is an unquote or unquote-splicing expression. This test causes an IndexError when an empty list is being processed. Consider the following macro call:

,@(array-init arr () 5)

Prelisp will run into an error while analyzing the second argument to the macro:

  File "/home/gsd-vnai/Desktop/llama.lisp/src/backend/tests/prelisp/../../prelisp.py", line 17, in preprocess
    if expr[0] == "unquote":
       ~~~~^^^
IndexError: list index out of range
@GlowingScrewdriver
Copy link
Contributor Author

May be fixed by #91

@chsasank
Copy link
Owner

Create a PR with regression test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants