From 9cb2f68581d338230961a83879ee6be64d4a3e2a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 16 Aug 2022 15:50:34 -0400 Subject: [PATCH] Argument kind is now called .kind instead of .what --- parser/tree-tostring.go | 2 +- parser/tree.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index 7135f0f..a46da08 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -124,7 +124,7 @@ func (phrase *Phrase) ToString (indent int, breakLine bool) (output string) { func (argument *Argument) ToString (indent int, breakLine bool) (output string) { if !breakLine { indent = 0 } - switch argument.what { + switch argument.kind { case ArgumentKindPhrase: output += doIndent ( indent, diff --git a/parser/tree.go b/parser/tree.go index ea81d24..7919bde 100644 --- a/parser/tree.go +++ b/parser/tree.go @@ -57,9 +57,7 @@ type Type struct { type Declaration struct { location file.Location name string - - what Type - value []Argument + what Type } // ObjectAttribute represents a notation to initialize object attributes. It @@ -134,7 +132,7 @@ const ( // allows things like phrases being arguments to other phrases. type Argument struct { location file.Location - what ArgumentKind + kind ArgumentKind value any // TODO: if there is an argument expansion operator its existence should // be stored here in a boolean.