+2006-12-10 Jürg Billeter <j@bitron.ch>
+
+ * vapi/glib-2.0.vala: add message logging functions
+ * vala/valasemanticanalyzer.vala: support enum to int conversions and
+ diagnostic methods
+ * vala/valacodegenerator.vala: support do statements
+
2006-11-24 Jürg Billeter <j@bitron.ch>
* vala/valacodegenerator.vala: fix generating switch statements
create_temp_decl (stmt, stmt.condition.temp_vars);
}
+ public override void visit_do_statement (DoStatement! stmt) {
+ stmt.ccodenode = new CCodeDoStatement ((CCodeStatement) stmt.body.ccodenode, (CCodeExpression) stmt.condition.ccodenode);
+
+ create_temp_decl (stmt, stmt.condition.temp_vars);
+ }
+
public override void visit_for_statement (ForStatement! stmt) {
var cfor = new CCodeForStatement ((CCodeExpression) stmt.condition.ccodenode, (CCodeStatement) stmt.body.ccodenode);
return false;
}
+ if (expression_type.data_type is Enum && expected_type.data_type == int_type.data_type) {
+ return true;
+ }
+
if (expression_type.data_type == expected_type.data_type) {
return true;
}
}
private bool check_arguments (Expression! expr, Symbol! msym, List<FormalParameter> params, List<Expression> args) {
+ List prev_arg_it = null;
List arg_it = args;
+ bool diag = (msym.node.get_attribute ("Diagnostics") != null);
+
bool ellipsis = false;
int i = 0;
foreach (FormalParameter param in params) {
return false;
}
+ prev_arg_it = arg_it;
arg_it = arg_it.next;
i++;
return false;
}
+ if (diag && prev_arg_it != null) {
+ var format_arg = (Expression) prev_arg_it.data;
+ if (format_arg is LiteralExpression) {
+ var format_lit = (StringLiteral) ((LiteralExpression) format_arg).literal;
+ format_lit.value = "\"%s:%d: %s".printf (expr.source_reference.file.filename, expr.source_reference.first_line, format_lit.value.offset (1));
+ }
+ }
+
return true;
}
foreach (TypeReference type_arg in type_args) {
expr.type_reference.add_type_argument (type_arg);
}
+ } else {
+ type = expr.type_reference.data_type;
}
if (!type.is_reference_type ()) {
public bool isalnum ();
[CCode (cname = "g_unichar_isdigit")]
public bool isdigit ();
+ [CCode (cname = "g_unichar_isspace")]
+ public bool isspace ();
[CCode (cname = "g_unichar_isupper")]
public bool isupper ();
[CCode (cname = "g_unichar_isxdigit")]
public static void return_if_fail (bool expr);
public static void assert (bool expr);
public static void assert_not_reached ();
+
+ /* Message Logging */
+
+ [CCode (cprefix = "G_LOG_")]
+ public enum LogLevelFlags {
+ /* log flags */
+ FLAG_RECURSION,
+ FLAG_FATAL,
+
+ /* GLib log levels */
+ LEVEL_ERROR,
+ LEVEL_CRITICAL,
+ LEVEL_WARNING,
+ LEVEL_MESSAGE,
+ LEVEL_INFO,
+ LEVEL_DEBUG,
+
+ LEVEL_MASK
+ }
+
+ [Diagnostics ()]
+ public void log (string log_domain, LogLevelFlags log_level, string format, ...);
+
+ [Diagnostics ()]
+ public void message (string format, ...);
+ [Diagnostics ()]
+ public void warning (string format, ...);
+ [Diagnostics ()]
+ public void critical (string format, ...);
+ [Diagnostics ()]
+ public void error (string format, ...);
+ [Diagnostics ()]
+ public void debug (string format, ...);
/* Character Set Conversions */