Skip to content

When the table name starts with "set" (e.g. "settings"), the "set" prefix is highlighted as if it was a reserved keyword. #1872

@your-diary

Description

@your-diary
Image

Steps to Reproduce

  1. Type SELECT * FROM settings_123 WHERE id = 123;.

System

  • mycli version: 1.70.0
  • OS/version: macOS

Discussion

AI says

Cause: mycli uses Pygments MySqlLexer, and that lexer has a special rule:

(r'\b(set)(?!\s*\()', Keyword),

It matches set at a word start, but does not require a word end, so in settings_123 it tokenizes as:

- set -> Keyword (green)
- tings_123 -> Name

I verified this directly by tokenizing SELECT * FROM settings_123 with MySqlLexer, and it produces exactly that split.

(I'm sorry if I should open this issue in the Pygments repo instead.)


By the way, I'm not affected by this issue so much; I almost don't care. So it won't hurt me if this issue is closed as not planned :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions