• 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
..
analyze.dart Loading commit data...
analyze_base.dart Loading commit data...
analyze_continuously.dart Loading commit data...
analyze_once.dart Loading commit data...
assemble.dart Loading commit data...
attach.dart Loading commit data...
build.dart Loading commit data...
build_aar.dart Loading commit data...
build_apk.dart Loading commit data...
build_appbundle.dart Loading commit data...
build_bundle.dart Loading commit data...
build_ios.dart Loading commit data...
build_ios_framework.dart Loading commit data...
build_linux.dart Loading commit data...
build_macos.dart Loading commit data...
build_macos_framework.dart Loading commit data...
build_web.dart Loading commit data...
build_windows.dart Loading commit data...
channel.dart Loading commit data...
clean.dart Loading commit data...
config.dart Loading commit data...
create.dart Loading commit data...
create_base.dart Loading commit data...
custom_devices.dart Loading commit data...
daemon.dart Loading commit data...
debug_adapter.dart Loading commit data...
devices.dart Loading commit data...
doctor.dart Loading commit data...
downgrade.dart Loading commit data...
drive.dart Loading commit data...
emulators.dart Loading commit data...
generate.dart Loading commit data...
generate_localizations.dart Loading commit data...
ide_config.dart Loading commit data...
install.dart Loading commit data...
logs.dart Loading commit data...
make_host_app_editable.dart Loading commit data...
packages.dart Loading commit data...
precache.dart Loading commit data...
run.dart Loading commit data...
screenshot.dart Loading commit data...
shell_completion.dart Loading commit data...
symbolize.dart Loading commit data...
test.dart Loading commit data...
update_packages.dart Loading commit data...
upgrade.dart Loading commit data...
validate_project.dart Loading commit data...