// public bool MoveNextIgnoreWhiteSpace() // { // _index+=Configuration.JumpWhiteSpace(_index); // return MoveNext(); // } private void InternalMoveNext() { DetermineState(); switch (_state) { case TokenizerState.Seperator: HandleSeperator(); break; case TokenizerState.Literal: if (_configuration.ReturnLiterals) { HandeLiteral(); } else { HandeNormal(); } break; case TokenizerState.Normal: HandeNormal(); break; default: throw TokenException.IllegalStateAt( CurrentChar(), _index, _state).Decorate(_current); } }
private void GuardEndState() { if (!HasNext() && _state != TokenizerState.Normal) { TokenException.IllegalStateAtEnd(_index, _state); } }
private char Read(Is isMethod) { if (!isMethod()) { throw TokenException.Expected(isMethod, _index).Decorate(_current); } return(NextChar()); }
private void ThrowUnClosedLiteral(int start) { throw TokenException.UnTerminatedLiteral(start + 1).Decorate( new Token(TokenType.Literal, _template[start].ToString(), start, _template, _offSet ) ); }
private void ThrowExpectedMoreCharacters() { throw TokenException.MoreCharactersExpectedAt(_index).Decorate( _current ?? new Token(TokenType.NotSet, _template[_index - 1].ToString(), _index - 1, _template, _offSet ) ); }