Skip to content

Simplify lexer: Use Match.lastgroup instead of lastindex #1129

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

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

erezsh
Copy link
Member

@erezsh erezsh commented Mar 20, 2022

No idea why we didn't do that before.

I think there's a reason? But I can't remember what it was.

@erezsh erezsh requested a review from MegaIng March 20, 2022 17:50
@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2022

Codecov Report

Merging #1129 (c5239f8) into master (1bc7fcc) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1129   +/-   ##
=======================================
  Coverage   89.27%   89.27%           
=======================================
  Files          52       52           
  Lines        7440     7440           
=======================================
  Hits         6642     6642           
  Misses        798      798           
Flag Coverage Δ
unittests 89.27% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lark/lexer.py 94.64% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bc7fcc...c5239f8. Read the comment docs.

@MegaIng
Copy link
Member

MegaIng commented Mar 20, 2022

I don't think I ever looked at this code closely enough to notice this. Seems reasonable.

@erezsh
Copy link
Member Author

erezsh commented Mar 20, 2022

I just wonder if there are some edge cases where if users write strange regexps, it returns something different.

@MegaIng
Copy link
Member

MegaIng commented Mar 20, 2022

From the documentation of re it sounds like those should always match up.

@erezsh erezsh merged commit 85ea92e into master Mar 22, 2022
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy