mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-25 08:05:19 +00:00
Compare commits
8 Commits
definition
...
version-up
| Author | SHA1 | Date | |
|---|---|---|---|
| cc2da711e7 | |||
| ef39bcbaa2 | |||
| ac17246317 | |||
| 18e0bdebc5 | |||
| 251d0fc2c5 | |||
| 93c1c53612 | |||
| 0b6798e28d | |||
| 4188c83a66 |
@@ -1,6 +1,6 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.1.3'
|
ext.kotlin_version = '1.2.40'
|
||||||
ext.dokka_version = '0.9.15'
|
ext.dokka_version = '0.9.16'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
@@ -23,7 +23,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.3"
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:1.2.40"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
*
|
*
|
||||||
* This is a standard operator that simply performs addition.
|
* This is a standard operator that simply performs addition.
|
||||||
*/
|
*/
|
||||||
class OperatorAdd: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 0) {
|
class OperatorAdd: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 1) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2
|
params.size == 2
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import org.nwapw.abacus.plugin.standard.StandardPlugin.*
|
|||||||
*
|
*
|
||||||
* This is a standard operator that brings one number to the power of the other.
|
* This is a standard operator that brings one number to the power of the other.
|
||||||
*/
|
*/
|
||||||
class OperatorCaret: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 2) {
|
class OperatorCaret: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 3) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2
|
params.size == 2
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
*
|
*
|
||||||
* This is a standard operator that simply performs division.
|
* This is a standard operator that simply performs division.
|
||||||
*/
|
*/
|
||||||
class OperatorDivide: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 1) {
|
class OperatorDivide: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 2) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2
|
params.size == 2
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
*
|
*
|
||||||
* This is a standard operator that simply performs multiplication.
|
* This is a standard operator that simply performs multiplication.
|
||||||
*/
|
*/
|
||||||
class OperatorMultiply: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 1) {
|
class OperatorMultiply: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 2) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2
|
params.size == 2
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import org.nwapw.abacus.plugin.standard.StandardPlugin.OP_NPR
|
|||||||
* This is a standard operator that returns the number of possible combinations, regardless of order,
|
* This is a standard operator that returns the number of possible combinations, regardless of order,
|
||||||
* of a certain size can be taken out of a pool of a bigger size.
|
* of a certain size can be taken out of a pool of a bigger size.
|
||||||
*/
|
*/
|
||||||
class OperatorNcr: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 0) {
|
class OperatorNcr: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 1) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2 && params[0].isInteger()
|
params.size == 2 && params[0].isInteger()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
*
|
*
|
||||||
* This is a standard operator that negates a number.
|
* This is a standard operator that negates a number.
|
||||||
*/
|
*/
|
||||||
class OperatorNegate: NumberOperator(OperatorAssociativity.LEFT, OperatorType.UNARY_PREFIX, 0) {
|
class OperatorNegate: NumberOperator(OperatorAssociativity.LEFT, OperatorType.UNARY_PREFIX, 1) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 1
|
params.size == 1
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
* his is a standard operator that returns the number of possible combinations
|
* his is a standard operator that returns the number of possible combinations
|
||||||
* of a certain size can be taken out of a pool of a bigger size.
|
* of a certain size can be taken out of a pool of a bigger size.
|
||||||
*/
|
*/
|
||||||
class OperatorNpr: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 0) {
|
class OperatorNpr: NumberOperator(OperatorAssociativity.RIGHT, OperatorType.BINARY_INFIX, 1) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2 && params[0].isInteger()
|
params.size == 2 && params[0].isInteger()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.nwapw.abacus.number.NumberInterface
|
|||||||
*
|
*
|
||||||
* This is a standard operator that performs subtraction.
|
* This is a standard operator that performs subtraction.
|
||||||
*/
|
*/
|
||||||
class OperatorSubtract: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 0) {
|
class OperatorSubtract: NumberOperator(OperatorAssociativity.LEFT, OperatorType.BINARY_INFIX, 1) {
|
||||||
|
|
||||||
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
override fun matchesParams(context: PluginEvaluationContext, params: Array<out NumberInterface>) =
|
||||||
params.size == 2
|
params.size == 2
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.moandjiezana.toml:toml4j:0.7.1'
|
compile 'com.moandjiezana.toml:toml4j:0.7.2'
|
||||||
compile project(':core')
|
compile project(':core')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -329,9 +329,11 @@ public class AbacusController implements PluginListener {
|
|||||||
abacus.applyToContext(result.getResultingContext());
|
abacus.applyToContext(result.getResultingContext());
|
||||||
}
|
}
|
||||||
} catch (AbacusException abacusError) {
|
} catch (AbacusException abacusError) {
|
||||||
outputText.setText(ERR_DEFINITION + "(" + abacusError.getMessage() + ")");
|
outputText.setText(ERR_DEFINITION + " (" + abacusError.getMessage() + ")");
|
||||||
|
abacusError.printStackTrace();
|
||||||
} catch (RuntimeException runtime) {
|
} catch (RuntimeException runtime) {
|
||||||
outputText.setText(ERR_DEFINITION + "(" + ERR_EXCEPTION + ")");
|
outputText.setText(ERR_DEFINITION + " (" + ERR_EXCEPTION + ")");
|
||||||
|
runtime.printStackTrace();
|
||||||
} catch (FileNotFoundException ignored) {}
|
} catch (FileNotFoundException ignored) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,13 +347,13 @@ public class AbacusController implements PluginListener {
|
|||||||
} catch (IOException | ClassNotFoundException e) {
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
abacus.reload();
|
reloadAbacus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void performReload() {
|
public void performReload() {
|
||||||
alertIfApplyNeeded(true);
|
alertIfApplyNeeded(true);
|
||||||
abacus.reload();
|
reloadAbacus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
@@ -391,6 +393,13 @@ public class AbacusController implements PluginListener {
|
|||||||
changesMade = true;
|
changesMade = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reloadAbacus(){
|
||||||
|
abacus.reload();
|
||||||
|
for(String file : definitionFiles){
|
||||||
|
loadDefinitionFile(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad(PluginManager manager) {
|
public void onLoad(PluginManager manager) {
|
||||||
ExtendedConfiguration configuration = (ExtendedConfiguration) abacus.getConfiguration();
|
ExtendedConfiguration configuration = (ExtendedConfiguration) abacus.getConfiguration();
|
||||||
@@ -420,9 +429,6 @@ public class AbacusController implements PluginListener {
|
|||||||
}).collect(Collectors.toCollection(ArrayList::new)));
|
}).collect(Collectors.toCollection(ArrayList::new)));
|
||||||
functionList.sort(Comparator.comparing(Documentation::getCodeName));
|
functionList.sort(Comparator.comparing(Documentation::getCodeName));
|
||||||
definitionFiles.addAll(configuration.getDefinitionFiles());
|
definitionFiles.addAll(configuration.getDefinitionFiles());
|
||||||
for(String file : definitionFiles){
|
|
||||||
loadDefinitionFile(file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
|||||||
#Fri Jul 28 17:18:51 PDT 2017
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
|
|
||||||
|
|||||||
6
gradlew
vendored
6
gradlew
vendored
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
|||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD="maximum"
|
||||||
|
|
||||||
warn ( ) {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
die ( ) {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Escape application args
|
||||||
save ( ) {
|
save () {
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user