[Chapel Merge] Ignore ForwardingStmt when checking for defexpr in

Branch: refs/heads/master
Revision: 0105042
Author: slnguyen
Log Message:

Merge pull request #16347 from slnguyen/i16097

Ignore ForwardingStmt when checking for defexpr in buildPragmaStmt

[reviewed by @mppf and @lydia-duncan]

The buildPragmaStmt(…) function checks for DefExprs that it can attach to pragmas. ‘forwarding var …’ declarations are converted into a DefExpr followed by a ForwardingStmt. An error was raised when encountering the ForwardingStmt. This PR adjust buildPragmaStmt(…) to allow the ForwardingStmt.

Modified Files:
A test/parsing/attachPragmaToForwardingVar.chpl
A test/parsing/attachPragmaToForwardingVar.good
M compiler/AST/build.cpp

Compare: https://github.com/chapel-lang/chapel/compare/7ee065879127...01050429238e