summaryrefslogtreecommitdiff
path: root/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'parser.go')
-rw-r--r--parser.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/parser.go b/parser.go
index 12bb858..bc65e6d 100644
--- a/parser.go
+++ b/parser.go
@@ -109,9 +109,11 @@ func WS() Parser {
// Cut prevents backtracking beyond this point. Usually used after keywords when you
// are sure this is the correct path. Improves performance and error reporting.
-func Cut(ps *State) Result {
- ps.Cut = ps.Pos
- return Result{}
+func Cut() Parser {
+ return func(ps *State) Result {
+ ps.Cut = ps.Pos
+ return Result{}
+ }
}
// Regex returns a match if the regex successfully matches