diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-04-11 20:12:54 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-04-12 22:43:29 +0900 |
commit | fd1e20085306c60520d6b44938097cb3145c35f0 (patch) | |
tree | 608a89ad04673394fb8eb364c32c3cf86591d204 /compiler/parser_test.go | |
parent | Fix grammar the parser accepts (diff) | |
download | tre-fd1e20085306c60520d6b44938097cb3145c35f0.tar.gz tre-fd1e20085306c60520d6b44938097cb3145c35f0.tar.xz |
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.
Diffstat (limited to 'compiler/parser_test.go')
-rw-r--r-- | compiler/parser_test.go | 16 |
1 files changed, 12 insertions, 4 deletions
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 { |