From 9357758697305753a68b541b42452a8cb13eebe2 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sat, 20 Feb 2021 17:36:16 +0900 Subject: Add + and ? operators * a+ matches 'a' one or more times. This is equivalent to aa*. * a? matches 'a' zero or one time. --- compiler/ast_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/ast_test.go') diff --git a/compiler/ast_test.go b/compiler/ast_test.go index 61d6064..735ccf8 100644 --- a/compiler/ast_test.go +++ b/compiler/ast_test.go @@ -102,6 +102,12 @@ func TestASTNode(t *testing.T) { first: newSymbolPositionSet().add(1), last: newSymbolPositionSet().add(1), }, + { + root: newOptionNode(newSymbolNode(nil, 0, 1)), + nullable: true, + first: newSymbolPositionSet().add(1), + last: newSymbolPositionSet().add(1), + }, } for i, tt := range tests { t.Run(fmt.Sprintf("#%v", i), func(t *testing.T) { -- cgit v1.2.3