Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-135148: Correctly handle f/t strings with comments and debug expressions#135198

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 4 commits intopython:mainfrompablogsal:gh-135148
Jul 16, 2025
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix linting
  • Loading branch information
@pablogsal
pablogsal committedJun 7, 2025
commit3c86cce55143ed98db6c8a51a431a363eecbd4aa
10 changes: 5 additions & 5 deletionsParser/lexer/lexer.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -126,16 +126,16 @@ set_ftstring_expr(struct tok_state* tok, struct token *token, char c) {
int in_string = 0;
char quote_char = 0;
char string_quote = 0;

for (Py_ssize_t i = 0; i < tok_mode->last_expr_size - tok_mode->last_expr_end; i++) {
char ch = tok_mode->last_expr_buffer[i];

// Skip escaped characters
if (ch == '\\') {
i++;
continue;
}

// Handle quotes
if (ch == '"' || ch == '\'') {
if (!in_string) {
Expand All@@ -147,7 +147,7 @@ set_ftstring_expr(struct tok_state* tok, struct token *token, char c) {
}
continue;
}

// Check for # outside strings
if (ch == '#' && !in_string) {
hash_detected = 1;
Expand DownExpand Up@@ -183,7 +183,7 @@ set_ftstring_expr(struct tok_state* tok, struct token *token, char c) {
}
// Skip comments
else if (ch == '#' && !in_string) {
while (i < tok_mode->last_expr_size - tok_mode->last_expr_end &&
while (i < tok_mode->last_expr_size - tok_mode->last_expr_end &&
tok_mode->last_expr_buffer[i] != '\n') {
i++;
}
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp