Skip to content

Conversation

@ksfi
Copy link

@ksfi ksfi commented Dec 28, 2023

Addresses TODOs

char now describe escape sequences and positive dedent for multi lines comments is supported in lexer

@ksfi ksfi requested a review from gvanrossum as a code owner December 28, 2023 17:43
@ghost
Copy link

ghost commented Dec 28, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Dec 28, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@ksfi ksfi changed the title cases generator lexer: dedent > 0 + escape sequence gh-113547 cases generator lexer: dedent > 0 + escape sequence Dec 28, 2023
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

The changes for escape sequences look fine, but it could do with a few tests.

The changes to to_text could be simplified and it also needs a test or two.

temp: list[str] = []
for line in text.split("\n"):
leading_space = len(line) - len(line.lstrip())
if leading_space > dedent:
Copy link
Member

Choose a reason for hiding this comment

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

Is the regex necessary? Would line = line[min(leading_space, dedent):] work?

@ksfi
Copy link
Author

ksfi commented Jan 7, 2024

Added tests in Lib/test/test_tools + simplified the de-indentation as you mentioned

Copy link
Member

Choose a reason for hiding this comment

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

I think a better name and more general name is: test_lexer.py and then the two short files can be merged.

Copy link
Author

Choose a reason for hiding this comment

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

done!

@python-cla-bot
Copy link

python-cla-bot bot commented Oct 3, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants