Commit 3a87a25c authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

fix state changes in `requires' elements support flags and use name

2007-10-19  Juerg Billeter  <j@bitron.ch>

	* gobject-introspection/gidlparser.c: fix state changes in `requires'
	  elements
	* vapigen/valagidlparser.vala: support flags and use name attribute
	  of object elements

svn path=/trunk/; revision=657
parent 65c666cf
2007-10-19 Jürg Billeter <j@bitron.ch>
* gobject-introspection/gidlparser.c: fix state changes in `requires'
elements
* vapigen/valagidlparser.vala: support flags and use name attribute
of object elements
2007-10-19 Jürg Billeter <j@bitron.ch>
* vala/valaenum.vala: support Flags attribute
......
......@@ -1945,7 +1945,8 @@ end_element_handler (GMarkupParseContext *context,
ctx->state = STATE_OBJECT;
break;
case STATE_REQUIRES:
ctx->state = STATE_INTERFACE;
if (strcmp (element_name, "requires") == 0)
ctx->state = STATE_INTERFACE;
break;
case STATE_PARAMETERS:
if (strcmp (element_name, "parameters") == 0)
......
......@@ -235,6 +235,12 @@ public class Vala.GIdlParser : CodeVisitor {
en.name = fix_type_name (en.name, ns);
ns.add_enum (en);
current_source_file.add_node (en);
} else if (node.type == IdlNodeTypeId.FLAGS) {
var en = parse_enum ((IdlNodeEnum) node);
en.name = fix_type_name (en.name, ns);
en.is_flags = true;
ns.add_enum (en);
current_source_file.add_node (en);
} else if (node.type == IdlNodeTypeId.OBJECT) {
parse_object ((IdlNodeInterface) node, ns, module);
} else if (node.type == IdlNodeTypeId.INTERFACE) {
......@@ -580,7 +586,7 @@ public class Vala.GIdlParser : CodeVisitor {
}
private void parse_object (IdlNodeInterface! node, Namespace! ns, IdlModule! module) {
string name = fix_type_name (node.gtype_name, ns);
string name = fix_type_name (((IdlNode) node).name, ns);
string base_class = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment