From 48f519e7858fb266df258d85aab0aabc4425d677 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 3 Mar 2016 22:02:01 +0100 Subject: [PATCH] align naming of mutation primitives ...convinced myself to retain an uniform naming scheme, even while the implementation spans several onion-like layers --- src/lib/diff/tree-diff-mutator-binding.hpp | 22 +++++++++---------- src/lib/diff/tree-mutator.hpp | 2 +- .../diff/tree-manipulation-binding-test.cpp | 2 +- wiki/thinkPad.ichthyo.mm | 9 ++++++-- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/lib/diff/tree-diff-mutator-binding.hpp b/src/lib/diff/tree-diff-mutator-binding.hpp index c27c12456..d4d562b06 100644 --- a/src/lib/diff/tree-diff-mutator-binding.hpp +++ b/src/lib/diff/tree-diff-mutator-binding.hpp @@ -291,19 +291,19 @@ namespace diff{ /* == Forwarding: mutation primitives == */ void - skip_src (GenNode const& n) + skipSrc (GenNode const& n) { UNIMPLEMENTED("skip matching src element and advance abstract source position"); } void - accept_src (GenNode const& n) + acceptSrc (GenNode const& n) { UNIMPLEMENTED("accept existing element"); } void - inject (GenNode const& n) + injectNew (GenNode const& n) { UNIMPLEMENTED("inject a new element at current abstract position"); } @@ -327,13 +327,13 @@ namespace diff{ } void - locate_and_open_for_mutation (GenNode const& n) + locate_and_openSubScope (GenNode const& n) { UNIMPLEMENTED("locate allready accepted element and open recursive sub-scope for mutation"); } void - close_subScope() + closeSubScope() { UNIMPLEMENTED("finish and leave sub scope and return to invoking parent scope"); } @@ -345,28 +345,28 @@ namespace diff{ virtual void ins (GenNode const& n) override { - inject (n); + injectNew (n); } virtual void del (GenNode const& n) override { __expect_in_target(n, "remove"); - skip_src (n); + skipSrc (n); } virtual void pick (GenNode const& n) override { __expect_in_target(n, "pick"); - accept_src (n); + acceptSrc (n); } virtual void skip (GenNode const& n) override { __expect_further_elements (n); - skip_src (n); + skipSrc (n); } // assume the actual content has been moved away by a previous find() virtual void @@ -402,7 +402,7 @@ namespace diff{ virtual void mut (GenNode const& n) override { - locate_and_open_for_mutation (n); + locate_and_openSubScope (n); Rec const& childRecord = child.data.get(); TRACE (diff, "tree-diff: ENTER scope %s", cStr(childRecord)); @@ -415,7 +415,7 @@ namespace diff{ TRACE (diff, "tree-diff: LEAVE scope %s", cStr(describeScope())); __expect_end_of_scope (n.idi); - close_subScope(); + closeSubScope(); __expect_valid_parent_scope (n.idi); } diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index 8c6474a64..f218b27e7 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -122,7 +122,7 @@ namespace diff{ /* ==== operation API ==== */ virtual void - insertChild (GenNode const& n) + injectNew (GenNode const& n) { UNIMPLEMENTED("establish new child node at current position"); } diff --git a/tests/library/diff/tree-manipulation-binding-test.cpp b/tests/library/diff/tree-manipulation-binding-test.cpp index 5c4808b8f..566b57975 100644 --- a/tests/library/diff/tree-manipulation-binding-test.cpp +++ b/tests/library/diff/tree-manipulation-binding-test.cpp @@ -113,7 +113,7 @@ namespace test{ CHECK (isnil (target)); - mutator.insertChild (ATTRIB1); + mutator.injectNew (ATTRIB1); CHECK (!isnil (target)); CHECK (target.contains("α = 1")); CHECK (target.verifyEvent("insert","α = 1") diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 66e9e97dd..0139d12b5 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1700,11 +1700,16 @@ - + + + + + + - +