/// <summary> /// Initializes a new instance of the <see cref="ParserContext"/> class. /// </summary> /// <param name="source">The source.</param> /// <param name="parser">The parser.</param> /// <param name="errorSink">The error sink.</param> /// <param name="providers">The set of tag providers.</param> public ParserContext(ITextDocument source, ParserBase parser, ParserErrorSink errorSink, TagProvidersCollection providers) { Source = new TextDocumentReader(source); Parser = parser; _errorSink = errorSink; TagProviders = providers; }
public ParserContext(ITextDocument source, ParserBase codeParser, ParserBase markupParser, ParserBase activeParser) { if (source == null) { throw new ArgumentNullException("source"); } if (codeParser == null) { throw new ArgumentNullException("codeParser"); } if (markupParser == null) { throw new ArgumentNullException("markupParser"); } if (activeParser == null) { throw new ArgumentNullException("activeParser"); } if (activeParser != codeParser && activeParser != markupParser) { throw new ArgumentException(RazorResources.ActiveParser_Must_Be_Code_Or_Markup_Parser, "activeParser"); } CaptureOwnerTask(); Source = new TextDocumentReader(source); CodeParser = codeParser; MarkupParser = markupParser; ActiveParser = activeParser; Errors = new List <RazorError>(); }
public void TextDocumentReader_Integration_ReadLine_EmptyThrowsException() { using (var rdr = new TextDocumentReader(baseDir + "empty.txt")) { var line = rdr.ReadLine(); } }
protected Tokenizer([NotNull] ITextDocument source) { Source = new TextDocumentReader(source); Buffer = new StringBuilder(); CurrentErrors = new List <RazorError>(); StartSymbol(); }
public void TextDocumentReader_Integration_ReadLine_ReturnsLine() { using (var rdr = new TextDocumentReader(baseDir + "resume.txt")) { var line = rdr.ReadLine(); Assert.IsNotNull(line); } }
protected Tokenizer(ITextDocument source) { if (source == null) { throw new ArgumentNullException("source"); } Source = new TextDocumentReader(source); Buffer = new StringBuilder(); CurrentErrors = new List <RazorError>(); StartSymbol(); }
public ParserContext(ITextDocument source, ParserBase codeParser, ParserBase markupParser, ParserBase activeParser, ErrorSink errorSink) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (codeParser == null) { throw new ArgumentNullException(nameof(codeParser)); } if (markupParser == null) { throw new ArgumentNullException(nameof(markupParser)); } if (activeParser == null) { throw new ArgumentNullException(nameof(activeParser)); } if (errorSink == null) { throw new ArgumentNullException(nameof(errorSink)); } if (activeParser != codeParser && activeParser != markupParser) { throw new ArgumentException(RazorResources.ActiveParser_Must_Be_Code_Or_Markup_Parser, nameof(activeParser)); } CaptureOwnerTask(); Source = new TextDocumentReader(source); CodeParser = codeParser; MarkupParser = markupParser; ActiveParser = activeParser; _errorSink = errorSink; }
public ParserContext([NotNull] ITextDocument source, [NotNull] ParserBase codeParser, [NotNull] ParserBase markupParser, [NotNull] ParserBase activeParser, [NotNull] ParserErrorSink errorSink) { if (activeParser != codeParser && activeParser != markupParser) { throw new ArgumentException(RazorResources.ActiveParser_Must_Be_Code_Or_Markup_Parser, "activeParser"); } CaptureOwnerTask(); Source = new TextDocumentReader(source); CodeParser = codeParser; MarkupParser = markupParser; ActiveParser = activeParser; _errorSink = errorSink; }
public void TextDocumentReader_Integration_Ctor_BadPathException() { var rdr = new TextDocumentReader("asdfasd"); rdr.Dispose(); }