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 +}