-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide an AST-like view of modular extension extension node names (#…
…1362) That is: if you have `[%extension.comprehensions.for.in]`, this will be represented in OCaml as `Extensions_parsing.Extension_node_name.("comprehensions" :: ["for"; "in"])`; we're guaranteed to have it be nonempty, we can pass it around as a unit, and most importantly we can change the representation in a single place (e.g., to `[%jst.comprehensions.for.in]`, or to `[%extension'comprehensions'for'in]`, etc.). Some minor error changes come along as well, either around spacing (due to printing changes) or the locations in errors that the user will never see.
- Loading branch information
Showing
6 changed files
with
170 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ocaml/testsuite/tests/jst-modular-extensions/user_error3.compilers.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
File "user_error3.ml", line 21, characters 25-69: | ||
21 | let _unknown_extension = [%extension.this_extension_doesn't_exist] ();; | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: Unknown extension "this_extension_doesn't_exist" referenced via an | ||
[%extension.this_extension_doesn't_exist] extension node | ||
Error: Unknown extension "this_extension_doesn't_exist" referenced via | ||
an [%extension.this_extension_doesn't_exist] extension node |
4 changes: 2 additions & 2 deletions
4
ocaml/testsuite/tests/jst-modular-extensions/user_error5.compilers.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
File "user_error5.ml", line 21, characters 25-40: | ||
File "user_error5.ml", line 21, characters 27-36: | ||
21 | let _unnamed_extension = [%extension] ();; | ||
^^^^^^^^^^^^^^^ | ||
^^^^^^^^^ | ||
Error: Cannot have an extension node named [%extension] |
4 changes: 2 additions & 2 deletions
4
ocaml/testsuite/tests/jst-modular-extensions/user_error6.compilers.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
File "user_error6.ml", line 21, characters 24-56: | ||
21 | let _bad_introduction = [%extension.something.nested] ();; | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Error: The extension "something" was referenced improperly; it started with an | ||
[%extension.something.nested] extension node, | ||
Error: The extension "something" was referenced improperly; it started with | ||
an [%extension.something.nested] extension node, | ||
not an [%extension.something] one |