Introduce the #Atom syntax
commitccd057d3683e727dc1b94271fe364fa94f720367
authorVincent Siles <vsiles@fb.com>
Fri, 30 Oct 2020 17:39:31 +0000 (30 10:39 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 30 Oct 2020 17:41:50 +0000 (30 10:41 -0700)
tree63ca737eb6a4a7c82c8e51d627c56ec9156675ec
parent62a9a7ab1d4b0484319e9772e3f468a5b84502e6
Introduce the #Atom syntax

Summary:
This feature needs the `--disable-hash-comments` flag (see D24492480 (https://github.com/facebook/hhvm/commit/416707184353ba6dc6c084d52349f37d4723d35c)).
The current behavior is that:
- `#!` is still a hashbang comment
- `#` followed by a letter is an atom
- `#` followed by anything else is invalid

Reviewed By: shayne-fletcher

Differential Revision: D24623251

fbshipit-source-id: 68fd8c76c812ffbbcc2d17dfb6a4038798288abb
60 files changed:
hphp/hack/src/annotated_ast/aast.ml
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/decl/direct_decl_smart_constructors_generated.rs
hphp/hack/src/errors/error_codes.ml
hphp/hack/src/errors/errors.ml
hphp/hack/src/errors/errors.mli
hphp/hack/src/facts/facts_smart_constructors_generated.rs
hphp/hack/src/hackfmt/hack_format.ml
hphp/hack/src/ifc/ifc_utils.ml
hphp/hack/src/naming/naming.ml
hphp/hack/src/naming/nast.ml
hphp/hack/src/oxidized/aast_visitor/node_impl_gen.rs
hphp/hack/src/oxidized/aast_visitor/node_mut_impl_gen.rs
hphp/hack/src/oxidized/gen/aast.rs
hphp/hack/src/oxidized/gen/error_codes.rs
hphp/hack/src/oxidized/impl_gen/aast_impl_gen.rs
hphp/hack/src/oxidized_by_ref/gen/aast.rs
hphp/hack/src/parser/core/expression_parser.rs
hphp/hack/src/parser/core/lexer.rs
hphp/hack/src/parser/decl_mode_smart_constructors_generated.rs
hphp/hack/src/parser/flatten_smart_constructors.rs
hphp/hack/src/parser/full_fidelity_syntax.ml
hphp/hack/src/parser/full_fidelity_syntax_kind.ml
hphp/hack/src/parser/full_fidelity_syntax_type.ml
hphp/hack/src/parser/full_fidelity_token_kind.ml
hphp/hack/src/parser/full_fidelity_validated_syntax.ml
hphp/hack/src/parser/js/full_fidelity_schema.json
hphp/hack/src/parser/lowerer/lowerer.rs
hphp/hack/src/parser/minimal_smart_constructors.rs
hphp/hack/src/parser/ocaml_syntax_generated.rs
hphp/hack/src/parser/positioned_smart_constructors.rs
hphp/hack/src/parser/rust_parser_errors.rs
hphp/hack/src/parser/schema/full_fidelity_schema.ml
hphp/hack/src/parser/schema/schema_definition.ml
hphp/hack/src/parser/schema/token_schema_definition.ml
hphp/hack/src/parser/smart_constructors_generated.rs
hphp/hack/src/parser/smart_constructors_wrappers.rs
hphp/hack/src/parser/syntax_by_ref/syntax_children_iterator_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_impl_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_type_impl_generated.rs
hphp/hack/src/parser/syntax_by_ref/syntax_variant_generated.rs
hphp/hack/src/parser/syntax_generated.rs
hphp/hack/src/parser/syntax_kind.rs
hphp/hack/src/parser/syntax_sig.ml
hphp/hack/src/parser/syntax_smart_constructors_generated.rs
hphp/hack/src/parser/syntax_type.rs
hphp/hack/src/parser/token_kind.rs
hphp/hack/src/parser/verify_smart_constructors_generated.rs
hphp/hack/src/typing/nastInitCheck.ml
hphp/hack/src/typing/typing.ml
hphp/hack/src/typing/typing_utils.ml
hphp/hack/test/enum_atom/atom.php
hphp/hack/test/enum_atom/atom.php.exp
hphp/hack/test/enum_atom/atom1.php
hphp/hack/test/enum_atom/atom1.php.exp
hphp/hack/test/enum_atom/atom_wrong_place.php [new file with mode: 0644]
hphp/hack/test/enum_atom/atom_wrong_place.php.exp [new file with mode: 0644]
hphp/test/slow/hash_not_bang.php.expectf
hphp/test/slow/hashbang_regression.php
hphp/test/slow/hashbang_regression.php.expectf