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
# Gradle
.gradle/*
build/*
**/build/*
**/out/**
**/.DS_Store
# IntelliJ
.idea/*

View File

@ -5,7 +5,7 @@ import org.nwapw.abacus.exception.ComputationInterruptedException;
/**
* 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
@ -158,14 +158,6 @@ public abstract class NumberInterface {
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().
*

View File

@ -68,6 +68,7 @@ class Abacus(val configuration: Configuration) {
pluginManager.reload()
with(mutableContext) {
numberImplementation = pluginManager.numberImplementationFor(configuration.numberImplementation)
?: StandardPlugin.IMPLEMENTATION_NAIVE
clearVariables()
clearDefinitions()
}
@ -87,7 +88,7 @@ class Abacus(val configuration: Configuration) {
* @param input the input string to parse
* @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.
*