This stringifies and concatenates all arguments you pass to the method.
write_indent ();
write_string ("[ScanfFormat]");
}
+ if (m.get_attribute ("Print") != null) {
+ write_indent ();
+ write_string ("[Print]");
+ }
emit_deprecated_attribute (m);
}
}
+ // concatenate stringified arguments for methods with attribute [Print]
+ if (mtype is MethodType && ((MethodType) mtype).method_symbol.get_attribute ("Print") != null) {
+ var template = new Template (source_reference);
+ foreach (Expression arg in argument_list) {
+ arg.parent_node = null;
+ template.add_expression (arg);
+ }
+ argument_list.clear ();
+ add_argument (template);
+ }
+
// printf arguments
if (mtype is MethodType && ((MethodType) mtype).method_symbol.printf_format) {
StringLiteral format_literal = null;
/* valatemplate.vala
*
- * Copyright (C) 2009 Jürg Billeter
+ * Copyright (C) 2009-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
public class Vala.Template : Expression {
private List<Expression> expression_list = new ArrayList<Expression> ();
- public Template () {
+ public Template (SourceReference? source_reference = null) {
+ this.source_reference = source_reference;
}
public override void accept (CodeVisitor visitor) {