mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6763632df8
@ -1,3 +1,4 @@
|
||||
build:
|
||||
script:
|
||||
- mvn -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp checkstyle:check
|
||||
- mvn -Dmaven.repo.local=/tmp/m2/repository -Duser.home=/tmp test
|
||||
|
10
pom.xml
10
pom.xml
@ -155,6 +155,16 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<configuration>
|
||||
<configLocation>${project.build.directory}/../src/test/resources/checkstyle.xml</configLocation>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<violationSeverity>warning</violationSeverity>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class LambdaLexer {
|
||||
return new Result<>(t);
|
||||
case '\\':
|
||||
case 'λ':
|
||||
t = new Token(TokenType.LAMBDA, c+"", pos);
|
||||
t = new Token(TokenType.LAMBDA, c + "", pos);
|
||||
advance();
|
||||
return new Result<>(t);
|
||||
default:
|
||||
|
@ -27,7 +27,7 @@ public class LambdaParser {
|
||||
*/
|
||||
private Token token;
|
||||
|
||||
private static final Set<TokenType> atomStartTokens
|
||||
private static final Set<TokenType> ATOM_START_TOKENS
|
||||
= EnumSet.of(TokenType.VARIABLE, TokenType.NUMBER, TokenType.TRUE,
|
||||
TokenType.FALSE, TokenType.LP);
|
||||
|
||||
@ -97,11 +97,11 @@ public class LambdaParser {
|
||||
nextToken();
|
||||
Result<VarTerm, ParseError> var = parseVar();
|
||||
if (!expect(TokenType.DOT)) {
|
||||
// TODO
|
||||
return new Result<>(null, ParseError.UNEXPECTED_TOKEN);
|
||||
}
|
||||
Result<LambdaTerm, ParseError> body = parseTerm();
|
||||
// TODO: Fehlerbehandlung
|
||||
return new Result(new AbsTerm(var.unwrap(), body.unwrap()));
|
||||
return new Result<>(new AbsTerm(var.unwrap(), body.unwrap()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +110,7 @@ public class LambdaParser {
|
||||
*/
|
||||
private Result<LambdaTerm, ParseError> parseApplication() {
|
||||
LambdaTerm left = parseAtom().unwrap(); // TODO: Fehlerbehandlung
|
||||
while (atomStartTokens.contains(token.getType())) {
|
||||
while (ATOM_START_TOKENS.contains(token.getType())) {
|
||||
LambdaTerm atom = parseAtom().unwrap(); // TODO: Fehlerbehandlung
|
||||
left = new AppTerm(left, atom);
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
package edu.kit.typicalc.model.step;
|
||||
|
||||
import edu.kit.typicalc.model.Conclusion;
|
||||
<<<<<<< HEAD
|
||||
import edu.kit.typicalc.model.Constraint;
|
||||
=======
|
||||
|
||||
>>>>>>> 0f6c701 (Checkstyle für Maven konfiguriert)
|
||||
/**
|
||||
* Models one step of the inference tree.
|
||||
* Depending on the inference rule that is applied in a step,
|
||||
@ -46,4 +50,13 @@ public abstract class InferenceStep {
|
||||
* @param stepVisitor the visitor that wants to visit this object
|
||||
*/
|
||||
public abstract void accept(StepVisitor stepVisitor);
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
|
||||
public Conclusion getConclusion() {
|
||||
return null; // TODO
|
||||
}
|
||||
|
||||
}
|
||||
>>>>>>> 0f6c701 (Checkstyle für Maven konfiguriert)
|
||||
|
@ -12,8 +12,12 @@ public class VarTerm extends LambdaTerm {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
VarTerm varTerm = (VarTerm) o;
|
||||
return Objects.equals(name, varTerm.name);
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ import com.vaadin.flow.i18n.I18NProvider;
|
||||
|
||||
@Component
|
||||
/**
|
||||
* Provides a simple implementation of the I18NProvider.
|
||||
* Provides a simple implementation of the I18NProvider.
|
||||
* Allows for multiple languages and retrieving static Strings from .property-files.
|
||||
*/
|
||||
public class TypicalcI18NProvider implements I18NProvider {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 8261479587838699070L;
|
||||
|
||||
|
||||
/**
|
||||
* Prefix of all .property-files
|
||||
*/
|
||||
@ -31,12 +31,12 @@ public class TypicalcI18NProvider implements I18NProvider {
|
||||
|
||||
@Override
|
||||
public String getTranslation(String key, Locale locale, Object... params) {
|
||||
if(key == null) {
|
||||
if (key == null) {
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
|
||||
String translation;
|
||||
|
||||
|
||||
try {
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE_PREFIX, locale);
|
||||
translation = bundle.getString(key);
|
||||
@ -44,7 +44,7 @@ public class TypicalcI18NProvider implements I18NProvider {
|
||||
throw new IllegalStateException("this should never happen:"
|
||||
+ " either an invalid locale is set or an invalid key is provided.");
|
||||
}
|
||||
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,4 @@ server.port=${PORT:8080}
|
||||
logging.level.org.atmosphere = warn
|
||||
spring.mustache.check-template-location = false
|
||||
|
||||
# To improve the performance during development.
|
||||
# For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters
|
||||
# vaadin.whitelisted-packages= org/vaadin/example
|
||||
|
@ -10,14 +10,15 @@
|
||||
<property name="tabWidth" value="4"/>
|
||||
<module name="JavadocType">
|
||||
<property name="scope" value="package"/>
|
||||
<!-->property name="allowUndeclaredRTE" value="true"/-->
|
||||
<!-->property name="suppressLoadErrors" value="true"/-->
|
||||
<property name="severity" value="info"/>
|
||||
</module>
|
||||
<module name="JavadocMethod">
|
||||
<property name="scope" value="package"/>
|
||||
<property name="severity" value="info"/>
|
||||
</module>
|
||||
<module name="JavadocVariable">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="severity" value="info"/>
|
||||
</module>
|
||||
<module name="ConstantName"/>
|
||||
<module name="LocalFinalVariableName"/>
|
||||
@ -27,7 +28,6 @@
|
||||
<module name="ParameterName"/>
|
||||
<module name="StaticVariableName"/>
|
||||
<module name="TypeName"/>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="IllegalImport"/>
|
||||
<module name="RedundantImport"/>
|
||||
<module name="UnusedImports"/>
|
Loading…
Reference in New Issue
Block a user