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

Tokenize purely using regexes #123

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jun 4, 2024

Match next token using single regex only, +18% speedup.

In the future, Tokenizer::makeTokenizeRegexes() method can be made public to allow grammar override for each token type.

@mvorisek mvorisek force-pushed the tokenize_using_single_regex branch 4 times, most recently from a492556 to 056670d Compare June 4, 2024 08:58
@mvorisek mvorisek force-pushed the tokenize_using_single_regex branch 4 times, most recently from 3a81fb4 to 1a8dc67 Compare June 30, 2024 22:10
@mvorisek mvorisek marked this pull request as ready for review June 30, 2024 22:10
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Impressive work, thank you!

src/Tokenizer.php Show resolved Hide resolved
src/Tokenizer.php Show resolved Hide resolved
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

It looks like at least 2 commits could be squashed together

src/Tokenizer.php Outdated Show resolved Hide resolved
@mvorisek
Copy link
Contributor Author

last 3 commits squashed (3rd commit was reverting 1st commit, therefore the resulting/last commit is very simple)

@derrabus
Copy link
Member

Thank you.

@derrabus derrabus merged commit 16ca9e3 into doctrine:1.5.x Sep 11, 2024
10 checks passed
@mvorisek mvorisek deleted the tokenize_using_single_regex branch September 11, 2024 09:12
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