[gnome-calculator] GCalc: renamed Plus to MathPlus



commit 2799df4454b1b4a14241a219c0a5f9806ba42314
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Oct 17 12:22:55 2019 -0500

    GCalc: renamed Plus to MathPlus

 gcalc/gcalc-gplus.vala                          |  2 +-
 gcalc/{gcalc-plus.vala => gcalc-math-plus.vala} |  4 ++--
 gcalc/gcalc-term.vala                           |  2 +-
 gcalc/meson.build                               |  2 +-
 tests/gcalc-parsing.vala                        | 32 ++++++++++++-------------
 5 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/gcalc/gcalc-gplus.vala b/gcalc/gcalc-gplus.vala
index cbb9b3ee..9b2195f3 100644
--- a/gcalc/gcalc-gplus.vala
+++ b/gcalc/gcalc-gplus.vala
@@ -18,7 +18,7 @@
  * Authors:
  *      Daniel Espinosa <esodan gmail com>
  */
-public class GCalc.GPlus : Expression, MathOperator, MathBinaryOperator, Plus {
+public class GCalc.GPlus : Expression, MathOperator, MathBinaryOperator, MathPlus {
   internal override string to_string () {
     return "+";
   }
diff --git a/gcalc/gcalc-plus.vala b/gcalc/gcalc-math-plus.vala
similarity index 87%
rename from gcalc/gcalc-plus.vala
rename to gcalc/gcalc-math-plus.vala
index 837e1789..f2172782 100644
--- a/gcalc/gcalc-plus.vala
+++ b/gcalc/gcalc-math-plus.vala
@@ -1,4 +1,4 @@
-/* gcalc-plus.vala
+/* gcalc-math-plus.vala
  *
  * Copyright (C) 2018  Daniel Espinosa <esodan gmail com>
  *
@@ -21,5 +21,5 @@
 /**
  * A plus operator in a math expression
  */
-public interface GCalc.Plus : Object, MathExpression, MathOperator, MathBinaryOperator {}
+public interface GCalc.MathPlus : Object, MathExpression, MathOperator, MathBinaryOperator {}
 
diff --git a/gcalc/gcalc-term.vala b/gcalc/gcalc-term.vala
index 66223432..b9305a5a 100644
--- a/gcalc/gcalc-term.vala
+++ b/gcalc/gcalc-term.vala
@@ -37,7 +37,7 @@ public interface GCalc.Term : Object, MathExpression {
     bool first = true;
     foreach (MathExpression e in expressions) {
       if (e is MathOperator) {
-        if (!(e is MathMinus || e is Plus) && first) {
+        if (!(e is MathMinus || e is MathPlus) && first) {
           throw new TermError.INVALID_OPERATOR ("Incorrect position for operator in expression");
         }
         if (e is MathMinus && first) {
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 21d3af77..c0f84018 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -103,12 +103,12 @@ gcalc_sources = files([
        'gcalc-math-multiply.vala',
        'gcalc-math-operator.vala',
        'gcalc-math-parameter.vala',
+       'gcalc-math-plus.vala',
        'gcalc-math-polynomial.vala',
        'gcalc-minus.vala',
        'gcalc-multiply.vala',
        'gcalc-parameter.vala',
        'gcalc-parser.vala',
-       'gcalc-plus.vala',
        'gcalc-polynomial.vala',
        'gcalc-pow.vala',
        'gcalc-result.vala',
diff --git a/tests/gcalc-parsing.vala b/tests/gcalc-parsing.vala
index 0346913f..d57ec3ba 100644
--- a/tests/gcalc-parsing.vala
+++ b/tests/gcalc-parsing.vala
@@ -127,7 +127,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as MathConstant;
         assert (c2 != null);
@@ -156,7 +156,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as Variable;
         assert (c2 != null);
@@ -185,7 +185,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as MathConstant;
         assert (c2 != null);
@@ -214,7 +214,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as Variable;
         assert (c2 != null);
@@ -246,21 +246,21 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as Variable;
         assert (c2 != null);
         var t3 = p.expressions.get_item (2) as Term;
         assert (t3 != null);
         assert (t3.expressions.get_n_items () == 2);
-        var plus2 = t3.expressions.get_item (0) as Plus;
+        var plus2 = t3.expressions.get_item (0) as MathPlus;
         assert (plus2 != null);
         var c3 = t3.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
         var t4 = p.expressions.get_item (3) as Term;
         assert (t4 != null);
         assert (t4.expressions.get_n_items () == 2);
-        var plus3 = t4.expressions.get_item (0) as Plus;
+        var plus3 = t4.expressions.get_item (0) as MathPlus;
         assert (plus3 != null);
         var c4 = t4.expressions.get_item (1) as Variable;
         assert (c4 != null);
@@ -292,14 +292,14 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c2 = t2.expressions.get_item (1) as Variable;
         assert (c2 != null);
         var t3 = p.expressions.get_item (2) as Term;
         assert (t3 != null);
         assert (t3.expressions.get_n_items () == 2);
-        var plus2 = t3.expressions.get_item (0) as Plus;
+        var plus2 = t3.expressions.get_item (0) as MathPlus;
         assert (plus2 != null);
         var c3 = t3.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -395,7 +395,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 4);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c3 = t2.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -488,7 +488,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 6);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c3 = t2.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -600,7 +600,7 @@ class Tests {
         var t2 = p.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var plus = t2.expressions.get_item (0) as Plus;
+        var plus = t2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var g2 = t2.expressions.get_item (1) as MathGroup;
         assert (g2 != null);
@@ -654,7 +654,7 @@ class Tests {
         assert (tg2 != null);
         assert (tg2.expressions.get_n_items () == 2);
         message (tg2.to_string ());
-        var plus = tg2.expressions.get_item (0) as Plus;
+        var plus = tg2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c3 = tg2.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -694,7 +694,7 @@ class Tests {
         assert (tg2 != null);
         assert (tg2.expressions.get_n_items () == 2);
         message (tg2.to_string ());
-        var plus = tg2.expressions.get_item (0) as Plus;
+        var plus = tg2.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var c3 = tg2.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -873,7 +873,7 @@ class Tests {
         var t2 = e.expressions.get_item (1) as Term;
         assert (t2 != null);
         assert (t2.expressions.get_n_items () == 2);
-        var pl = t2.expressions.get_item (0) as Plus;
+        var pl = t2.expressions.get_item (0) as MathPlus;
         assert (pl != null);
         var c3 = t2.expressions.get_item (1) as MathConstant;
         assert (c3 != null);
@@ -1063,7 +1063,7 @@ class Tests {
         var t4 = e3.expressions.get_item (1) as Term;
         assert (t4 != null);
         assert (t4.expressions.get_n_items () == 2);
-        var plus = t4.expressions.get_item (0) as Plus;
+        var plus = t4.expressions.get_item (0) as MathPlus;
         assert (plus != null);
         var v6 = t4.expressions.get_item (1) as Variable;
         assert (v6 != null);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]