private void FetchLookahead() { _lookahead = new TokenWithSpan(_tokenizer.GetNextToken(), _tokenizer.TokenSpan); }
private Token NextToken() { _token = _lookahead; FetchLookahead(); return _token.Token; }
private void ReportSyntaxError(TokenWithSpan t, int errorCode) { ReportSyntaxError(t.Token, t.Span, errorCode, true); }
private void ReportSyntaxError(TokenWithSpan t) { ReportSyntaxError(t, ErrorCodes.SyntaxError); }
public void Reset(SourceUnit sourceUnit, ModuleOptions languageFeatures) { ContractUtils.RequiresNotNull(sourceUnit, "sourceUnit"); _sourceUnit = sourceUnit; _languageFeatures = languageFeatures; _token = new TokenWithSpan(); _lookahead = new TokenWithSpan(); _fromFutureAllowed = true; _functions = null; _privatePrefix = null; _parsingStarted = false; _errorCode = 0; }
private void CheckSuiteEofError(TokenWithSpan cur) { if (MaybeEat(TokenKind.EndOfFile)) { // for interactive parsing we allow the user to continue in this case ReportSyntaxError(_lookahead.Token, cur.Span, ErrorCodes.SyntaxError, true); } }