forked from lalrpop/lalrpop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lalrpop#480 ('use super::' with internal lexer)
I was surprised to see that the infrastructure was already there, and in fact the correct function was even already in use! Just this argument was wrong. I found it surprising that this would be the case, so I did some sleuthing into the commit history. The single line modified by this commit was written in this commit: 1b206d1 This line was probably copied from the similar line that generates the 'uses' at the very top of the generated grammar file. You can see the test added for the aforementioned commit here: lalrpop@4ecd594#diff-a6e59d678291fca1872fd2212d565242df94e2bf23428bc5135a3a8c7e7bc250 That test had a very simple import of the form `use super::Name;`. This worked, but for the wrong reason; it was causing the internal module to import `Name` indirectly via the `use super::Name` that was generated in the outer module. Anything of the form `use super::module::Name` or `use super::Name as Renamed;' would fail, however, as `module` and `Name` wouldn't exist at that location.
- Loading branch information
Showing
4 changed files
with
21 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
grammar; | ||
|
||
use super::util::CaptureMe as Renamed; | ||
|
||
pub S: Renamed = "b" => Renamed; |
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