while ( ( line = source.getNextLine() ) != null ) throw new ParseException( "Line number not handle : " + source.getLineNumber() + ": " + line );
String name = source.getName(); if ( name != null )
source.ungetLine(); break; while ( ( line = source.getNextLine() ) != null );
/** {@inheritDoc} */ public Block visit( String line, ByLineSource source ) throws ParseException { StringBuilder text = new StringBuilder(); while ( ( line = source.getNextLine() ) != null ) { if ( line.startsWith( "{code}" ) || line.startsWith( "{noformat}" ) ) { break; } // TODO text.append( line ).append( LS ); } return new VerbatimBlock( text.toString() ); } }
@Override public synchronized void parse( Reader source, Sink sink, String reference ) throws ParseException { ByLineSource src = new ByLineReaderSource( source, reference ); try { List<Block> blocks = parse( src ); sink.head(); sink.head_(); sink.body(); for ( Block block : blocks ) { block.traverse( sink ); } sink.body_(); } catch ( Exception e ) { // TODO handle column number throw new ParseException( e, src.getName(), src.getLineNumber(), -1 ); } finally { setSecondParsing( false ); init(); } }
/** * {@inheritDoc} */ public final Block visit( final String line, final ByLineSource source ) throws ParseException { Block ret = new HorizontalRuleBlock(); final Matcher matcher = HRULE_PATTERN.matcher( line ); if ( matcher.lookingAt() ) { final int textGroup = 3; source.unget( matcher.group( textGroup ) ); } else { throw new ParseException( "i was expecting a hruler!" ); } return ret; } }
while ( ( line = source.getNextLine() ) != null )
throw new ParseException( e, src.getName(), src.getLineNumber(), -1 );
while ( ( l = source.getNextLine() ) != null ); source.ungetLine();
final ArrayList<Block> blocks = new ArrayList<Block>(); while ( ( newLine = source.getNextLine() ) != null && !accept( newLine ) ) source.ungetLine();
line = source.getNextLine(); while ( ( line = source.getNextLine() ) != null )
l = source.getNextLine(); source.ungetLine();
while ( ( line = source.getNextLine() ) != null )
while ( ( line = source.getNextLine() ) != null );
while ( ( l = source.getNextLine() ) != null && accept( l ) );
while ( ( l = source.getNextLine() ) != null && accept( l, source ) );