diff --git a/src/main/java/edu/kit/typicalc/view/content/errorcontent/ErrorView.java b/src/main/java/edu/kit/typicalc/view/content/errorcontent/ErrorView.java index 7ca9f89..cfae822 100644 --- a/src/main/java/edu/kit/typicalc/view/content/errorcontent/ErrorView.java +++ b/src/main/java/edu/kit/typicalc/view/content/errorcontent/ErrorView.java @@ -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 = 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> expected = error.getExpected(); if (expected.isPresent()) { diff --git a/src/main/resources/language/translation_de.properties b/src/main/resources/language/translation_de.properties index bd4095c..c173010 100644 --- a/src/main/resources/language/translation_de.properties +++ b/src/main/resources/language/translation_de.properties @@ -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=\ -Typicalc wurde als PSE-Projekt am KIT im WS20/21 \ +Typicalc wurde als PSE-Projekt am KIT im WS 20/21 \ entwickelt von
\ Robin Böhne
\ Moritz Dieing
\ @@ -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 \ diff --git a/src/main/resources/language/translation_en.properties b/src/main/resources/language/translation_en.properties index 1f5d5ec..76cab63 100644 --- a/src/main/resources/language/translation_en.properties +++ b/src/main/resources/language/translation_en.properties @@ -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=\ Typicalc was developed as a PSE project at\ - the KIT in WS20/21 by
\ + the KIT in WS 20/21 by
\ Robin Böhne
\ Moritz Dieing
\ Thomas Heinen
\ @@ -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 \