Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
24 changes: 14 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ plugins {
`maven-publish`
jacoco
idea
id("org.cadixdev.licenser") version "0.6.1"
id("cloud.rio.license") version "0.18.0"
id("me.qoomon.git-versioning") version "6.4.4"
id("io.freefair.lombok") version "9.1.0"
id("io.freefair.javadoc-links") version "9.1.0"
id("io.freefair.javadoc-utf-8") version "9.1.0"
id("io.freefair.maven-central.validate-poms") version "9.1.0"
id("io.freefair.javadoc-links") version "9.2.0"
id("io.freefair.javadoc-utf-8") version "9.2.0"
id("io.freefair.lombok") version "9.2.0"
// id("io.freefair.maven-central.validate-poms") version "9.2.0"
id("com.github.ben-manes.versions") version "0.53.0"
id("ru.vyarus.pom") version "3.0.0"
id("org.jreleaser") version "1.21.0"
id("org.sonarqube") version "7.2.2.6593"
id("me.champeau.jmh") version "0.7.3"
}

repositories {
Expand Down Expand Up @@ -49,13 +48,15 @@ gitVersioning.apply {
}

dependencies {
implementation("io.github.1c-syntax", "antlr4", "0.2.0")
implementation("io.github.1c-syntax", "antlr4", "0.3.0-rc.2")
implementation("commons-io", "commons-io", "2.15.1")
implementation("org.junit.jupiter", "junit-jupiter-api", "5.11.4")
implementation("org.assertj", "assertj-core", "3.27.0")

testImplementation("org.junit.jupiter", "junit-jupiter-engine", "5.11.4")
testImplementation("org.mockito", "mockito-core", "5.8.0")
testImplementation("org.mockito", "mockito-core", "5.21.0")

testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.0.2")
}

tasks.withType<JavaCompile> {
Expand Down Expand Up @@ -98,11 +99,14 @@ tasks.jacocoTestReport {
}

license {
header(rootProject.file("license/HEADER.txt"))
newLine(false)
header = rootProject.file("license/HEADER.txt")
skipExistingHeaders = false
strictCheck = true
mapping("java", "SLASHSTAR_STYLE")
ext["year"] = "2023-" + Calendar.getInstance().get(Calendar.YEAR)
ext["name"] = "Valery Maximov <maximovvalery@gmail.com>"
ext["project"] = "BSL Parser Testing"
include("**/*.java")
}

sonar {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 1 addition & 4 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions gradlew.bat
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down Expand Up @@ -79,7 +79,7 @@ public ParserAsserts matches(ParseTree tree) throws RecognitionException {
}

if (ctx.parent == null) {
boolean parseSuccess = testParser.getLexerClazz().cast(parser.getInputStream().getTokenSource())._hitEOF;
boolean parseSuccess = testParser.getLexerClazz().cast(parser.getInputStream().getTokenSource()).isHitEOF();
if (!parseSuccess) {
throw new RecognitionException(
"Parse error EOF don't hit\n" + parser.getInputStream().getText(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -23,9 +23,26 @@

import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.Vocabulary;
import org.antlr.v4.runtime.VocabularyImpl;
import org.jspecify.annotations.NullMarked;

@NullMarked
public class DemoEmptyLexer extends Lexer {

public static final String[] ruleNames = new String[0];
public static final Vocabulary VOCABULARY = new VocabularyImpl(ruleNames, new String[0]);

@Override
public String[] getChannelNames() {
return new String[0];
}

@Override
public String[] getModeNames() {
return new String[0];
}

public DemoEmptyLexer(CharStream input) {
super(input);
}
Expand All @@ -35,8 +52,13 @@ public String[] getRuleNames() {
return new String[0];
}

@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}

@Override
public String getGrammarFileName() {
return null;
return "empty";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -23,26 +23,32 @@

import org.antlr.v4.runtime.Parser;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.Vocabulary;
import org.antlr.v4.runtime.VocabularyImpl;
import org.jspecify.annotations.NullMarked;


@NullMarked
public class DemoEmptyParser extends Parser {

public static final String[] ruleNames = new String[0];
public static final Vocabulary VOCABULARY = new VocabularyImpl(ruleNames, new String[0]);

public DemoEmptyParser(TokenStream input) {
super(input);
}

@Override
public String[] getTokenNames() {
public String[] getRuleNames() {
return new String[0];
}

@Override
public String[] getRuleNames() {
return new String[0];
public Vocabulary getVocabulary() {
return VOCABULARY;
}

@Override
public String getGrammarFileName() {
return null;
return "empty";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This file is a part of BSL Parser Testing.
*
* Copyright (c) 2023-2025
* Copyright (c) 2023-2026
* 1c-syntax team and Valery Maximov <maximovvalery@gmail.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
Expand All @@ -21,11 +21,33 @@
*/
package com.github._1c_syntax.bsl.parser.testing.demo;

import org.antlr.v4.parse.BlockSetTransformer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.Vocabulary;
import org.antlr.v4.runtime.VocabularyImpl;
import org.jspecify.annotations.NullMarked;

@NullMarked
public class DemoLexer extends Lexer {

public static final String[] tokenNames = new String[]{"token1", "token2"};;
public static final Vocabulary VOCABULARY = new VocabularyImpl(new String[0], tokenNames);

@Override
public String[] getChannelNames() {
return new String[0];
}

@Override
public String[] getModeNames() {
return new String[0];
}

public String[] getTokenNames() {
return tokenNames;
}

public DemoLexer(CharStream input) {
super(input);
}
Expand All @@ -36,12 +58,12 @@ public String[] getRuleNames() {
}

@Override
public String[] getTokenNames() {
return new String[]{"token1", "token2"};
public Vocabulary getVocabulary() {
return VOCABULARY;
}

@Override
public String getGrammarFileName() {
return null;
return "fake";
}
}
Loading