[Chapel Merge] add semicolons, new lines, and formatting to chape

Branch: refs/heads/main
Revision: a83c388
Author: arezaii
Link: add semicolons, new lines, and formatting to chapel-syntax-printer by arezaii · Pull Request #19873 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19873 from arezaii/chpl-syntax-print

add semicolons, new lines, and formatting to chapel-syntax-printer

This PR updates the Chapel syntax printer to include semicolons,
new lines, indentation and basic support for including parentheses
based on operator precedence.

Future work remains on operator precedence support to handle cases
where operations on different types may cause underflow/overflow,
as pointed out by @cassella at Migrate op precedence helpers by arezaii · Pull Request #19902 · chapel-lang/chapel · GitHub

var a: int;
var b, c: int(8);

means that a+(b+c) does need its parens due to overflow/underflow.

reviewed by @dlongnecke-cray - thanks!

TESTING:

  • paratest

Signed-off-by: arezaii ahmad.rezaii@hpe.com

Modified Files:
M compiler/dyno/include/chpl/queries/all-global-strings.h

M compiler/dyno/lib/uast/chpl-syntax-printer.cpp
M compiler/dyno/test/uast/testStringify.cpp

Compare: https://github.com/chapel-lang/chapel/compare/68969d4ea211...a83c3886e455