diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-13 19:27:41 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-13 19:27:41 +1000 |
commit | a4677a5834210c85e050de6dad13911a85297499 (patch) | |
tree | 0e0802a75478a10b4765fced5eb8c5ddd92183cc /state.go | |
parent | 5716ddb5e7ca3cb4ee445bdd4958c37aeb033baa (diff) |
Clean up autows
Diffstat (limited to 'state.go')
-rw-r--r-- | state.go | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -16,9 +16,8 @@ type State struct { // Error is a secondary return channel from parsers, but used so heavily // in backtracking that it has been inlined to avoid allocations. Error Error - // Called to determine what to ignore when WS is called, or when AutoWS fires - WS VoidParser - NoAutoWS bool + // Called to determine what to ignore when WS is called, or when WS fires + WS VoidParser } // ASCIIWhitespace matches any of the standard whitespace characters. It is faster @@ -60,14 +59,6 @@ func (s *State) Advance(i int) { s.Pos += i } -// AutoWS consumes all whitespace and advances Pos but can be disabled by the NoAutWS() parser. -func (s *State) AutoWS() { - if s.NoAutoWS { - return - } - s.WS(s) -} - // Get the remaining input. func (s *State) Get() string { if s.Pos > len(s.Input) { |