summaryrefslogtreecommitdiff
path: root/parser.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-10 22:10:30 +1000
committerAdam Scarr <adam@vektah.net>2017-08-10 22:10:30 +1000
commit945e9f0ef0d9e1e678435d3090d4a742f6682440 (patch)
tree18d97b26e44715cbf35c0dc7ec98ad6f3f2df95b /parser.go
parent8a92b5348f8cf6769f30237df906ee9ce71ad237 (diff)
Improve cut godoc
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