Skip to content

Fix kwarg escape#305

Merged
gilch merged 7 commits into
masterfrom
fix-kwarg-escape
Jun 20, 2026
Merged

Fix kwarg escape#305
gilch merged 7 commits into
masterfrom
fix-kwarg-escape

Conversation

@gilch

@gilch gilch commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Closes #277.
Closes #273.

@gilch

gilch commented Jun 20, 2026

Copy link
Copy Markdown
Owner Author

Looks like I need a test for the REPL fragment continuation. I might've created a couple of unreachable lines as well. Maybe I can rewrite those.

@gilch gilch force-pushed the fix-kwarg-escape branch from 7b1caa2 to f6d736b Compare June 20, 2026 21:33
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9d9fba8) to head (4cde9a7).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #305   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          833       840    +7     
  Branches       110       113    +3     
=========================================
+ Hits           833       840    +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gilch added 7 commits June 20, 2026 15:38
Now it munges and processes escapes like a symbol first, which is more like a normal tag.

Previously, the tag made a Kwarg object with the verbatim token, sans trailing `=`, with the munging and escape processing only applied if used as a keyword argument for a tag.

 However, the Kwarg() type has uses in metaprograms, e.g., `my#`, with a similar use demonstrated in the macro tutorial. The difference in handling a real tag argument and a kwarg token inside the scope when it needs munging or escape processing is unintended and therefore a bug.

The correct fix is to process earlier in the reader, rather than require a extra steps to munge and process escapes for all future tags using this feature. Stararg tokens were already tokenized separately, and don't munge.
For some fragments, the REPL previously incorrectly asked for more lines with no clear way to end the input. Some fragments triggering the issue, like |if 1:|, should be errors, while others should not, like |if 1:1|.

The REPL now attempts to add an extra newline to the compilation if Lissp didn't think it needed more lines of input, but the underlying Python interpreter thinks the compiled input isn't done. If that still doesn't work, the REPL will compile the Python directly to generate an exception, which will hopefully have a useful error message.
Mention using refresh to compile
The contents were easily missed before.
Remove redundant transpile() in tests

Fix broken cross-reference in macros.lissp docstring

Switch to forward slashes in path in comment in setup.py

Update copyright string in conf.py
@gilch gilch force-pushed the fix-kwarg-escape branch from f6d736b to 4cde9a7 Compare June 20, 2026 21:47
@gilch gilch merged commit 36287ca into master Jun 20, 2026
3 checks passed
@gilch gilch deleted the fix-kwarg-escape branch June 20, 2026 21:51
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

Successfully merging this pull request may close these issues.

hissp.reader..Kwarg escape handling Add a changelog

1 participant