External Issue: chpldoc printing of default value expression can omit needed parens

16939, “cassella”, “chpldoc printing of default value expression can omit needed parens”, “2021-01-13T02:49:03Z”

Summary of Problem

chpldoc drops the parens around 3+4 here, which changes the value of the expression from 15 to 11:

Source Code:

proc foo(arg=1+2*(3+4)) {}

Compile command:

chpldoc --no-html --save-sphinx docs

cat docs/source/modules/foo.rst

.. function:: proc foo(arg = 1+2*3+4)

Associated Future Test(s):

Configuration Information

chpl version 1.24.0 pre-release (5f95c6d1d0)

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

CHPL_TARGET_PLATFORM: linux64
CHPL_TARGET_COMPILER: gnu
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native *
CHPL_LOCALE_MODEL: flat
CHPL_COMM: gasnet *
  CHPL_COMM_SUBSTRATE: udp
  CHPL_GASNET_SEGMENT: everything
CHPL_TASKS: qthreads
CHPL_LAUNCHER: amudprun
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
  CHPL_NETWORK_ATOMICS: none
CHPL_GMP: none
CHPL_HWLOC: bundled
CHPL_REGEXP: re2
CHPL_LLVM: none
CHPL_AUX_FILESYS: none