From f89d021bbe134e3efa0d015a41e9712960cdd009 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 6 Nov 2022 21:31:46 +0900 Subject: Import source code of lexer generator From: https://github.com/nihei9/maleeni --- cmd/vartan/test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'cmd/vartan/test.go') diff --git a/cmd/vartan/test.go b/cmd/vartan/test.go index 50ba8ca..9bd88ff 100644 --- a/cmd/vartan/test.go +++ b/cmd/vartan/test.go @@ -5,7 +5,6 @@ import ( "fmt" "os" - "github.com/nihei9/vartan/grammar" "github.com/nihei9/vartan/tester" "github.com/spf13/cobra" ) @@ -22,14 +21,10 @@ func init() { } func runTest(cmd *cobra.Command, args []string) error { - g, err := readGrammar(args[0]) + gram, _, err := readGrammar(args[0]) if err != nil { return fmt.Errorf("Cannot read a grammar: %w", err) } - cg, _, err := grammar.Compile(g) - if err != nil { - return fmt.Errorf("Cannot read a compiled grammar: %w", err) - } var cs []*tester.TestCaseWithMetadata { @@ -47,7 +42,7 @@ func runTest(cmd *cobra.Command, args []string) error { } t := &tester.Tester{ - Grammar: cg, + Grammar: gram, Cases: cs, } rs := t.Run() -- cgit v1.2.3