From fd1e20085306c60520d6b44938097cb3145c35f0 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 11 Apr 2021 20:12:54 +0900 Subject: Increase the maximum number of symbol positions per pattern This commit increases the maximum number of symbol positions per pattern to 2^15 (= 32,768). When the limit is exceeded, the parse method returns an error. --- compiler/parser_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'compiler/parser_test.go') diff --git a/compiler/parser_test.go b/compiler/parser_test.go index fd44b5d..c56a82a 100644 --- a/compiler/parser_test.go +++ b/compiler/parser_test.go @@ -8,12 +8,20 @@ import ( ) func TestParse(t *testing.T) { - symPos := func(n uint8) symbolPosition { - return newSymbolPosition(n, false) + symPos := func(n uint16) symbolPosition { + pos, err := newSymbolPosition(n, false) + if err != nil { + panic(err) + } + return pos } - endPos := func(n uint8) symbolPosition { - return newSymbolPosition(n, true) + endPos := func(n uint16) symbolPosition { + pos, err := newSymbolPosition(n, true) + if err != nil { + panic(err) + } + return pos } tests := []struct { -- cgit v1.2.3