diff --git a/amod/amod.go b/amod/amod.go index 9f4b4b9..1ba1644 100644 --- a/amod/amod.go +++ b/amod/amod.go @@ -56,7 +56,7 @@ func GenerateModel(buffer string) (model *actr.Model, iLog *issues.Log, err erro log := newLog() iLog = &log.Log - amod, err := parse(r) + amod, err := parseAMOD(r) if err != nil { pErr, ok := err.(participle.Error) if ok { @@ -88,7 +88,7 @@ func GenerateModelFromFile(fileName string) (model *actr.Model, iLog *issues.Log log := newLog() iLog = &log.Log - amod, err := parseFile(fileName) + amod, err := parseAMODFile(fileName) if err != nil { pErr, ok := err.(participle.Error) if ok { diff --git a/amod/parse.go b/amod/parse.go index b962af6..2d4b9c0 100644 --- a/amod/parse.go +++ b/amod/parse.go @@ -443,7 +443,7 @@ var amodParser = participle.MustBuild[amodFile]( participle.Unquote(), ) -func parse(r io.Reader) (amod *amodFile, err error) { +func parseAMOD(r io.Reader) (amod *amodFile, err error) { amod, err = amodParser.Parse("", r) if err != nil { return nil, err @@ -452,12 +452,12 @@ func parse(r io.Reader) (amod *amodFile, err error) { return } -func parseFile(filename string) (*amodFile, error) { +func parseAMODFile(filename string) (*amodFile, error) { file, err := os.Open(filename) if err != nil { return nil, err } defer file.Close() - return parse(file) + return parseAMOD(file) } diff --git a/amod/parse_test.go b/amod/parse_test.go index 396987c..a39c08f 100644 --- a/amod/parse_test.go +++ b/amod/parse_test.go @@ -20,7 +20,7 @@ func TestMinimumModel(t *testing.T) { ~~ init ~~ ~~ productions ~~` - _, err := parse(strings.NewReader(src)) + _, err := parseAMOD(strings.NewReader(src)) if err != nil { t.Errorf("Could not parse minimal src: %s", err.Error()) @@ -43,7 +43,7 @@ func FuzzExampleModels(f *testing.F) { } f.Fuzz(func(t *testing.T, orig string) { - _, err := parse(strings.NewReader(orig)) + _, err := parseAMOD(strings.NewReader(orig)) if err != nil && !errors.As(err, new(*participle.ParseError)) && !errors.As(err, new(*participle.UnexpectedTokenError)) &&