MMM im so full from phrase analysis
This commit is contained in:
parent
e85e61d70c
commit
4385319874
@ -4,7 +4,6 @@ import "git.tebibyte.media/arf/arf/parser"
|
|||||||
|
|
||||||
// Block represents a scoped block of phrases.
|
// Block represents a scoped block of phrases.
|
||||||
type Block struct {
|
type Block struct {
|
||||||
locatable
|
|
||||||
phrases []Phrase
|
phrases []Phrase
|
||||||
|
|
||||||
// TODO: create a scope struct and embed it
|
// TODO: create a scope struct and embed it
|
||||||
@ -31,7 +30,10 @@ func (analyzer *analysisOperation) analyzeBlock (
|
|||||||
err error,
|
err error,
|
||||||
) {
|
) {
|
||||||
for _, inputPhrase := range inputBlock {
|
for _, inputPhrase := range inputBlock {
|
||||||
|
var outputPhrase Phrase
|
||||||
|
outputPhrase, err = analyzer.analyzePhrase(inputPhrase)
|
||||||
|
block.phrases = append(block.phrases, outputPhrase)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package analyzer
|
package analyzer
|
||||||
|
|
||||||
|
import "regexp"
|
||||||
import "git.tebibyte.media/arf/arf/file"
|
import "git.tebibyte.media/arf/arf/file"
|
||||||
import "git.tebibyte.media/arf/arf/parser"
|
import "git.tebibyte.media/arf/arf/parser"
|
||||||
import "git.tebibyte.media/arf/arf/infoerr"
|
import "git.tebibyte.media/arf/arf/infoerr"
|
||||||
|
|
||||||
|
var validNameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9_]*$")
|
||||||
|
|
||||||
type Phrase interface {
|
type Phrase interface {
|
||||||
// Provided by phraseBase
|
// Provided by phraseBase
|
||||||
Location () (location file.Location)
|
Location () (location file.Location)
|
||||||