Now works with tests
This commit is contained in:
parent
2e79d9c834
commit
49bcbcaa96
@ -20,7 +20,7 @@ type ParsingOperation struct {
|
|||||||
// TODO:
|
// TODO:
|
||||||
// * implement parser cache
|
// * implement parser cache
|
||||||
// * have this try to hit the cache, and actually parse on miss
|
// * have this try to hit the cache, and actually parse on miss
|
||||||
// - rename this to Fetch
|
// * rename this to Fetch
|
||||||
// - add `skim bool` argument. when this is true, don't parse any code or data
|
// - add `skim bool` argument. when this is true, don't parse any code or data
|
||||||
// section initialization values, just definitions and their default values.
|
// section initialization values, just definitions and their default values.
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
package parser
|
package parser
|
||||||
|
|
||||||
import "io"
|
import "io"
|
||||||
|
import "os"
|
||||||
import "strings"
|
import "strings"
|
||||||
import "testing"
|
import "testing"
|
||||||
// import "git.tebibyte.media/arf/arf/types"
|
import "path/filepath"
|
||||||
|
|
||||||
func checkTree (modulePath string, correct string, test *testing.T) {
|
func checkTree (modulePath string, correct string, test *testing.T) {
|
||||||
tree, err := Parse(modulePath)
|
cwd, _ := os.Getwd()
|
||||||
|
modulePath = filepath.Join(cwd, modulePath)
|
||||||
|
println(modulePath)
|
||||||
|
tree, err := Fetch(modulePath)
|
||||||
|
|
||||||
treeString := tree.ToString(0)
|
treeString := tree.ToString(0)
|
||||||
treeRunes := []rune(treeString)
|
treeRunes := []rune(treeString)
|
||||||
|
Reference in New Issue
Block a user