• Tae Hyung Kim's avatar
    Relax syntax for gen-l10n (#130736) · c6b93b2d
    Tae Hyung Kim authored
    To preserve backward compatibility with the old parser which would
    ignore syntax errors, this PR introduces a way to treat the special
    characters `{` and `}` in the following way:
    1. If we encounter a `{` which searching for a string token and this `{`
    is not followed by a valid placeholder, then we treat the `{` as a
    string and continue lexing for strings.
    2. If we encounter a `}` while not within some expression (i.e.
    placeholders, arguments, plurals, or selects), then we treat the `}` as
    a string and continue lexing for strings.
    
    This makes it so that
    ```
    "helloWorld": "{ } { placeholder }",
    "@@helloWorld": {
      "placeholders": {
        "placeholder" {}
      }
    }
    ```
    treats the `{ }` as a string while `{ placeholder } ` is treated as a
    placeholder.
    
    Fixes https://github.com/flutter/flutter/issues/122404.
    c6b93b2d
Name
Last commit
Last update
..
gen_l10n.dart Loading commit data...
gen_l10n_templates.dart Loading commit data...
gen_l10n_types.dart Loading commit data...
language_subtag_registry.dart Loading commit data...
localizations_utils.dart Loading commit data...
message_parser.dart Loading commit data...