Parser option for brace escape
commit863845c5481127c0b32a2f988115201771c482a8
authorKaty Voor <voork@fb.com>
Wed, 21 Apr 2021 17:44:58 +0000 (21 10:44 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Apr 2021 17:46:34 +0000 (21 10:46 -0700)
treea5e049281a78c637cbdc56258c047945363a8447
parentcf07779714e3072e917259880a0d16c3553ea67c
Parser option for brace escape

Summary:
Adds parser option for making \{ a valid escape sequence

So that
```
$x = 5;
$y = 6;

Currently:

var_dump("\{$x,$y}") => "\{5,6}"
var_dump("{$x,$y}") => fatal

We would like:

var_dump("\{$x,$y}") => "{5,6}"
```

This was a task I had as an intern and didn't end up getting to. Found an old diff relating to it and decided to finish it off.

Reviewed By: shayne-fletcher

Differential Revision: D27776520

fbshipit-source-id: 111098806a66ed49328d0b7db68a2e05c6f595d4
16 files changed:
hphp/hack/src/hhbc/compile.rs
hphp/hack/src/hhbc/compile_ffi.h
hphp/hack/src/hhbc/hhbc_by_ref/compile.rs
hphp/hack/src/hhbc/hhbc_by_ref/options.rs
hphp/hack/src/hhbc/hhbc_options.ml
hphp/hack/src/hhbc/options.rs
hphp/hack/src/options/globalOptions.ml
hphp/hack/src/options/globalOptions.mli
hphp/hack/src/options/parserOptions.ml
hphp/hack/src/oxidized/gen/global_options.rs
hphp/hack/src/oxidized/gen/parser_options.rs
hphp/hack/src/oxidized/manual/global_options_impl.rs
hphp/hack/src/oxidized_by_ref/gen/global_options.rs
hphp/hack/src/oxidized_by_ref/manual/global_options_impl.rs
hphp/runtime/base/runtime-option.cpp
hphp/runtime/base/runtime-option.h