ParserContext { public boolean isEndOfFile() { return terminated || source.peek() == -1; } ParserContext(@Nonnull final ITextDocument source, @Nonnull final ParserBase codeParser,
                         @Nonnull final ParserBase markupParser, @Nonnull final ParserBase activeParser
                        ); ParserBase getActiveParser(); ParserBase getMarkupParser(); ParserBase getCodeParser(); List<RazorError> getErrors(); TextDocumentReader getSource(); BlockBuilder getCurrentBlock(); Span getLastSpan(); boolean isWhiteSpaceIsSignificantToAncestorBlock(); void setWhiteSpaceIsSignificantToAncestorBlock(final boolean whiteSpaceIsSignificantToAncestorBlock); boolean isDesignTimeMode(); void setDesignTimeMode(final boolean designTimeMode); EnumSet<AcceptedCharacters> getLastAcceptedCharacters(); Deque<BlockBuilder> getBlockStack(); char getCurrentCharacter(); boolean isEndOfFile(); void addSpan(@Nonnull final Span span); IDisposable startBlock(@Nonnull final BlockType blockType); IDisposable startBlock(); void endBlock(); boolean isWithin(@Nonnull final BlockType type); void switchActiveParser(); void onError(@Nonnull final SourceLocation location, @Nonnull final String message); void onError(@Nonnull final SourceLocation location, @Nonnull final String message, @Nonnull Object... args
                       ); ParserResults completeParse();  }
@Test public void endOfFileReturnsFalseIfTextBufferNotAtEOF() { final ParserContext context = setupTestContext("bar"); assertFalse(context.isEndOfFile()); }
@Test public void endOfFileReturnsTrueIfTextBufferAtEOF() { final ParserContext context = setupTestContext( "bar", input -> { assert input != null; input.readToEnd(); } ); assertTrue(context.isEndOfFile()); }