Skip to content

Added expect for improved readability#17

Open
xtay2 wants to merge 1 commit into
orosmatthew:masterfrom
xtay2:master
Open

Added expect for improved readability#17
xtay2 wants to merge 1 commit into
orosmatthew:masterfrom
xtay2:master

Conversation

@xtay2

@xtay2 xtay2 commented Jan 3, 2024

Copy link
Copy Markdown
Contributor

Both the tokenizer and the parser frequently check if the next peeked token exists and equals some expected value.

I added two utility functions that should improve the readability.

@edy131109 edy131109 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great code but in tokenization.hpp please don't replace the peek().value() == '' with the expect function because we already know that the peek() has a value from the upper statement and that just makes the code slower.

@johnnycharlesw

Copy link
Copy Markdown

This looks like a good upgrade to the Hydrogen language, I have not seen one in a while...do you want to merge it, @orosmatthew>

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.

3 participants