Skip to content

Reworked tagged literals#650

Closed
shantanu-sardesai wants to merge 16 commits intojank-lang:mainfrom
shantanu-sardesai:issues/639-tagged-literals
Closed

Reworked tagged literals#650
shantanu-sardesai wants to merge 16 commits intojank-lang:mainfrom
shantanu-sardesai:issues/639-tagged-literals

Conversation

@shantanu-sardesai
Copy link
Contributor

@shantanu-sardesai shantanu-sardesai commented Jan 4, 2026

There are some fixes in this PR to the parser besides the changes required for reworking the tagged reader parser.

  • Reader suppression support, which goes against the lazy nature of the parser.
  • Lexer errors in the eagerly parsed collections (map, set, etc.) can cause a stack overflow.

Resolves #639.

@shantanu-sardesai
Copy link
Contributor Author

Still thinking on how to make reader suppression work with jank.

@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch 7 times, most recently from 6ab6a25 to cd502b4 Compare January 12, 2026 02:15
@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch 6 times, most recently from 137c1ed to 47654cf Compare January 21, 2026 14:46
@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch 2 times, most recently from 8f0fba3 to b53a83d Compare January 27, 2026 18:41
I also took the oportunity to convert our jank tagged literal functions
to obey the same contracts as other tagged data-readers.
The Clojure reader relaxes tagged literal syntax
rules when dealing with a form in an unsupported
reader conditional. This is done because an
implementation of Clojure on a specific platform
can't make any assumptions on what tagged literals
other platform implementations will support.
@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch from b53a83d to b3a26b1 Compare February 1, 2026 08:26
@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch from b3a26b1 to 9806647 Compare February 1, 2026 08:39

return jtl::ok();
});
if(item->is_err())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One behaviour difference here, from the existing implementation, is that the parser will report all the errors (mainly the duplicate keys error) for the key before any errors for the value will be reported.

@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch 4 times, most recently from acc76a9 to a3fd437 Compare February 1, 2026 15:22
@shantanu-sardesai shantanu-sardesai force-pushed the issues/639-tagged-literals branch from a3fd437 to 284a079 Compare February 1, 2026 15:23
@shantanu-sardesai shantanu-sardesai mentioned this pull request Feb 7, 2026
3 tasks
@shantanu-sardesai
Copy link
Contributor Author

As per our discussion, I'm closing this one in favour of this implementation.

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.

Rework tagged literals

1 participant