Allow nested module names
commit447ada82a1432be07212a901e9ebfd112ac1317e
authorPaul Vick <paulvick@fb.com>
Fri, 22 Jul 2022 19:03:52 +0000 (22 12:03 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 Jul 2022 19:03:52 +0000 (22 12:03 -0700)
treef6cd89cc6cfa733f9a43a00fbaa67cb68c7a99b5
parent4f23fe767571e71d40a9eac3b819e8734ffa8a03
Allow nested module names

Summary:
As a part of the module references work, modules now are allowed to be nested inside one another. So module `x.y.z` is module `z` nested inside module `y` which is nested inside module `x`.

At the moment, there is no practical semantics assigned to nested modules, they're really just a module name with dots in them. So the parser parses them as qualified names, but once they are translated into the type checker, they just become regular names (that happen to have dots in them).

Reviewed By: oulgen

Differential Revision: D37775964

fbshipit-source-id: ea8406bcb3a7ad3444ff3dbd5ef5bced678c282f
56 files changed:
hphp/hack/src/decl/direct_decl_smart_constructors.rs
hphp/hack/src/naming/naming_special_names.rs
hphp/hack/src/parser/core/declaration_parser.rs
hphp/hack/src/parser/core/parser_trait.rs
hphp/hack/src/parser/full_fidelity_syntax_type.ml
hphp/hack/src/parser/full_fidelity_validated_syntax.ml
hphp/hack/src/parser/js/full_fidelity_schema.json
hphp/hack/src/parser/rust_parser_errors.rs
hphp/hack/src/parser/schema/full_fidelity_schema.ml
hphp/hack/src/parser/schema/full_fidelity_schema_version_number.rs
hphp/hack/src/parser/schema/schema_definition.ml
hphp/hack/test/full_fidelity/cases/module_newtype.php.json.exp
hphp/hack/test/full_fidelity/cases/module_newtype_bad1.php.json.exp
hphp/hack/test/full_fidelity/cases/module_newtype_bad2.php.json.exp
hphp/hack/test/full_fidelity/cases/module_newtype_bad3.php.json.exp
hphp/hack/test/full_fidelity/cases/module_newtype_bad4.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/internal_keyword1.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad1.php
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad1.php.errors.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad1.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 93% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad2.php
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad2.php.errors.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad2.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 89% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad3.php
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad3.php.errors.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad3.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 89% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad4.php
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad4.php.errors.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad4.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 89% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad5.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad5.php.errors.exp [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad5.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 56% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_good.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_decl_good1.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_decl_good1.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_decl_bad_xhp.php.json.exp with 50% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad1.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad2.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad3.php
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad3.php.errors.exp
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad3.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad4.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad4.php.errors.exp [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_bad4.php.json.exp [copied from hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_good.php.json.exp with 55% similarity]
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_good.php.json.exp
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_good1.php [new file with mode: 0644]
hphp/hack/test/full_fidelity/cases/modules/module_membership_decl_good1.php.json.exp [new file with mode: 0644]
hphp/hack/test/typecheck/modules/module_nested.php [new file with mode: 0644]
hphp/hack/test/typecheck/modules/module_nested.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/modules/module_nested.php.pess_exp [new file with mode: 0644]
hphp/hack/test/typecheck/modules/module_nested.php.rust_provider_backend.exp [new file with mode: 0644]
hphp/hack/test/typecheck/modules/module_nested.php.shallow_decl.exp [new file with mode: 0644]
hphp/test/slow/modules/reflection-4.inc [new file with mode: 0644]
hphp/test/slow/modules/reflection-4.inc2 [new file with mode: 0644]
hphp/test/slow/modules/reflection-4.php [new file with mode: 0644]
hphp/test/slow/modules/reflection-4.php.expectf [new file with mode: 0644]