Skip to content

Commit

Permalink
add parens for unary
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Abraham <[email protected]>
  • Loading branch information
jabraham17 committed Oct 22, 2024
1 parent ebca1e1 commit 0e7a6e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/chpl-language-server/src/symbol_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,18 +357,18 @@ def op_to_string(op: str) -> str:
return special.get(op, f" {op} ")

comps = []
paren = call.parenth_location()
if paren:
comps.append(_wrap_str("("))
if call.is_unary_op():
comps.append(_wrap_str(call.op()))
comps.extend(_node_to_string(call.actual(0)))
else:
paren = call.parenth_location()
if paren:
comps.append(_wrap_str("("))
comps.extend(_node_to_string(call.actual(0)))
comps.append(_wrap_str(op_to_string(call.op())))
comps.extend(_node_to_string(call.actual(1)))
if paren:
comps.append(_wrap_str(")"))
if paren:
comps.append(_wrap_str(")"))
return comps


Expand Down

0 comments on commit 0e7a6e8

Please sign in to comment.