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()) {
|
||||
|
@ -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 \
|
||||
|
@ -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