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

fix(parser): ignore or push out trivia tokens around arguments and groups #79

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

Myriad-Dreamin
Copy link
Collaborator

@Myriad-Dreamin Myriad-Dreamin commented Dec 27, 2023

Fix wrong token eat function. It introduces an additional change:

  • Spaces around arguments, inside of the command, are ignored. For example,

    \frac { 1 } { 2 }

    is parsed as

    before,

    root
    |cmd
    ||cmd-name("\\frac")
    ||space'(" ") // ignored
    ||args { ... }
    ||space'(" ") // ignored
    ||args { ... }
    

    after,

    root
    |cmd
    ||cmd-name("\\frac")
    ||args
    |||curly
    ||||lbrace'("{")
    ||||space'(" ")
    ||||text(word'("1"),space'(" "))
    ||||rbrace'("}")
    ||args
    |||curly
    ||||lbrace'("{")
    ||||space'(" ")
    ||||text(word'("2"),space'(" "))
    ||||rbrace'("}")
    

@Myriad-Dreamin Myriad-Dreamin linked an issue Dec 27, 2023 that may be closed by this pull request
@OrangeX4 OrangeX4 merged commit 62d59ec into main Dec 27, 2023
6 checks passed
@Myriad-Dreamin Myriad-Dreamin deleted the fix-trailing-spaces branch December 27, 2023 12:55
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.

Unexpected trailing space after curly group
2 participants