title: why does pushMode require the consumption of input?
body: <p>I have the following antlr4 lexer grammar with the goal to produce a token STRING_MODE from a string if the string doesn't start with '-'.</p>
  
  <p>I am using the <a href="https://github.com/sharwell/antlr4/blob/84087334d80af684582c9bbb233b62b3efc68183/tool/test/org/antlr/v4/test/PositionAdjustingLexer.g4" rel="nofollow">testAssertion code</a> to implement a look ahead test.</p>
  
  <p>Since I would like to add a lot more code to the lexer for strings itself and would like to add other prefixes than just '-' where different rules apply, i would like to immediately push a mode and continue the lexing there.</p>
  
  <pre><code>lexer grammar StrStrLexer;
  
  @members {
    public boolean testAssertion(int assertionMode, int passingRule) {
    int index = _input.index();
    int mark = _input.mark();
    try {
       LexerATNSimulator interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
       interp.copyState(_interp);
       int result = interp.match(_input, assertionMode);
       return result == passingRule;
     } finally {
       _input.seek(index);
       _input.release(mark);
     }
  }
  
  DETECT  : { testAssertion(DETECT_STRING,DETECT_STRING_PASS) }? -&gt;
                     pushMode(STRING);
  
  mode DETECT_STRING;
  
  DETECT_STRING_PASS: ~[-];
  DETECT_STRING_FAIL: .;
  
  mode STRING;
  
  STRING_MODE  : .+;
  </code></pre>
  
  <p>With this grammar receive for each input character error messages like:</p>
  
  <pre><code>token recognition error at: 'X'
  </code></pre>
  
  <p>If I rewrite the grammar and remove the pushMode it works fine:</p>
  
  <pre><code>lexer grammar StrStrLexer;
  
  @members {
    public boolean testAssertion(int assertionMode, int passingRule) {
    int index = _input.index();
    int mark = _input.mark();
    try {
       LexerATNSimulator interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
       interp.copyState(_interp);
       int result = interp.match(_input, assertionMode);
       return result == passingRule;
     } finally {
       _input.seek(index);
       _input.release(mark);
     }
  }
  
  STRING_MODE  : { testAssertion(DETECT_STRING,DETECT_STRING_PASS) }? .+;
  
  mode DETECT_STRING;
  
  DETECT_STRING_PASS: ~[-];
  DETECT_STRING_FAIL: .;
  </code></pre>