Skip to content

feat: add pratt and recursive descent parser#181

Open
XboxBedrock wants to merge 12 commits into
mainfrom
recursive-descent
Open

feat: add pratt and recursive descent parser#181
XboxBedrock wants to merge 12 commits into
mainfrom
recursive-descent

Conversation

@XboxBedrock

@XboxBedrock XboxBedrock commented May 23, 2026

Copy link
Copy Markdown
Collaborator

This replaces the current parser with an extensible Pratt/Recursive descent parser. The parser itself is modularized into tokenizer, parser, errors, and grammarFactory. The specific implementation of the simple operator grammar we use is in basicOperatorParser.

The parser does have recursive descent capabilities by design, but they are not utilized in basicOperatorParser as the Pratt parser handles all of the operators we need. For future uses, the recursive descent component may come into play.

Addresses #151

Comment thread src/commands/role.ts Fixed

This comment was marked as resolved.

This comment was marked as resolved.

@maybe-yiyi maybe-yiyi linked an issue May 26, 2026 that may be closed by this pull request

@maybe-yiyi maybe-yiyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. Bug: user space sees Symbol EOX.

To reproduce, use /courses unlocks (15122 or 15112 or any other two courses.

Error message:

Unexpected token: Symbol(EOX). Expected one of: RPAREN
  1. Probably unwanted behavior but the call stack is only checked at evaluation time, not parse time

  2. why does this go on newline

Image

Comment thread src/utils/parser/basicOperatorParser.ts Outdated
Comment thread src/utils/parser/basicOperatorParser.ts Outdated
Comment thread src/utils/parser/tokenizer.ts Outdated
@XboxBedrock

Copy link
Copy Markdown
Collaborator Author

Changes made

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.

Move away from shunting yard

3 participants