From 7d23a4d9c9a2dc87d049ff2f21987f9d482827a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Thu, 21 May 2026 13:15:41 +0200 Subject: [PATCH] grammars: generate in strict mode (peg -strict) Change the '//go:generate' in grammars/... to use -strict mode. $ go generate -x ./grammars/... go tool peg -strict -switch -inline c.peg go tool peg -strict -switch -inline calculator.peg go tool peg -strict -switch -inline calculator.peg go tool peg -strict -switch -inline fexl.peg go tool peg -strict -switch -inline java_1_7.peg go tool peg -strict -switch -inline long.peg --- grammars/c/c_test.go | 2 +- grammars/calculator/calculator_test.go | 2 +- grammars/calculatorast/calculator_test.go | 2 +- grammars/fexl/fexl_test.go | 2 +- grammars/java/java_test.go | 2 +- grammars/longtest/long_test.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grammars/c/c_test.go b/grammars/c/c_test.go index a5a8422..7965ad1 100644 --- a/grammars/c/c_test.go +++ b/grammars/c/c_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline c.peg +//go:generate go tool peg -strict -switch -inline c.peg package c diff --git a/grammars/calculator/calculator_test.go b/grammars/calculator/calculator_test.go index eff4f39..4c4509f 100644 --- a/grammars/calculator/calculator_test.go +++ b/grammars/calculator/calculator_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline calculator.peg +//go:generate go tool peg -strict -switch -inline calculator.peg package calculator diff --git a/grammars/calculatorast/calculator_test.go b/grammars/calculatorast/calculator_test.go index 0bd3015..55ef10f 100644 --- a/grammars/calculatorast/calculator_test.go +++ b/grammars/calculatorast/calculator_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline calculator.peg +//go:generate go tool peg -strict -switch -inline calculator.peg package calculatorast diff --git a/grammars/fexl/fexl_test.go b/grammars/fexl/fexl_test.go index 7c226c4..e8ab8ad 100644 --- a/grammars/fexl/fexl_test.go +++ b/grammars/fexl/fexl_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline fexl.peg +//go:generate go tool peg -strict -switch -inline fexl.peg package fexl diff --git a/grammars/java/java_test.go b/grammars/java/java_test.go index 20d7838..a0e692a 100644 --- a/grammars/java/java_test.go +++ b/grammars/java/java_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline java_1_7.peg +//go:generate go tool peg -strict -switch -inline java_1_7.peg package java diff --git a/grammars/longtest/long_test.go b/grammars/longtest/long_test.go index 506656e..dd6f7a2 100644 --- a/grammars/longtest/long_test.go +++ b/grammars/longtest/long_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:generate go tool peg -switch -inline long.peg +//go:generate go tool peg -strict -switch -inline long.peg package longtest