From 82093865b04b416258ddfc52ca9be771f840f42b Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 19 Oct 2022 13:27:48 -0400 Subject: [PATCH] wip --- analyzer/func-section.go | 14 +++++++++++++- analyzer/func-section_test.go | 2 +- analyzer/node-traits.go | 6 ++++++ analyzer/phrase.go | 30 ++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 analyzer/phrase.go diff --git a/analyzer/func-section.go b/analyzer/func-section.go index f9c26bb..34cabab 100644 --- a/analyzer/func-section.go +++ b/analyzer/func-section.go @@ -1,3 +1,15 @@ package analyzer -// TODO +// FuncSection represents a type definition section. +type FuncSection struct { + sectionBase + + +} + +func (analyzer *analysisOperation) analyzeFuncSection () ( + section Section, + err error, +) { + return +} diff --git a/analyzer/func-section_test.go b/analyzer/func-section_test.go index 49bd3ee..c9d5d9b 100644 --- a/analyzer/func-section_test.go +++ b/analyzer/func-section_test.go @@ -13,7 +13,7 @@ funcSection ro ../tests/analyzer/funcSection.bArbitrary block arbitraryPhrase command 'puts' - cast + castPhrase type aCString arg string 'hellorld` + "\000" + `' `, test) diff --git a/analyzer/node-traits.go b/analyzer/node-traits.go index ed70884..6f47624 100644 --- a/analyzer/node-traits.go +++ b/analyzer/node-traits.go @@ -70,3 +70,9 @@ func (section sectionBase) locator () (where locator) { where = section.where return } + +// phraseBase is a struct that all phrases must embed. +type phraseBase struct { + locatable + returnsTo []Argument +} diff --git a/analyzer/phrase.go b/analyzer/phrase.go new file mode 100644 index 0000000..7f544ee --- /dev/null +++ b/analyzer/phrase.go @@ -0,0 +1,30 @@ +package analyzer + +import "git.tebibyte.media/arf/arf/parser" + +type Phrase interface { + +} + +type ArbitraryPhrase struct { + phraseBase + command string + arguments []Argument +} + +type CastPhrase struct { + phraseBase + command Argument + arguments []Argument +} + +// TODO more phrases lol + +func (analyzer *analysisOperation) analyzePhrase ( + inputPhrase parser.Phrase, +) ( + phrase Phrase, + err error, +) { + return +}