[gnome-calculator] GCalc: renamed BinaryOperator to MathBinaryOperator
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] GCalc: renamed BinaryOperator to MathBinaryOperator
- Date: Thu, 17 Oct 2019 19:07:11 +0000 (UTC)
commit e9023e312dfe1d8228104204cf0483f53049e2df
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Oct 17 10:26:00 2019 -0500
GCalc: renamed BinaryOperator to MathBinaryOperator
gcalc/gcalc-assign.vala | 2 +-
gcalc/gcalc-division.vala | 2 +-
gcalc/gcalc-gassign.vala | 2 +-
gcalc/gcalc-gdivision.vala | 2 +-
gcalc/gcalc-gminus.vala | 2 +-
gcalc/gcalc-gmultiply.vala | 2 +-
gcalc/gcalc-gparser.vala | 2 +-
gcalc/gcalc-gplus.vala | 2 +-
...{gcalc-binary-operator.vala => gcalc-math-binary-operator.vala} | 7 +++++--
gcalc/gcalc-minus.vala | 5 ++++-
gcalc/gcalc-multiply.vala | 5 ++++-
gcalc/gcalc-plus.vala | 5 ++++-
gcalc/meson.build | 2 +-
13 files changed, 26 insertions(+), 14 deletions(-)
---
diff --git a/gcalc/gcalc-assign.vala b/gcalc/gcalc-assign.vala
index 91be058e..5ee49556 100644
--- a/gcalc/gcalc-assign.vala
+++ b/gcalc/gcalc-assign.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Assign : Object, MathExpression, MathOperator, BinaryOperator {
+public interface GCalc.Assign : Object, MathExpression, MathOperator, MathBinaryOperator {
public MathExpression evaluate () throws GLib.Error {
if (expressions.get_n_items () != 2) {
throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid number of expressions in assign");
diff --git a/gcalc/gcalc-division.vala b/gcalc/gcalc-division.vala
index a10fbd29..ab1bb59b 100644
--- a/gcalc/gcalc-division.vala
+++ b/gcalc/gcalc-division.vala
@@ -18,5 +18,5 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Division : Object, MathExpression, MathOperator, BinaryOperator {}
+public interface GCalc.Division : Object, MathExpression, MathOperator, MathBinaryOperator {}
diff --git a/gcalc/gcalc-gassign.vala b/gcalc/gcalc-gassign.vala
index dce1a7c7..0b7308f4 100644
--- a/gcalc/gcalc-gassign.vala
+++ b/gcalc/gcalc-gassign.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GCalc.GAssign : Expression, MathOperator, BinaryOperator, Assign {
+public class GCalc.GAssign : Expression, MathOperator, MathBinaryOperator, Assign {
internal override string to_string () {
if (expressions.get_n_items () != 2) {
return "Invalid Assigment structure";
diff --git a/gcalc/gcalc-gdivision.vala b/gcalc/gcalc-gdivision.vala
index 5f4abdd9..0ca932cb 100644
--- a/gcalc/gcalc-gdivision.vala
+++ b/gcalc/gcalc-gdivision.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GCalc.GDivision : Expression, MathOperator, BinaryOperator, Division {
+public class GCalc.GDivision : Expression, MathOperator, MathBinaryOperator, Division {
internal override string to_string () {
return "/";
}
diff --git a/gcalc/gcalc-gminus.vala b/gcalc/gcalc-gminus.vala
index 2e0fa930..a30eac78 100644
--- a/gcalc/gcalc-gminus.vala
+++ b/gcalc/gcalc-gminus.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GCalc.GMinus : Expression, MathOperator, BinaryOperator, Minus {
+public class GCalc.GMinus : Expression, MathOperator, MathBinaryOperator, Minus {
internal override string to_string () {
return "-";
}
diff --git a/gcalc/gcalc-gmultiply.vala b/gcalc/gcalc-gmultiply.vala
index fa3061a8..31931537 100644
--- a/gcalc/gcalc-gmultiply.vala
+++ b/gcalc/gcalc-gmultiply.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GCalc.GMultiply : Expression, MathOperator, BinaryOperator, Multiply {
+public class GCalc.GMultiply : Expression, MathOperator, MathBinaryOperator, Multiply {
internal override string to_string () {
return "*";
}
diff --git a/gcalc/gcalc-gparser.vala b/gcalc/gcalc-gparser.vala
index ab88fb1b..d54e80b7 100644
--- a/gcalc/gcalc-gparser.vala
+++ b/gcalc/gcalc-gparser.vala
@@ -335,7 +335,7 @@ public class GCalc.GParser : Object {
eqman.equations.add (eq);
}
private void process_operator (MathOperator opp, GMathEquation eq) throws GLib.Error {
- if (current is BinaryOperator) {
+ if (current is MathBinaryOperator) {
throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a plus operator");
}
if (current == null) {
diff --git a/gcalc/gcalc-gplus.vala b/gcalc/gcalc-gplus.vala
index 87b75779..cbb9b3ee 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, BinaryOperator, Plus {
+public class GCalc.GPlus : Expression, MathOperator, MathBinaryOperator, Plus {
internal override string to_string () {
return "+";
}
diff --git a/gcalc/gcalc-binary-operator.vala b/gcalc/gcalc-math-binary-operator.vala
similarity index 81%
rename from gcalc/gcalc-binary-operator.vala
rename to gcalc/gcalc-math-binary-operator.vala
index a22fcaf6..9b31e5cb 100644
--- a/gcalc/gcalc-binary-operator.vala
+++ b/gcalc/gcalc-math-binary-operator.vala
@@ -1,4 +1,4 @@
-/* gcalc-binary-operator.vala
+/* gcalc-math-binary-operator.vala
*
* Copyright (C) 2018 Daniel Espinosa <esodan gmail com>
*
@@ -18,5 +18,8 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.BinaryOperator : Object, MathExpression, MathOperator {}
+/**
+ * An operator for two members in a math expression
+ */
+public interface GCalc.MathBinaryOperator : Object, MathExpression, MathOperator {}
diff --git a/gcalc/gcalc-minus.vala b/gcalc/gcalc-minus.vala
index 93bcdc5b..797f1398 100644
--- a/gcalc/gcalc-minus.vala
+++ b/gcalc/gcalc-minus.vala
@@ -18,5 +18,8 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Minus : Object, MathExpression, MathOperator, BinaryOperator {}
+/**
+ * A minus operator in a math expression
+ */
+public interface GCalc.Minus : Object, MathExpression, MathOperator, MathBinaryOperator {}
diff --git a/gcalc/gcalc-multiply.vala b/gcalc/gcalc-multiply.vala
index 0a60d428..200040a8 100644
--- a/gcalc/gcalc-multiply.vala
+++ b/gcalc/gcalc-multiply.vala
@@ -18,5 +18,8 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Multiply : Object, MathExpression, MathOperator, BinaryOperator {}
+/**
+ * A multiply operator in a math expression
+ */
+public interface GCalc.Multiply : Object, MathExpression, MathOperator, MathBinaryOperator {}
diff --git a/gcalc/gcalc-plus.vala b/gcalc/gcalc-plus.vala
index 6559d517..837e1789 100644
--- a/gcalc/gcalc-plus.vala
+++ b/gcalc/gcalc-plus.vala
@@ -18,5 +18,8 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Plus : Object, MathExpression, MathOperator, BinaryOperator {}
+/**
+ * A plus operator in a math expression
+ */
+public interface GCalc.Plus : Object, MathExpression, MathOperator, MathBinaryOperator {}
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 74b448ad..96585637 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -57,7 +57,6 @@ lib_mpfrg = static_library ('mpfrg',
gcalc_sources = files([
'gcalc-assign.vala',
- 'gcalc-binary-operator.vala',
'gcalc-constant.vala',
'gcalc-division.vala',
'gcalc-expression.vala',
@@ -101,6 +100,7 @@ gcalc_sources = files([
'gcalc-gterm.vala',
'gcalc-gvariable.vala',
'gcalc-hashable.vala',
+ 'gcalc-math-binary-operator.vala',
'gcalc-math-equation.vala',
'gcalc-math-equation-manager.vala',
'gcalc-math-expression.vala',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]