Merge pull request #27 from DanilaFe/fixes

Fix a number of small issues not worthy of their own branches.
This commit is contained in:
Danila Fedorin 2017-09-16 01:26:40 -07:00 committed by GitHub
commit 07581557c7
3 changed files with 6 additions and 11 deletions

4
.gitignore vendored
View File

@ -24,7 +24,9 @@ hs_err_pid*
# Custom Stuff # Custom Stuff
# Gradle # Gradle
.gradle/* .gradle/*
build/* **/build/*
**/out/**
**/.DS_Store
# IntelliJ # IntelliJ
.idea/* .idea/*

View File

@ -5,7 +5,7 @@ import org.nwapw.abacus.exception.ComputationInterruptedException;
/** /**
* An interface used to represent a number. * An interface used to represent a number.
*/ */
public abstract class NumberInterface { public abstract class NumberInterface implements Comparable<NumberInterface> {
/** /**
* Check if the thread was interrupted and * Check if the thread was interrupted and
@ -158,14 +158,6 @@ public abstract class NumberInterface {
return intPowInternal(exponent); return intPowInternal(exponent);
} }
/**
* Compares this number to another.
*
* @param number the number to compare to.
* @return same as Integer.compare();
*/
public abstract int compareTo(NumberInterface number);
/** /**
* Same as Math.signum(). * Same as Math.signum().
* *

View File

@ -68,6 +68,7 @@ class Abacus(val configuration: Configuration) {
pluginManager.reload() pluginManager.reload()
with(mutableContext) { with(mutableContext) {
numberImplementation = pluginManager.numberImplementationFor(configuration.numberImplementation) numberImplementation = pluginManager.numberImplementationFor(configuration.numberImplementation)
?: StandardPlugin.IMPLEMENTATION_NAIVE
clearVariables() clearVariables()
clearDefinitions() clearDefinitions()
} }
@ -87,7 +88,7 @@ class Abacus(val configuration: Configuration) {
* @param input the input string to parse * @param input the input string to parse
* @return the resulting tree, null if the tree builder or the produced tree are null. * @return the resulting tree, null if the tree builder or the produced tree are null.
*/ */
fun parseString(input: String): TreeNode? = treeBuilder.fromString(input) fun parseString(input: String): TreeNode = treeBuilder.fromString(input)
/** /**
* Evaluates the given tree. * Evaluates the given tree.
* *