requireNoNewlines(tag, tagLine); return new Accumulator(_comp, false) { @Override public Template.Segment[] finish () { requireNoNewlines(tag, tagLine); return new Accumulator(_comp, false) { @Override public Template.Segment[] finish () { requireNoNewlines(tag, tagLine); return addCloseSectionSegment(tag1, tagLine); requireNoNewlines(tag, tagLine); _segs.add(new VariableSegment(tag1, tagLine, _comp.formatter, Escapers.NONE)); return this; requireNoNewlines(tag, tagLine); _segs.add(new VariableSegment(tag, tagLine, _comp.formatter, _comp.escaper)); return this;
accum.addTextSegment(text); state = TAG; } else { accum.addTextSegment(text); tagStartColumn = column; if (delims.start2 == NO_CHAR) { accum.addTextSegment(text); state = TAG; } else { delims.updateDelims(text.substring(1, text.length()-1)); text.setLength(0); accum.addFauxSegment(); // for newline trimming } else { accum = accum.addTagSegment(text, line);
@Override protected Accumulator addCloseSectionSegment (String itag, int line) { requireSameName(tag1, itag, line); outer._segs.add(new InvertedSegment(_comp, itag, super.finish(), tagLine)); return outer; } };
accum.addTextSegment(text); state = TAG; } else { accum.addTextSegment(text); tagStartColumn = column; if (delims.start2 == NO_CHAR) { accum.addTextSegment(text); state = TAG; } else { delims.updateDelims(text.substring(1, text.length()-1)); text.setLength(0); accum.addFauxSegment(); // for newline trimming } else { accum = accum.addTagSegment(text, line);
requireNoNewlines(tag, tagLine); return new Accumulator(_comp, false) { @Override public Template.Segment[] finish () { requireNoNewlines(tag, tagLine); return new Accumulator(_comp, false) { @Override public Template.Segment[] finish () { requireNoNewlines(tag, tagLine); return addCloseSectionSegment(tag1, tagLine); requireNoNewlines(tag, tagLine); _segs.add(new VariableSegment(tag1, tagLine, _comp.formatter, Escapers.NONE)); return this; requireNoNewlines(tag, tagLine); _segs.add(new VariableSegment(tag, tagLine, _comp.formatter, _comp.escaper)); return this;
break; accum.addTextSegment(text);
public Parser (Compiler compiler) { this.accum = new Accumulator(compiler, true); this.delims = compiler.delims.copy(); }
@Override protected Accumulator addCloseSectionSegment (String itag, int line) { requireSameName(tag1, itag, line); outer._segs.add(new InvertedSegment(_comp, itag, super.finish(), tagLine)); return outer; } };
@Override protected Accumulator addCloseSectionSegment (String itag, int line) { requireSameName(tag1, itag, line); outer._segs.add(new SectionSegment(_comp, itag, super.finish(), tagLine)); return outer; } };
/** * Compiles the supplied template into a repeatedly executable intermediate form. */ protected static Template compile (Reader source, Compiler compiler) { Accumulator accum = new Parser(compiler).parse(source); return new Template(trim(accum.finish(), true), compiler); }
break; accum.addTextSegment(text);
@Override protected Accumulator addCloseSectionSegment (String itag, int line) { requireSameName(tag1, itag, line); outer._segs.add(new SectionSegment(_comp, itag, super.finish(), tagLine)); return outer; } };
/** * Compiles the supplied template into a repeatedly executable intermediate form. */ protected static Template compile (Reader source, Compiler compiler) { Accumulator accum = new Parser(compiler).parse(source); return new Template(trim(accum.finish(), true), compiler); }
public Parser (Compiler compiler) { this.accum = new Accumulator(compiler, true); this.delims = compiler.delims.copy(); }