From b8d5ea0897085823a83e871ecd9635cf21efbf43 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Tue, 29 Oct 2024 10:05:01 -0400 Subject: [PATCH] Wrote function to create a character node regardless of the contents of the node --- postfixNode.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/postfixNode.go b/postfixNode.go index c7f384a..24f52a6 100644 --- a/postfixNode.go +++ b/postfixNode.go @@ -47,3 +47,11 @@ func newPostfixNode(contents ...rune) postfixNode { } return to_return } + +// Creates a character node, regardless of the contents +func newPostfixCharNode(contents ...rune) postfixNode { + toReturn := postfixNode{} + toReturn.nodetype = CHARACTER + toReturn.contents = append(toReturn.contents, contents...) + return toReturn +}