[
https://issues.apache.org/jira/browse/PIG-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013737#comment-13013737
]
Xuefu Zhang commented on PIG-1931:
----------------------------------
About PIG-1931_3.patch:
1. I think it's a right approach to include the source file name in
QueryParserStringStream. Once that happens, we can get the stored file name in
every token by calling token.getInputStream().getSourceName(). Then, in the
PigParserNodeAdapter, you can set the file name to each PigParserNode instance
created. In this way, you set the file name while AST is generated, which
eliminates the need of recursively set it as done currently at macro expansion
time.
2. For the error header, <file myscript.pig, line 1, column 10> would be more
consistent than <At myscript.pig, line 1, column 10>.
> Integrate Macro Expansion with New Parser
> -----------------------------------------
>
> Key: PIG-1931
> URL: https://issues.apache.org/jira/browse/PIG-1931
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.9.0
> Reporter: Richard Ding
> Assignee: Richard Ding
> Fix For: 0.9.0
>
> Attachments: PIG-1931_1.patch, PIG-1931_2.patch, PIG-1931_3.patch
>
>
> Currently Macro expansion is implemented as a preprocessor (PIG-1793) so that
> it can work with the old parser. Now the new parser replaced old parser in
> trunk and we can integrate macro expansion into the new parser. This has many
> advantages such as better error reporting, less code and making Macro part of
> Pig Latin.
> To aid debugging, Pig command line option -r (dryrun) will produce a script
> with expanded macros (in addition to the script with substituted parameters).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira