Branch: refs/heads/main
Revision: 5bceaac
Author: arezaii
Link: Unavailable
Log Message:
Merge pull request #19902 from arezaii/migrate-op-precedence
Migrate op precedence helpers
This PR migrates the operator precedence helper and helper to determine if an
operation needs parentheses when printing from AST. The code was moved to the
chpl
namespace to make it available to the new uAST printer. These functions
are then exposed through chpl-syntax-printer.h
and referenced at their
original call sites without changes.
The biggest change here is converting the signatures to use UniqueString
rather
than const char *
. To make this work while preserving the call sites, I added
two wrappers to AstToText
which accept const char*
and convert them before
making the call to the UniqueString
overloads.
A later PR will incorporate this update into the chpl-syntax-printer
's visit
methods.
TESTING:
-
all
chpldoc
tests pass - paratest
-
make docs
and manually skim some docs
reviewed by @mppf - thanks!
Signed-off-by: arezaii ahmad.rezaii@hpe.com
Modified Files:
M compiler/AST/AstToText.cpp
M compiler/dyno/include/chpl/queries/all-global-strings.h
M compiler/dyno/include/chpl/uast/chpl-syntax-printer.h
M compiler/dyno/lib/uast/chpl-syntax-printer.cpp
Compare: https://github.com/chapel-lang/chapel/compare/d9e5b95300e1...5bceaaccfeb7