diff --git a/.berel.yml b/.berel.yml index 047f4bf..71e5a9e 100644 --- a/.berel.yml +++ b/.berel.yml @@ -4,7 +4,7 @@ !v!Pluie.Berel.Meta meta : keys : software : pluie-yaml; - version : 0.55 + version : 0.56 type : library date : 2018 license : GPLv3.0; diff --git a/build.sh b/build.sh index fcf5cc5..caa5d59 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ #^# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @software : pluie-yaml -# @version : 0.55 +# @version : 0.56 # @type : library # @date : 2018 # @license : GPLv3.0 diff --git a/meson.build b/meson.build index 9c5afee..1e57ce7 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ #^# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @software : pluie-yaml -# @version : 0.55 +# @version : 0.56 # @type : library # @date : 2018 # @license : GPLv3.0 diff --git a/src/c/yaml.c b/src/c/yaml.c index fe9cc46..43b8b3e 100644 --- a/src/c/yaml.c +++ b/src/c/yaml.c @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/install.vala b/src/install.vala index d19912f..47f8092 100644 --- a/src/install.vala +++ b/src/install.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/meson.build b/src/meson.build index 23ad782..85d2b7a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,7 +1,7 @@ #^# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @software : pluie-yaml -# @version : 0.55 +# @version : 0.56 # @type : library # @date : 2018 # @license : GPLv3.0 diff --git a/src/vala/Pluie/Io.InputChunkStream.vala b/src/vala/Pluie/Io.InputChunkStream.vala index 284b302..f156032 100644 --- a/src/vala/Pluie/Io.InputChunkStream.vala +++ b/src/vala/Pluie/Io.InputChunkStream.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Io.Reader.vala b/src/vala/Pluie/Io.Reader.vala index bc90694..792ac92 100644 --- a/src/vala/Pluie/Io.Reader.vala +++ b/src/vala/Pluie/Io.Reader.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Io.StreamLineMark.vala b/src/vala/Pluie/Io.StreamLineMark.vala index 93ac930..13742a5 100644 --- a/src/vala/Pluie/Io.StreamLineMark.vala +++ b/src/vala/Pluie/Io.StreamLineMark.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Io.Writter.vala b/src/vala/Pluie/Io.Writter.vala index 6f737b1..a40da28 100644 --- a/src/vala/Pluie/Io.Writter.vala +++ b/src/vala/Pluie/Io.Writter.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Samples.YamlChild.vala b/src/vala/Pluie/Samples.YamlChild.vala index 7c8bac7..9d5bee2 100644 --- a/src/vala/Pluie/Samples.YamlChild.vala +++ b/src/vala/Pluie/Samples.YamlChild.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Samples.YamlObject.vala b/src/vala/Pluie/Samples.YamlObject.vala index 7ad8ce1..ec4b711 100644 --- a/src/vala/Pluie/Samples.YamlObject.vala +++ b/src/vala/Pluie/Samples.YamlObject.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Samples.YamlStruct.vala b/src/vala/Pluie/Samples.YamlStruct.vala index 8ea64a3..73fac83 100644 --- a/src/vala/Pluie/Samples.YamlStruct.vala +++ b/src/vala/Pluie/Samples.YamlStruct.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.AbstractChild.vala b/src/vala/Pluie/Yaml.AbstractChild.vala index 35bcd6c..7648218 100644 --- a/src/vala/Pluie/Yaml.AbstractChild.vala +++ b/src/vala/Pluie/Yaml.AbstractChild.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.AbstractNode.vala b/src/vala/Pluie/Yaml.AbstractNode.vala index 4339b4f..b245fe6 100644 --- a/src/vala/Pluie/Yaml.AbstractNode.vala +++ b/src/vala/Pluie/Yaml.AbstractNode.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Builder.vala b/src/vala/Pluie/Yaml.Builder.vala index 192adf3..15afaa2 100644 --- a/src/vala/Pluie/Yaml.Builder.vala +++ b/src/vala/Pluie/Yaml.Builder.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Collection.vala b/src/vala/Pluie/Yaml.Collection.vala index ce80416..f090a53 100644 --- a/src/vala/Pluie/Yaml.Collection.vala +++ b/src/vala/Pluie/Yaml.Collection.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Config.vala b/src/vala/Pluie/Yaml.Config.vala index 0a21241..5e3f805 100644 --- a/src/vala/Pluie/Yaml.Config.vala +++ b/src/vala/Pluie/Yaml.Config.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Dumper.vala b/src/vala/Pluie/Yaml.Dumper.vala index d7d2419..b959118 100644 --- a/src/vala/Pluie/Yaml.Dumper.vala +++ b/src/vala/Pluie/Yaml.Dumper.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Event.vala b/src/vala/Pluie/Yaml.Event.vala index 4ffef6f..ef81400 100644 --- a/src/vala/Pluie/Yaml.Event.vala +++ b/src/vala/Pluie/Yaml.Event.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Finder.vala b/src/vala/Pluie/Yaml.Finder.vala index e43ad81..78b3e26 100644 --- a/src/vala/Pluie/Yaml.Finder.vala +++ b/src/vala/Pluie/Yaml.Finder.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.GeeBuilder.vala b/src/vala/Pluie/Yaml.GeeBuilder.vala index 629b281..81ebe36 100644 --- a/src/vala/Pluie/Yaml.GeeBuilder.vala +++ b/src/vala/Pluie/Yaml.GeeBuilder.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Loader.vala b/src/vala/Pluie/Yaml.Loader.vala index d9096f8..4cc49b4 100644 --- a/src/vala/Pluie/Yaml.Loader.vala +++ b/src/vala/Pluie/Yaml.Loader.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Mapping.vala b/src/vala/Pluie/Yaml.Mapping.vala index 0484550..836a463 100644 --- a/src/vala/Pluie/Yaml.Mapping.vala +++ b/src/vala/Pluie/Yaml.Mapping.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Node.vala b/src/vala/Pluie/Yaml.Node.vala index fe767ec..22e23dd 100644 --- a/src/vala/Pluie/Yaml.Node.vala +++ b/src/vala/Pluie/Yaml.Node.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Object.vala b/src/vala/Pluie/Yaml.Object.vala index 65f1cb2..9e34534 100644 --- a/src/vala/Pluie/Yaml.Object.vala +++ b/src/vala/Pluie/Yaml.Object.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Processor.vala b/src/vala/Pluie/Yaml.Processor.vala index 860e06d..1b3b34c 100644 --- a/src/vala/Pluie/Yaml.Processor.vala +++ b/src/vala/Pluie/Yaml.Processor.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 @@ -173,7 +173,7 @@ public class Pluie.Yaml.Processor Yaml.dbg_action ("Processing events"); this.reset (); for (var has_next = this.iterator.next (); has_next; has_next = this.iterator.next ()) { - this.event = this.iterator.get (); + this.event = this.iterator.get (); Yaml.dbg (" 0>>>>> [EVENT event [%d] %s <<<<< %s".printf (this.indexEvt++, this.event.evtype.infos (), Log.METHOD)); if (this.event.evtype.is_tag_directive ()) { this.on_tag_directive (); @@ -200,12 +200,6 @@ public class Pluie.Yaml.Processor } if (this.event.evtype.is_value () && (this.event = this.get_value_event ()) != null) { this.on_value (); - if (this.event.evtype.is_mapping_start ()) { - this.on_mapping_start (); - } - else if (this.event.evtype.is_sequence_start ()) { - this.on_sequence_start (); - } this.add_anchor_if_needed (); this.ckey = null; } @@ -220,19 +214,19 @@ public class Pluie.Yaml.Processor */ private void reset () { - this.root = new Yaml.Root (); - this.prev_node = this.root; - this.parent_node = this.root; - this.iterator = this.events.iterator (); - this.change = false; - this.ckey = null; - this.idAnchor = null; - this.tagHandle = null; - this.keyTag = null; - this.valueTag = null; - this.beginFlowSeq = false; - this.nextValueEvt = null; - this.indexEvt = 0; + this.root = new Yaml.Root (); + this.prev_node = this.root; + this.parent_node = this.root; + this.iterator = this.events.iterator (); + this.change = false; + this.ckey = null; + this.idAnchor = null; + this.tagHandle = null; + this.keyTag = null; + this.valueTag = null; + this.beginFlowSeq = false; + this.nextValueEvt = null; + this.indexEvt = 0; } /** @@ -327,22 +321,25 @@ public class Pluie.Yaml.Processor */ private void on_block_end () { - if (!this.prev_node.ntype.is_collection ()) { - this.prev_node = this.prev_node.parent; - } - bool is_nested = this.is_entry_nested_block (this.prev_node); - if (!is_nested || (is_nested && (this.prev_node as Yaml.Sequence).close_block)) { - this.parent_node = this.prev_node.parent != null && this.prev_node.parent != this.root - ? this.prev_node.parent - : this.root; - this.prev_node = this.parent_node; - } - if (is_nested) { - var seq = this.prev_node as Yaml.Sequence; - if (seq != null) { - seq.close_block = true; + Yaml.dbg (" ===== ON BLOCK END ===== "); + Yaml.dbg (" - parent_node : %s (%s)".printf (this.parent_node.name, this.parent_node.ntype.infos ())); + Yaml.dbg (" - prev_node : %s (%s - collection ? %s)".printf (this.prev_node.name, this.prev_node.ntype.infos (), this.prev_node.ntype.is_collection ().to_string ())); + bool suite = true; + if (this.prev_node.ntype.is_mapping () && this.prev_node.parent != null && this.prev_node.parent.ntype.is_sequence ()) { + if (!(this.prev_node.parent as Yaml.Sequence).close_block) { + (this.prev_node.parent as Yaml.Sequence).close_block = true; + suite = false; } } + if (suite) { + if (this.prev_node.ntype.is_scalar () || (this.prev_node.ntype.is_single_pair () && this.prev_node.parent != null && this.prev_node.parent.ntype.is_mapping ())) { + this.prev_node = this.prev_node.parent; + } + this.parent_node = this.prev_node.parent != null && this.prev_node.parent != this.root + ? this.prev_node.parent + : this.root; + this.prev_node = this.parent_node; + } } /** @@ -354,8 +351,8 @@ public class Pluie.Yaml.Processor Yaml.Event? e = null; // look up for sequence enrty nested block e = get_next_value_event (); - if (this.event.evtype.is_mapping_start () && (e!= null && !e.evtype.is_mapping_start ())) { - this.on_mapping_start (true); + if (this.event.evtype.is_mapping_start () && (e!= null && !e.evtype.is_mapping_start () && !e.evtype.is_scalar ())) { + this.on_mapping_start (!e.evtype.is_scalar ()); } else if (this.event.evtype.is_scalar ()) { this.on_scalar (true); @@ -408,6 +405,12 @@ public class Pluie.Yaml.Processor else if (this.event.evtype.is_alias ()) { this.on_alias (); } + if (this.event.evtype.is_mapping_start ()) { + this.on_mapping_start (); + } + else if (this.event.evtype.is_sequence_start ()) { + this.on_sequence_start (); + } } /** diff --git a/src/vala/Pluie/Yaml.Register.vala b/src/vala/Pluie/Yaml.Register.vala index 5e97631..cf9ccc6 100644 --- a/src/vala/Pluie/Yaml.Register.vala +++ b/src/vala/Pluie/Yaml.Register.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Root.vala b/src/vala/Pluie/Yaml.Root.vala index 105a10a..0a1778d 100644 --- a/src/vala/Pluie/Yaml.Root.vala +++ b/src/vala/Pluie/Yaml.Root.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Scalar.vala b/src/vala/Pluie/Yaml.Scalar.vala index 13fb9db..624cc8e 100644 --- a/src/vala/Pluie/Yaml.Scalar.vala +++ b/src/vala/Pluie/Yaml.Scalar.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Scanner.vala b/src/vala/Pluie/Yaml.Scanner.vala index 1b4770c..984c033 100644 --- a/src/vala/Pluie/Yaml.Scanner.vala +++ b/src/vala/Pluie/Yaml.Scanner.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Sequence.vala b/src/vala/Pluie/Yaml.Sequence.vala index 7773d7b..28cd285 100644 --- a/src/vala/Pluie/Yaml.Sequence.vala +++ b/src/vala/Pluie/Yaml.Sequence.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.Tag.vala b/src/vala/Pluie/Yaml.Tag.vala index acc2fab..43e3163 100644 --- a/src/vala/Pluie/Yaml.Tag.vala +++ b/src/vala/Pluie/Yaml.Tag.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/src/vala/Pluie/Yaml.global.vala b/src/vala/Pluie/Yaml.global.vala index 55f9a10..b990d17 100644 --- a/src/vala/Pluie/Yaml.global.vala +++ b/src/vala/Pluie/Yaml.global.vala @@ -1,7 +1,7 @@ /*^* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @software : pluie-yaml - * @version : 0.55 + * @version : 0.56 * @type : library * @date : 2018 * @license : GPLv3.0 diff --git a/valadoc.sh b/valadoc.sh index a4e3c52..fc65df2 100755 --- a/valadoc.sh +++ b/valadoc.sh @@ -2,7 +2,7 @@ #^# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @software : pluie-yaml -# @version : 0.55 +# @version : 0.56 # @type : library # @date : 2018 # @license : GPLv3.0