public SourceSpan(SourceLocation start, int length) { Start = start; Length = length; }
public static TokenAst CreateSyntaxErrorToken(CompilerContext context, SourceLocation location, string message, params object[] args) { if (args != null && args.Length > 0) message = string.Format(message, args); return TokenAst.Create(Grammar.SyntaxError, context, location, message); }
public void AddError(SourceLocation location, string message, ParserState state) { Errors.Add(new SyntaxError(location, message, state)); }
public SyntaxError(SourceLocation location, string message, ParserState state) { Location = location; Message = message; State = state; }
private void ReportError(SourceLocation location, string message, params object[] args) { if (args != null && args.Length > 0) message = string.Format(message, args); _context.AddError(location, message, _currentState); }