Open AndreVanDelft opened 10 years ago
Can you please specify more precisely where does it not work? As I can see, matching on T_n_ary_op works perfectly on line 339 of ScriptExecutor.scala.
E.g. here, a T_1_aryop is matched by "case ":
def kindAsString(t: TemplateNode): String =
t match {
// matching on T_n_ary_op (and T_1_ary_op) does not work;
// therefore FTTB those classes have their own implementation of kindAsString
case T_1_ary_op(kind: String, _) => kind
case T_n_ary_op(kind: String, _) => kind
case T_code_normal (_) => "{}"
...
case _ => getClass.getName
}
So what is the problem?
The match
case T_n_ary_op(kind: String, _) =>
won't work, 'cause second argument is vararg. Varargs should be matched as follows:
case T_n_ary_op(kind: String, _*) =>
I'll try to get rid of auxiliary "kind" methods a bit later.
TemplateNode: matching on T_n_ary_op (and T_1_ary_op) does not work; therefore FTTB those classes have their own implementation of kindAsString (see the comments in the file)