syntax-tree-accessors #2

Merged
sashakoshka merged 22 commits from syntax-tree-accessors into main 2022-09-05 08:52:09 -06:00
3 changed files with 4 additions and 13 deletions
Showing only changes of commit 89834ac390 - Show all commits

View File

@ -14,15 +14,15 @@ type ParsingOperation struct {
tokens []lexer.Token
tokenIndex int
tree *SyntaxTree
tree SyntaxTree
}
// Parse reads the files located in the module specified by modulePath, and
// converts them into an abstract syntax tree.
func Parse (modulePath string) (tree *SyntaxTree, err error) {
func Parse (modulePath string) (tree SyntaxTree, err error) {
parser := ParsingOperation {
modulePath: modulePath,
tree: &SyntaxTree {
tree: SyntaxTree {
sections: make(map[string] Section),
},
}

View File

@ -7,15 +7,6 @@ import "testing"
func checkTree (modulePath string, correct string, test *testing.T) {
tree, err := Parse(modulePath)
if tree == nil {
test.Log("TREE IS NIL!")
if err != io.EOF && err != nil {
test.Log("returned error:")
test.Log(err)
}
test.Fail()
return
}
treeString := tree.ToString(0)
treeRunes := []rune(treeString)

View File

@ -44,7 +44,7 @@ type Identifier struct {
trail []string
}
// TypeKind represents what kind of type a type is
// TypeKind represents what kind of type a type is.
type TypeKind int
const (