Skip to content

Introduce caseInsensitive lexer rule option #3436

@KvanTTT

Description

@KvanTTT

The new option caseInsensitive works great and it simplifies grammar a lot. But there are some lexer rule exceptions where it should be disabled. For instance, case-insensitivity affects lexing process for the following rule because a string starting with lower n is incorrect in TSql, MySql, but a string starting with upper N is correct. Enabled caseInsensitive allows both strings:

options { caseInsensitive=true; }
STRING: 'N'? '\'' (~'\'' | '\'\'')* '\'';

It's possible to check online the following string: SELECT N'sample';

I suggest adding a new lexer rule option caseInsensitive that naturally disables/enables case insensitivity for certain rules:

options { caseInsensitive=true; }
STRING options { caseInsensitive=false; } : 'N'? '\'' (~'\'' | '\'\'')* '\'';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions