[vala/wip/gtkgir: 11/12] girparser: Avoid fatal handling of nameless unions
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/gtkgir: 11/12] girparser: Avoid fatal handling of nameless unions
- Date: Wed, 31 Aug 2016 07:59:43 +0000 (UTC)
commit f20a5596f9ee2d120ed189164618134da8058f10
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Jan 31 22:25:16 2016 +0100
girparser: Avoid fatal handling of nameless unions
vala/valagirparser.vala | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 159ce9f..f81de71 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3300,7 +3300,33 @@ public class Vala.GirParser : CodeVisitor {
void parse_union () {
start_element ("union");
- push_node (element_get_name (), true);
+
+ string? element_name = element_get_name ();
+ if (element_name == null) {
+ next ();
+
+ while (current_token == MarkupTokenType.START_ELEMENT) {
+ if (!push_metadata ()) {
+ skip_element ();
+ continue;
+ }
+
+ if (reader.name == "field") {
+ parse_field ();
+ } else {
+ // error
+ Report.error (get_current_src (), "unknown child element `%s' in
`transparent union'".printf (reader.name));
+ skip_element ();
+ }
+
+ pop_metadata ();
+ }
+
+ end_element ("union");
+ return;
+ }
+
+ push_node (element_name, true);
Struct st;
if (current.new_symbol) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]