-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark start and end of included .re files with line directives.
This fixes bug #386 "#line directives around !include contents" reported by Cyan Ogilvie. It is easy to generate line directive at the beginning of the include file, but much more difficult to find the end of it: file contents are just a stream of bytes in the input buffer, and the continuation of the parent file follows immediately after the end of the inlude file. Therefore we use a hack and "unread" the include directive in the parent file before filling the buffer with the contents of the include file (as if the include directive appeared after the contens of include file). This makes the lexer read the directive for the second time; at this point we know it's the same include directive because the include file is already on top of the file stack. So we ignore the directive and simply generate line info. The current implementation has a problem with nested includes that have identical relative file paths. This will be fixed in a follow-up patch by looking at the resolved paths when comparing files.
- Loading branch information
Showing
8 changed files
with
474 additions
and
441 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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