Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Обновил версию парсера #1858

Merged
merged 1 commit into from
Oct 8, 2021
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api("org.eclipse.lsp4j", "org.eclipse.lsp4j", "0.12.0")

// 1c-syntax
api("com.github.1c-syntax", "bsl-parser", "54dacb8e5a1f6f07afaeb1d9c8840642d202768c") {
api("com.github.1c-syntax", "bsl-parser", "dcefcd09d5") {
exclude("com.tunnelvisionlabs", "antlr4-annotations")
exclude("com.ibm.icu", "*")
exclude("org.antlr", "ST4")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class FullOuterJoinQueryDiagnostic extends AbstractSDBLVisitorDiagnostic

@Override
public ParseTree visitJoinPart(SDBLParser.JoinPartContext ctx) {
if (ctx.FULL_JOIN() != null) {
diagnosticStorage.addDiagnostic(ctx.FULL_JOIN());
if (ctx.FULL() != null && ctx.JOIN() != null) {
diagnosticStorage.addDiagnostic(ctx.FULL(), ctx.JOIN());
}

return super.visitJoinPart(ctx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class UnionAllDiagnostic extends AbstractSDBLVisitorDiagnostic {

@Override
public ParseTree visitUnion(SDBLParser.UnionContext ctx) {
if (ctx.UNION_ALL() != null) {
if (ctx.UNION() != null && ctx.ALL() != null) {
return super.visitUnion(ctx);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static String getNewText(
}

String addedText = token.getText();
if (tokenType == BSLLexer.LINE_COMMENT || tokenType == BSLLexer.PREPROC_LINE_COMMENT) {
if (tokenType == BSLLexer.LINE_COMMENT) {
addedText = addedText.trim();
}
newTextBuilder.append(addedText);
Expand Down Expand Up @@ -293,8 +293,7 @@ public static String getNewText(
private static List<Token> filteredTokens(List<Token> tokens) {
return tokens.stream()
.filter(token -> token.getChannel() == Token.DEFAULT_CHANNEL
|| token.getType() == BSLLexer.LINE_COMMENT
|| token.getType() == BSLLexer.PREPROC_LINE_COMMENT)
|| token.getType() == BSLLexer.LINE_COMMENT)
.collect(Collectors.toList());
}

Expand Down