diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-10 22:10:30 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-10 22:10:30 +1000 |
commit | 945e9f0ef0d9e1e678435d3090d4a742f6682440 (patch) | |
tree | 18d97b26e44715cbf35c0dc7ec98ad6f3f2df95b /parser.go | |
parent | 8a92b5348f8cf6769f30237df906ee9ce71ad237 (diff) |
Improve cut godoc
Diffstat (limited to 'parser.go')
-rw-r--r-- | parser.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |