Пример #1
0
 private void FetchLookahead()
 {
     _lookahead = new TokenWithSpan(_tokenizer.GetNextToken(), _tokenizer.TokenSpan);
     _lookaheadWhiteSpace = _tokenizer.PreceedingWhiteSpace;
 }
Пример #2
0
 private void CheckSuiteEofError(TokenWithSpan cur)
 {
     if (MaybeEatEof()) {
         // for interactive parsing we allow the user to continue in this case
         ReportSyntaxError(_lookahead.Token, cur.Span, ErrorCodes.SyntaxError, true);
     }
 }
Пример #3
0
 private void ReportSyntaxError(TokenWithSpan t, int errorCode)
 {
     ReportSyntaxError(t.Token, t.Span, errorCode, true);
 }
Пример #4
0
 private void ReportSyntaxError(TokenWithSpan t)
 {
     ReportSyntaxError(t, ErrorCodes.SyntaxError);
 }
Пример #5
0
        public void Reset(FutureOptions languageFeatures)
        {
            _languageFeatures = languageFeatures;
            _token = new TokenWithSpan();
            _lookahead = new TokenWithSpan();
            _fromFutureAllowed = true;
            _classDepth = 0;
            _functions = null;
            _privatePrefix = null;

            _parsingStarted = false;
            _errorCode = 0;
        }
Пример #6
0
 private Token NextToken()
 {
     _token = _lookahead;
     _tokenWhiteSpace = _lookaheadWhiteSpace;
     FetchLookahead();
     return _token.Token;
 }