Search in sources :

Example 1 with Hash_map_entry_listContext

use of jetbrick.template.parser.grammer.JetTemplateParser.Hash_map_entry_listContext in project jetbrick-template-1x by subchen.

the class JetTemplateCodeVisitor method visitExpr_hash_map.

@Override
public Code visitExpr_hash_map(Expr_hash_mapContext ctx) {
    String source = "Collections.EMPTY_MAP";
    Hash_map_entry_listContext hash_map_entry_list = ctx.hash_map_entry_list();
    if (hash_map_entry_list != null) {
        Code code = hash_map_entry_list.accept(this);
        source = "JetUtils.asMap(" + code.toString() + ")";
    }
    return new SegmentCode(Map.class, source, ctx);
}
Also used : Hash_map_entry_listContext(jetbrick.template.parser.grammer.JetTemplateParser.Hash_map_entry_listContext) SegmentCode(jetbrick.template.parser.code.SegmentCode) ScopeCode(jetbrick.template.parser.code.ScopeCode) BlockCode(jetbrick.template.parser.code.BlockCode) SegmentListCode(jetbrick.template.parser.code.SegmentListCode) TemplateClassCode(jetbrick.template.parser.code.TemplateClassCode) TextCode(jetbrick.template.parser.code.TextCode) ForExpressionCode(jetbrick.template.parser.code.ForExpressionCode) SegmentCode(jetbrick.template.parser.code.SegmentCode) MacroCode(jetbrick.template.parser.code.MacroCode) Code(jetbrick.template.parser.code.Code) DefineExpressionCode(jetbrick.template.parser.code.DefineExpressionCode) TagCode(jetbrick.template.parser.code.TagCode)

Aggregations

BlockCode (jetbrick.template.parser.code.BlockCode)1 Code (jetbrick.template.parser.code.Code)1 DefineExpressionCode (jetbrick.template.parser.code.DefineExpressionCode)1 ForExpressionCode (jetbrick.template.parser.code.ForExpressionCode)1 MacroCode (jetbrick.template.parser.code.MacroCode)1 ScopeCode (jetbrick.template.parser.code.ScopeCode)1 SegmentCode (jetbrick.template.parser.code.SegmentCode)1 SegmentListCode (jetbrick.template.parser.code.SegmentListCode)1 TagCode (jetbrick.template.parser.code.TagCode)1 TemplateClassCode (jetbrick.template.parser.code.TemplateClassCode)1 TextCode (jetbrick.template.parser.code.TextCode)1 Hash_map_entry_listContext (jetbrick.template.parser.grammer.JetTemplateParser.Hash_map_entry_listContext)1