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

Pull requests list feat: support embellishments and non-punctuation delimiters #57

Merged
merged 28 commits into from
Nov 26, 2023

Conversation

siefkenj
Copy link
Owner

This is a modification of PR #42

Previously, it couldn't attach arguments for macros whose argspec

  • involves embellishments e{_}, E{^}{default},
  • or non-punctuation delimiters such as r^_

This PR adds support for it. The second use-case may be marginal, I initially tried to make embellishments work, then realized that the same code would enable the second feature and unifies some codes.

Since a single embellishment argspec can represent multiple arguments, such as in e{^_} where each token ^ and _ would represents 2 arguments,
gobbleSingleArguments signature was changed to return Ast.Arguments | Ast.Arguments[] | null.

Currently, this just puts embellishment tokens as openMark in Ast. Would it be preferable to have a new separate property for embellishments?

Next goal would be to support/test macro expansions for such arguments. Once it's done, I'd like to work on #24.

Please take a look and provide comments, and feel free to make your own changes!

theseanl and others added 25 commits September 6, 2023 19:46
It appears that e{{_}} has the same effect as e{_}. e{{{_}}} triggers an
error. This commit reflects this behavior in `gobbleSingleArgument`
function.
gobbleSingleArguments return values
Now gobbleSingleArgument gobbles single argument for each run, and
may mutates its parameter argspec to remove gobbled arguments.
@siefkenj siefkenj merged commit a891d7b into main Nov 26, 2023
1 check passed
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.

2 participants