From a4677a5834210c85e050de6dad13911a85297499 Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 13 Aug 2017 19:27:41 +1000 Subject: Clean up autows --- state.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'state.go') diff --git a/state.go b/state.go index e567777..1b7e9f2 100644 --- a/state.go +++ b/state.go @@ -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) { -- cgit v1.2.3