[Dart] Add case changing char stream example by lingyv-li · Pull Request #3246 · antlr/antlr4

Choose a reason for hiding this comment

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

Please use something that doesn't change the length of the output character because it creates problems for mapping to input characters and actually such characters are not used in programming languages.

Your approach change ß to SS (2 chars), I've checked in sandbox:

void main() {
  print("ß".toUpperCase());
}

For instance, you can check the length of the output character, and if it is more than 1 then return the original char. See detail in my comment in a thread about case insensitivity.