private Node parseBlockExpansion(){ if (this.peek() instanceof Colon) { this.advance(); BlockNode blockNode = new BlockNode(); blockNode.push(this.parseExpr()); return blockNode; } else { return this.block(); } }
public Node parse() { BlockNode block = new BlockNode(); block.setLineNumber(lexer.getLineno()); block.setFileName(filename); while (!(peek() instanceof Eos)) { if (peek() instanceof Newline) { advance(); } else { Node expr = parseExpr(); if (expr != null) { block.push(expr); } } } if (extending != null) { getContexts().push(extending); Node rootNode = extending.parse(); getContexts().pop(); // hoist mixins Set<String> keySet = this.mixins.keySet(); for (String name : keySet) { rootNode.getNodes().push(this.mixins.get(name)); } return rootNode; } return block; }
LiteralNode node = new LiteralNode(); node.setValue(""); blockNode.push(node);
private Node parseText() { Token tok = expect(Text.class); Node[] tokens = this.parseInlineTagsInText(tok.getValue()); if (tokens.length == 1) return tokens[0]; BlockNode node = new BlockNode(); for (int i = 0; i < tokens.length; i++) { node.push(tokens[i]); } node.setValue(tok.getValue()); node.setLineNumber(tok.getLineNumber()); node.setFileName(filename); return node; }
ast.setFileName(path); if (peek() instanceof Indent && ast != null) { ((BlockNode) ast).getIncludeBlock().push(block());
private BlockNode block() { BlockNode block = new BlockNode(); block.setLineNumber(lexer.getLineno()); block.setFileName(filename); expect(Indent.class); while (!(peek() instanceof Outdent)) { if (peek() instanceof Newline) { advance(); } else { Node parseExpr = this.parseExpr(); parseExpr.setFileName(filename); if (parseExpr != null) { block.push(parseExpr); } } } expect(Outdent.class); return block; }
block.setLineNumber(next.getLineNumber()); block.setFileName(filename); block.push(parseExpr()); tagNode.setBlock(block);
private Node parseBlockExpansion(){ if (this.peek() instanceof Colon) { this.advance(); BlockNode blockNode = new BlockNode(); blockNode.push(this.parseExpr()); return blockNode; } else { return this.block(); } }
public Node parse() { BlockNode block = new BlockNode(); block.setLineNumber(lexer.getLineno()); block.setFileName(filename); while (!(peek() instanceof Eos)) { if (peek() instanceof Newline) { advance(); } else { Node expr = parseExpr(); if (expr != null) { block.push(expr); } } } if (extending != null) { getContexts().push(extending); Node rootNode = extending.parse(); getContexts().pop(); // hoist mixins Set<String> keySet = this.mixins.keySet(); for (String name : keySet) { rootNode.getNodes().push(this.mixins.get(name)); } return rootNode; } return block; }
LiteralNode node = new LiteralNode(); node.setValue(""); blockNode.push(node);
private Node parseText() { Token tok = expect(Text.class); Node[] tokens = this.parseInlineTagsInText(tok.getValue()); if (tokens.length == 1) return tokens[0]; BlockNode node = new BlockNode(); for (int i = 0; i < tokens.length; i++) { node.push(tokens[i]); } node.setValue(tok.getValue()); node.setLineNumber(tok.getLineNumber()); node.setFileName(filename); return node; }
ast.setFileName(path); if (peek() instanceof Indent && ast != null) { ((BlockNode) ast).getIncludeBlock().push(block());
private BlockNode block() { BlockNode block = new BlockNode(); block.setLineNumber(lexer.getLineno()); block.setFileName(filename); expect(Indent.class); while (!(peek() instanceof Outdent)) { if (peek() instanceof Newline) { advance(); } else { Node parseExpr = this.parseExpr(); parseExpr.setFileName(filename); if (parseExpr != null) { block.push(parseExpr); } } } expect(Outdent.class); return block; }
block.setLineNumber(next.getLineNumber()); block.setFileName(filename); block.push(parseExpr()); tagNode.setBlock(block);