1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-09-21 10:52:33 +00:00

Rename the context class.

This commit is contained in:
2017-09-06 22:54:21 -07:00
parent ef1890f24d
commit 059226a4d4
10 changed files with 110 additions and 109 deletions

View File

@@ -1,17 +1,15 @@
package org.nwapw.abacus.tests;
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.nwapw.abacus.Abacus;
import org.nwapw.abacus.config.Configuration;
import org.nwapw.abacus.context.MutableReductionContext;
import org.nwapw.abacus.context.MutableEvaluationContext;
import org.nwapw.abacus.function.*;
import org.nwapw.abacus.lexing.pattern.Match;
import org.nwapw.abacus.number.NumberInterface;
import org.nwapw.abacus.parsing.LexerTokenizer;
import org.nwapw.abacus.plugin.NumberImplementation;
import org.nwapw.abacus.plugin.Plugin;
import org.nwapw.abacus.tree.TokenType;
@@ -23,12 +21,12 @@ public class TokenizerTests {
private static LexerTokenizer lexerTokenizer = new LexerTokenizer();
private static NumberFunction subtractFunction = new NumberFunction() {
@Override
public boolean matchesParams(MutableReductionContext context, NumberInterface[] params) {
public boolean matchesParams(MutableEvaluationContext context, NumberInterface[] params) {
return params.length == 2;
}
@Override
public NumberInterface applyInternal(MutableReductionContext context, NumberInterface[] params) {
public NumberInterface applyInternal(MutableEvaluationContext context, NumberInterface[] params) {
return params[0].subtract(params[1]);
}
};
@@ -39,12 +37,12 @@ public class TokenizerTests {
0) {
@Override
public boolean matchesParams(MutableReductionContext context, NumberInterface[] params) {
public boolean matchesParams(MutableEvaluationContext context, NumberInterface[] params) {
return true;
}
@Override
public NumberInterface applyInternal(MutableReductionContext context, NumberInterface[] params) {
public NumberInterface applyInternal(MutableEvaluationContext context, NumberInterface[] params) {
return subtractFunction.apply(context, params);
}
});
@@ -52,12 +50,12 @@ public class TokenizerTests {
0) {
@Override
public boolean matchesParams(MutableReductionContext context, NumberInterface[] params) {
public boolean matchesParams(MutableEvaluationContext context, NumberInterface[] params) {
return true;
}
@Override
public NumberInterface applyInternal(MutableReductionContext context, NumberInterface[] params) {
public NumberInterface applyInternal(MutableEvaluationContext context, NumberInterface[] params) {
return subtractFunction.apply(context, params);
}
});