diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-10-26 16:10:37 +0100 |
commit | 1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5 (patch) | |
tree | 7f82f8eed0a1590ecbb830d575ee0f092a2e433e /vala/valaparser.vala | |
parent | 545121d1322d3f73880b3f14d86d3d7bd976e664 (diff) | |
download | vala-1d78426a2b172f0b0ba2f04d1f5c51ad75c82ef5.tar.gz |
vala: Make use of new printf-like API of Report.*()
Diffstat (limited to 'vala/valaparser.vala')
-rw-r--r-- | vala/valaparser.vala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 74cf0f2f4..fc130c7cb 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -134,7 +134,7 @@ public class Vala.Parser : CodeVisitor { void report_parse_error (ParseError e) { var begin = get_location (); next (); - Report.error (get_src (begin), "syntax error, " + e.message); + Report.error (get_src (begin), "syntax error, %s", e.message); } inline bool expect (TokenType type) throws ParseError { @@ -1646,12 +1646,12 @@ public class Vala.Parser : CodeVisitor { try { rollback (begin); stmt = parse_expression_statement (); - Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'".printf (token, token)); + Report.warning (get_src (begin), "`%s' is a syntax keyword, replace with `@%s'", token, token); } catch (ParseError e2) { var e2_begin = get_location (); rollback (e_begin); next (); - Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s".printf (token, e.message)); + Report.error (get_src (e_begin), "Possible `%s-statement' syntax error, %s", token, e.message); rollback (e2_begin); throw e2; } @@ -1863,7 +1863,7 @@ public class Vala.Parser : CodeVisitor { switch (current ()) { case TokenType.SEMICOLON: if (!accept_empty_body) { - Report.warning (get_current_src (), "%s-statement without body".printf (statement_name)); + Report.warning (get_current_src (), "%s-statement without body", statement_name); } return parse_empty_statement (); case TokenType.IF: @@ -2436,7 +2436,7 @@ public class Vala.Parser : CodeVisitor { if (attributes != null) { foreach (Attribute attr in (List<Attribute>) attributes) { if (node.get_attribute (attr.name) != null) { - Report.error (attr.source_reference, "duplicate attribute `%s'".printf (attr.name)); + Report.error (attr.source_reference, "duplicate attribute `%s'", attr.name); } node.attributes.append (attr); } |