Skip to content

feature/implement lexer - part 1#2

Merged
yarkhinephyo merged 10 commits into
mainfrom
phyo/lexer-phase-1
Jan 27, 2026
Merged

feature/implement lexer - part 1#2
yarkhinephyo merged 10 commits into
mainfrom
phyo/lexer-phase-1

Conversation

@yarkhinephyo

@yarkhinephyo yarkhinephyo commented Jan 24, 2026

Copy link
Copy Markdown
Member

What is in the PR

Implement part 1 of lexer. From this paper, the items of table I in page 5 is added to tests/lexer/README.md. A checklist is added to track what has been implemented and what is still remaining.

tldr;

Tokens in the table implemented in the PR

  • BOOL - Boolean literal TRUE | FALSE
  • NUMBER - Integer, floating point, or scientific notation [0-9]+ .? [0-9]* (e [0-9]+)?
  • STRING - String literal " ([^ "] | "")* "
  • ERROR - Error literals #NULL! | #DIV/0! | #VALUE! | #NAME? | #NUM! | #N/A
  • ERROR-REF - Reference error literal #REF!

Tokens not in the table but used in BNF form implemented in the PR

  • Array Delimiters
  • Unary Operators
  • Binary Operators

How is it tested

For each entry, added unit tests in tests/lexer/test_**.rs.

cargo test

@yarkhinephyo yarkhinephyo changed the title Implement lexer - phase I feature/implement lexer - phase I Jan 24, 2026
@yarkhinephyo yarkhinephyo changed the title feature/implement lexer - phase I feature/implement lexer - part 1 Jan 24, 2026
Comment thread tests/lexer/README.md Outdated
Comment thread tests/lexer/test_operators.rs
Comment thread src/bindings/lexer.rs Outdated
Comment thread src/bindings/lexer.rs Outdated

@qwoprocks qwoprocks 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.

Took a quick look, I realized that we are missing one thing, which is that all formulas should start with =

Comment thread src/bindings/lexer.rs Outdated
Comment thread src/bindings/token.rs Outdated

@qwoprocks qwoprocks 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.

niceeee

@yarkhinephyo yarkhinephyo merged commit 724ea56 into main Jan 27, 2026
6 checks passed
@yarkhinephyo yarkhinephyo deleted the phyo/lexer-phase-1 branch January 27, 2026 16:51
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