Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The derived stakeholder list on a requirement usage now identifies its owning EM
- https://github.com/eclipse-syson/syson/issues/2665[#2665] [import] `SysMLImportLexer` Set initialization should be moved to a constant.
- https://github.com/eclipse-syson/syson/issues/2658[#2658] [diagrams] Ensure undoing _add existing elements_ does not remove unsynchronized nodes that shouldn't be removed.
- https://github.com/eclipse-syson/syson/issues/2631[#2631] [import] Syntax error in a nested body leaves the context stack unbalanced (AssertionError / wrong root type)
- https://github.com/eclipse-syson/syson/issues/2632[#2632] [import] Unparsable top-level input is silently dropped (rootNamespace does not consume EOF)

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public void suppliesDefaultImportVisibility() {
public void reportsTrailingInputAtOriginalLocation() {
var result = this.parse(this.context(), null, "import Missing::*;\nimport Other::*;\n}");

assertThat(result.messages()).anySatisfy(message -> assertThat(message.body()).contains("line 3:0: Unexpected trailing input '}'"));
assertThat(result.messages()).anySatisfy(message -> assertThat(message.body()).contains("line 3:0: extraneous input '}' expecting"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import KerMLExpressions;

rootNamespace:
{start(_localctx, namespace__());} (
packageBodyElement*
packageBodyElement* EOF
Comment thread
ylussaud marked this conversation as resolved.
Resolved
Comment thread
ylussaud marked this conversation as resolved.
Resolved
) {attachTrailingComments();} {end(_localctx);}
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.DefaultErrorStrategy;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.atn.PredictionMode;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
Expand Down Expand Up @@ -170,12 +169,7 @@ public ISysMLParseResult<Namespace> parseRootNamespace(InputStream is, Charset c
* @return the root namespace and diagnostics, including any unconsumed input
*/
public ISysMLParseResult<Namespace> parseRootNamespace(SysMLLexer lexer) {
SysMLParseResult<?> result = this.parse(lexer, parser -> {
parser.rootNamespace();
if (parser.getCurrentToken().getType() != Token.EOF) {
parser.notifyErrorListeners("Unexpected trailing input '" + parser.getCurrentToken().getText() + "'");
}
});
SysMLParseResult<?> result = this.parse(lexer, parser -> parser.rootNamespace());
Namespace root;
if (result.model() instanceof Namespace namespace && result.internalDiagnostic().getSeverity() < Diagnostic.ERROR) {
root = namespace;
Expand Down

Large diffs are not rendered by default.

Loading
Loading