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!
This is a modification of PR #42
Previously, it couldn't attach arguments for macros whose argspec
e{_}
,E{^}{default}
,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,gobbleSingleArgument
s signature was changed to returnAst.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!