mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
Show expected input in UI
This commit is contained in:
parent
f6d0777fd0
commit
93ec136970
@ -10,6 +10,7 @@ import com.vaadin.flow.component.html.Pre;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.i18n.LocaleChangeEvent;
|
||||
import com.vaadin.flow.i18n.LocaleChangeObserver;
|
||||
import edu.kit.typicalc.model.parser.ExpectedInput;
|
||||
import edu.kit.typicalc.model.parser.ParseError;
|
||||
import edu.kit.typicalc.model.parser.Token;
|
||||
import edu.kit.typicalc.view.main.InfoContent;
|
||||
@ -82,6 +83,15 @@ public class ErrorView extends VerticalLayout implements LocaleChangeObserver {
|
||||
throw new IllegalStateException(); // delete when updating to Java 12+
|
||||
}
|
||||
|
||||
// state expected input, if available
|
||||
Optional<ExpectedInput> expectedInput = error.getExpectedInput();
|
||||
if (expectedInput.isPresent()) {
|
||||
ExpectedInput e = expectedInput.get();
|
||||
additionalInformation.add(new Span(new Pre(
|
||||
getTranslation("error.expectedToken",
|
||||
getTranslation("expectedinput." + e)))));
|
||||
}
|
||||
|
||||
// add expected tokens, if available
|
||||
Optional<Collection<Token.TokenType>> expected = error.getExpected();
|
||||
if (expected.isPresent()) {
|
||||
|
@ -92,7 +92,7 @@ root.helpInferenceViewFeatures=Wurde ein Term erfolgreich typisiert, werden der
|
||||
abgebrochen. Mit \u03C3 wird am Ende der allgemeinste Unifikator angegeben, mit \u03C3(\u03B1\u2081) der \
|
||||
finale Typ des Terms.
|
||||
help.typicalcInfo=\
|
||||
<a href="https://git.scc.kit.edu/pse-typinferenz/typicalc">Typicalc</a> wurde als PSE-Projekt am KIT im WS20/21 \
|
||||
<a href="https://git.scc.kit.edu/pse-typinferenz/typicalc">Typicalc</a> wurde als PSE-Projekt am KIT im WS 20/21 \
|
||||
entwickelt von<br>\
|
||||
Robin Böhne<br>\
|
||||
Moritz Dieing<br>\
|
||||
@ -123,6 +123,7 @@ tokentype.DOT=.
|
||||
tokentype.EQUALS==
|
||||
tokentype.ARROW=->
|
||||
tokentype.EOF=Ende der Eingabe
|
||||
expectedinput.TERM=beliebiger Term
|
||||
root.or=oder
|
||||
root.slideExp=Typicalc ist eine Anwendung zur Visualisierung von Typinferenz. In der folgenden Slideshow wird ein \
|
||||
Beispielszenario mit den wichtigsten Funktionen der Website vorgeführt. Das relevante Bedienelement ist jeweils mit \
|
||||
|
@ -86,7 +86,7 @@ root.helpInferenceViewFeatures=When a term is successfully type inferred, the in
|
||||
cancelled. At the end, the most general unifier is displayed as \u03C3 and the final type as \u03C3(\u03B1\u2081).
|
||||
help.typicalcInfo=\
|
||||
<a href="https://git.scc.kit.edu/pse-typinferenz/typicalc">Typicalc</a> was developed as a PSE project at\
|
||||
the KIT in WS20/21 by<br>\
|
||||
the KIT in WS 20/21 by<br>\
|
||||
Robin Böhne<br>\
|
||||
Moritz Dieing<br>\
|
||||
Thomas Heinen<br>\
|
||||
@ -116,6 +116,7 @@ tokentype.DOT=.
|
||||
tokentype.EQUALS==
|
||||
tokentype.ARROW=->
|
||||
tokentype.EOF=End of input
|
||||
expectedinput.TERM=any lambda term
|
||||
root.or=or
|
||||
root.slideExp=Typicalc is an application for the visualisation of type inference. The slideshow below the text \
|
||||
demonstrates the most important features of the website. In each slide the relevant operating element is surrounded \
|
||||
|
Loading…
Reference in New Issue
Block a user