From 0b858d664433d0b11e1d46dbd774e19da5b5a750 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Mon, 9 May 2022 20:49:16 +0900 Subject: Change the default suffix of a grammar file from .vr to .vartan --- cmd/vartan/compile.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/vartan/compile.go') diff --git a/cmd/vartan/compile.go b/cmd/vartan/compile.go index 16eef16..70d01b2 100644 --- a/cmd/vartan/compile.go +++ b/cmd/vartan/compile.go @@ -24,7 +24,7 @@ func init() { cmd := &cobra.Command{ Use: "compile", Short: "Compile grammar you defined into a parsing table", - Example: ` vartan compile grammar.vr -o grammar.json`, + Example: ` vartan compile grammar.vartan -o grammar.json`, Args: cobra.MaximumNArgs(1), RunE: runCompile, } @@ -95,7 +95,7 @@ func runCompile(cmd *cobra.Command, args []string) (retErr error) { return err } - grmPath = filepath.Join(tmpDirPath, "stdin.vr") + grmPath = filepath.Join(tmpDirPath, "stdin.vartan") err = ioutil.WriteFile(grmPath, src, 0600) if err != nil { return err @@ -110,7 +110,7 @@ func runCompile(cmd *cobra.Command, args []string) (retErr error) { var reportFileName string { _, grmFileName := filepath.Split(grmPath) - reportFileName = fmt.Sprintf("%v-report.json", strings.TrimSuffix(grmFileName, ".vr")) + reportFileName = fmt.Sprintf("%v-report.json", strings.TrimSuffix(grmFileName, ".vartan")) } opts := []grammar.CompileOption{ -- cgit v1.2.3