diff --git a/analyzer/block.go b/analyzer/block.go index 1e47aa4..4ad34e1 100644 --- a/analyzer/block.go +++ b/analyzer/block.go @@ -14,7 +14,10 @@ func (block Block) ToString (indent int) (output string) { output += doIndent(indent, "block\n") // TODO: variables - // TODO: phrases + + for _, phrase := range block.phrases { + output += phrase.ToString(indent + 1) + } return } @@ -27,5 +30,8 @@ func (analyzer *analysisOperation) analyzeBlock ( block Block, err error, ) { + for _, inputPhrase := range inputBlock { + + } return } diff --git a/analyzer/func-section.go b/analyzer/func-section.go index e51b16f..0244ff0 100644 --- a/analyzer/func-section.go +++ b/analyzer/func-section.go @@ -52,6 +52,9 @@ func (analyzer *analysisOperation) analyzeFuncSection () ( if inputSection.External() { outputSection.external = true + if inputSection.Root() != nil { + panic("invalid state: input func is external with non-nil root") + } } else { outputSection.root, err = analyzer.analyzeBlock(inputSection.Root())