Exemple #1
0
 public CallTemplate(string className, string methodName, string[] args, CodeTemplate template)
 {
     this.className  = className;
     this.methodName = methodName;
     this.args       = args;
     this.template   = template;
 }
Exemple #2
0
        public void addExprTemplate(string exprStr, CodeTemplate tmpl)
        {
            var expr = new TypeScriptParser2(exprStr, null).parseExpression();

            if (expr is UnresolvedCallExpression unrCallExpr && unrCallExpr.func is PropertyAccessExpression propAccExpr && propAccExpr.object_ is Identifier ident)
            {
                var callTmpl = new CallTemplate(ident.text, propAccExpr.propertyName, unrCallExpr.args.map(x => (((Identifier)x)).text), tmpl);
                this.addMethod($"{callTmpl.className}.{callTmpl.methodName}@{callTmpl.args.length()}", callTmpl);
            }
Exemple #3
0
 public FieldAccessTemplate(string className, string fieldName, CodeTemplate template)
 {
     this.className = className;
     this.fieldName = fieldName;
     this.template  = template;
 }