From f5eb9c821853b22344f1a8bcd82f050ea7613007 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Mon, 9 Dec 2024 01:05:47 -0500 Subject: [PATCH] Defined postfixNodes for LPAREN and RPAREN --- postfixNode.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/postfixNode.go b/postfixNode.go index 561b7a6..ed60b80 100644 --- a/postfixNode.go +++ b/postfixNode.go @@ -104,6 +104,14 @@ func newPostfixNode(contents ...rune) postfixNode { to_return.nodetype = CHARACTER } to_return.contents = append(to_return.contents, contents...) + + // Special cases for LPAREN and RPAREN - they have special characters defined for them + if to_return.nodetype == LPAREN { + to_return.contents = []rune{LPAREN_CHAR} + } + if to_return.nodetype == RPAREN { + to_return.contents = []rune{RPAREN_CHAR} + } } return to_return }