diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f58d40ef0..ce63a07bf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,6 +31,6 @@ jobs: run: cp -r ./docs/. ./wiki - name: Deploy 🚀 - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: repository: wiki diff --git a/.github/workflows/report-viewer-build-test.yml b/.github/workflows/report-viewer-build-test.yml index aa80c86dd..5958c26ad 100644 --- a/.github/workflows/report-viewer-build-test.yml +++ b/.github/workflows/report-viewer-build-test.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer-dev.yml b/.github/workflows/report-viewer-dev.yml index 92fe97407..2362155b2 100644 --- a/.github/workflows/report-viewer-dev.yml +++ b/.github/workflows/report-viewer-dev.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer-e2e.yml b/.github/workflows/report-viewer-e2e.yml index 9e265b910..0335bf8ad 100644 --- a/.github/workflows/report-viewer-e2e.yml +++ b/.github/workflows/report-viewer-e2e.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer-lint.yml b/.github/workflows/report-viewer-lint.yml index 924b274e7..080b1a02f 100644 --- a/.github/workflows/report-viewer-lint.yml +++ b/.github/workflows/report-viewer-lint.yml @@ -33,7 +33,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer-prettier.yml b/.github/workflows/report-viewer-prettier.yml index e9933c24e..eb1cc46e3 100644 --- a/.github/workflows/report-viewer-prettier.yml +++ b/.github/workflows/report-viewer-prettier.yml @@ -33,7 +33,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer-unit.yml b/.github/workflows/report-viewer-unit.yml index 48f9082a7..3a0738588 100644 --- a/.github/workflows/report-viewer-unit.yml +++ b/.github/workflows/report-viewer-unit.yml @@ -28,7 +28,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/.github/workflows/report-viewer.yml b/.github/workflows/report-viewer.yml index 624dde7c5..b5ba1eb57 100644 --- a/.github/workflows/report-viewer.yml +++ b/.github/workflows/report-viewer.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout 🛎️ uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: "18" diff --git a/core/src/main/java/de/jplag/GreedyStringTiling.java b/core/src/main/java/de/jplag/GreedyStringTiling.java index 317c67aa4..3cef93354 100644 --- a/core/src/main/java/de/jplag/GreedyStringTiling.java +++ b/core/src/main/java/de/jplag/GreedyStringTiling.java @@ -1,6 +1,7 @@ package de.jplag; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.List; @@ -22,7 +23,6 @@ public class GreedyStringTiling { private final int minimumMatchLength; - private final int minimumNeighborLength; private final JPlagOptions options; private final ConcurrentMap tokenTypeValues; private final Map> baseCodeMarkings = new IdentityHashMap<>(); @@ -33,8 +33,8 @@ public class GreedyStringTiling { public GreedyStringTiling(JPlagOptions options) { this.options = options; // Ensures 1 <= neighborLength <= minimumTokenMatch - this.minimumNeighborLength = Math.min(Math.max(options.mergingOptions().minimumNeighborLength(), 1), options.minimumTokenMatch()); - this.minimumMatchLength = options.mergingOptions().enabled() ? this.minimumNeighborLength : options.minimumTokenMatch(); + int minimumNeighborLength = Math.min(Math.max(options.mergingOptions().minimumNeighborLength(), 1), options.minimumTokenMatch()); + this.minimumMatchLength = options.mergingOptions().enabled() ? minimumNeighborLength : options.minimumTokenMatch(); this.tokenTypeValues = new ConcurrentHashMap<>(); this.tokenTypeValues.put(SharedTokenType.FILE_END, 0); } @@ -78,20 +78,15 @@ public final JPlagComparison generateBaseCodeMarking(Submission submission, Subm public final JPlagComparison compare(Submission firstSubmission, Submission secondSubmission) { Submission smallerSubmission; Submission largerSubmission; - if (firstSubmission.getTokenList().size() > secondSubmission.getTokenList().size()) { - smallerSubmission = secondSubmission; - largerSubmission = firstSubmission; - } else if (firstSubmission.getTokenList().size() < secondSubmission.getTokenList().size()) { + Comparator submissionComparator = Comparator.comparing((Submission it) -> it.getTokenList().size()) + .thenComparing(Submission::getName); + + if (submissionComparator.compare(firstSubmission, secondSubmission) <= 0) { smallerSubmission = firstSubmission; largerSubmission = secondSubmission; } else { - if (firstSubmission.getName().compareTo(secondSubmission.getName()) < 0) { - smallerSubmission = firstSubmission; - largerSubmission = secondSubmission; - } else { - smallerSubmission = secondSubmission; - largerSubmission = firstSubmission; - } + smallerSubmission = secondSubmission; + largerSubmission = firstSubmission; } return compareInternal(smallerSubmission, largerSubmission); } diff --git a/language-testutils/src/test/java/de/jplag/testutils/datacollector/TestSourceIgnoredLinesCollector.java b/language-testutils/src/test/java/de/jplag/testutils/datacollector/TestSourceIgnoredLinesCollector.java index 2fff37ec1..06a67cbb7 100644 --- a/language-testutils/src/test/java/de/jplag/testutils/datacollector/TestSourceIgnoredLinesCollector.java +++ b/language-testutils/src/test/java/de/jplag/testutils/datacollector/TestSourceIgnoredLinesCollector.java @@ -25,6 +25,15 @@ public void ignoreLinesByPrefix(String prefix) { this.ignoreByCondition(line -> line.trim().startsWith(prefix)); } + /** + * Ignores lines that match the given regular expression. Whitespaces to the left and right of the line will be trimmed + * first. + * @param regex The regular expression + */ + public void ignoreLinesByRegex(String regex) { + this.ignoreByCondition(line -> line.trim().matches(regex)); + } + public void ignoreLinesByContains(String content) { this.ignoreByCondition(line -> line.contains(content)); } diff --git a/languages/csharp/pom.xml b/languages/csharp/pom.xml index 9bf5f4b66..12213357f 100644 --- a/languages/csharp/pom.xml +++ b/languages/csharp/pom.xml @@ -13,6 +13,11 @@ org.antlr antlr4-runtime + + de.jplag + language-antlr-utils + ${revision} + diff --git a/languages/csharp/src/main/java/de/jplag/csharp/CSharpLanguage.java b/languages/csharp/src/main/java/de/jplag/csharp/CSharpLanguage.java index 401727bf6..aeeb53728 100644 --- a/languages/csharp/src/main/java/de/jplag/csharp/CSharpLanguage.java +++ b/languages/csharp/src/main/java/de/jplag/csharp/CSharpLanguage.java @@ -1,29 +1,21 @@ package de.jplag.csharp; -import java.io.File; -import java.util.List; -import java.util.Set; - import org.kohsuke.MetaInfServices; -import de.jplag.ParsingException; -import de.jplag.Token; +import de.jplag.antlr.AbstractAntlrLanguage; /** * C# language with full support of C# 6 features and below. - * @author Timur Saglam */ @MetaInfServices(de.jplag.Language.class) -public class CSharpLanguage implements de.jplag.Language { +public class CSharpLanguage extends AbstractAntlrLanguage { private static final String NAME = "C# 6 Parser"; private static final String IDENTIFIER = "csharp"; private static final String[] FILE_ENDINGS = new String[] {".cs", ".CS"}; private static final int DEFAULT_MIN_TOKEN_MATCH = 8; - private final CSharpParserAdapter parser; - public CSharpLanguage() { - parser = new CSharpParserAdapter(); + super(new CSharpParserAdapter()); } @Override @@ -45,9 +37,4 @@ public String getIdentifier() { public int minimumTokenMatch() { return DEFAULT_MIN_TOKEN_MATCH; } - - @Override - public List parse(Set files) throws ParsingException { - return parser.parse(files); - } } diff --git a/languages/csharp/src/main/java/de/jplag/csharp/CSharpListener.java b/languages/csharp/src/main/java/de/jplag/csharp/CSharpListener.java index 65d04d5b7..6cc568505 100644 --- a/languages/csharp/src/main/java/de/jplag/csharp/CSharpListener.java +++ b/languages/csharp/src/main/java/de/jplag/csharp/CSharpListener.java @@ -19,7 +19,6 @@ import static de.jplag.csharp.CSharpTokenType.CONTINUE; import static de.jplag.csharp.CSharpTokenType.DELEGATE; import static de.jplag.csharp.CSharpTokenType.DESTRUCTOR; -import static de.jplag.csharp.CSharpTokenType.DO; import static de.jplag.csharp.CSharpTokenType.ENUM; import static de.jplag.csharp.CSharpTokenType.ENUMERAL; import static de.jplag.csharp.CSharpTokenType.ENUM_BEGIN; @@ -28,8 +27,6 @@ import static de.jplag.csharp.CSharpTokenType.FIELD; import static de.jplag.csharp.CSharpTokenType.FINALLY; import static de.jplag.csharp.CSharpTokenType.FIXED; -import static de.jplag.csharp.CSharpTokenType.FOR; -import static de.jplag.csharp.CSharpTokenType.FOREACH; import static de.jplag.csharp.CSharpTokenType.GOTO; import static de.jplag.csharp.CSharpTokenType.IF; import static de.jplag.csharp.CSharpTokenType.IF_BEGIN; @@ -41,9 +38,12 @@ import static de.jplag.csharp.CSharpTokenType.INVOCATION; import static de.jplag.csharp.CSharpTokenType.LOCAL_VARIABLE; import static de.jplag.csharp.CSharpTokenType.LOCK; +import static de.jplag.csharp.CSharpTokenType.LOOP_BEGIN; +import static de.jplag.csharp.CSharpTokenType.LOOP_END; import static de.jplag.csharp.CSharpTokenType.METHOD; import static de.jplag.csharp.CSharpTokenType.METHOD_BEGIN; import static de.jplag.csharp.CSharpTokenType.METHOD_END; +import static de.jplag.csharp.CSharpTokenType.NAMESPACE; import static de.jplag.csharp.CSharpTokenType.NAMESPACE_BEGIN; import static de.jplag.csharp.CSharpTokenType.NAMESPACE_END; import static de.jplag.csharp.CSharpTokenType.OBJECT_CREATION; @@ -59,25 +59,39 @@ import static de.jplag.csharp.CSharpTokenType.TRY; import static de.jplag.csharp.CSharpTokenType.UNCHECKED; import static de.jplag.csharp.CSharpTokenType.UNSAFE; -import static de.jplag.csharp.CSharpTokenType.USING; import static de.jplag.csharp.CSharpTokenType.USING_DIRECTIVE; -import static de.jplag.csharp.CSharpTokenType.WHILE; - -import org.antlr.v4.runtime.Token; - +import static de.jplag.csharp.grammar.CSharpParser.ELSE; +import static de.jplag.csharp.grammar.CSharpParser.OP_ADD_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_AND_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_COALESCING_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_DEC; +import static de.jplag.csharp.grammar.CSharpParser.OP_DIV_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_INC; +import static de.jplag.csharp.grammar.CSharpParser.OP_MOD_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_MULT_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_OR_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_SUB_ASSIGNMENT; +import static de.jplag.csharp.grammar.CSharpParser.OP_XOR_ASSIGNMENT; + +import org.antlr.v4.runtime.ParserRuleContext; + +import de.jplag.antlr.AbstractAntlrListener; import de.jplag.csharp.grammar.CSharpParser.Accessor_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Accessor_declarationsContext; import de.jplag.csharp.grammar.CSharpParser.Array_initializerContext; import de.jplag.csharp.grammar.CSharpParser.Assignment_operatorContext; import de.jplag.csharp.grammar.CSharpParser.AttributeContext; +import de.jplag.csharp.grammar.CSharpParser.BodyContext; import de.jplag.csharp.grammar.CSharpParser.BreakStatementContext; -import de.jplag.csharp.grammar.CSharpParser.Catch_clausesContext; +import de.jplag.csharp.grammar.CSharpParser.CheckedExpressionContext; import de.jplag.csharp.grammar.CSharpParser.CheckedStatementContext; import de.jplag.csharp.grammar.CSharpParser.Class_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Class_definitionContext; +import de.jplag.csharp.grammar.CSharpParser.Common_member_declarationContext; import de.jplag.csharp.grammar.CSharpParser.Constant_declarationContext; import de.jplag.csharp.grammar.CSharpParser.Constructor_declarationContext; import de.jplag.csharp.grammar.CSharpParser.ContinueStatementContext; +import de.jplag.csharp.grammar.CSharpParser.Conversion_operator_declaratorContext; import de.jplag.csharp.grammar.CSharpParser.Delegate_definitionContext; import de.jplag.csharp.grammar.CSharpParser.Destructor_definitionContext; import de.jplag.csharp.grammar.CSharpParser.DoStatementContext; @@ -94,425 +108,160 @@ import de.jplag.csharp.grammar.CSharpParser.IfStatementContext; import de.jplag.csharp.grammar.CSharpParser.If_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Indexer_declarationContext; -import de.jplag.csharp.grammar.CSharpParser.Interface_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Interface_definitionContext; +import de.jplag.csharp.grammar.CSharpParser.Local_constant_declarationContext; import de.jplag.csharp.grammar.CSharpParser.Local_variable_declarationContext; import de.jplag.csharp.grammar.CSharpParser.LockStatementContext; import de.jplag.csharp.grammar.CSharpParser.Method_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Method_declarationContext; import de.jplag.csharp.grammar.CSharpParser.Method_invocationContext; import de.jplag.csharp.grammar.CSharpParser.Namespace_bodyContext; +import de.jplag.csharp.grammar.CSharpParser.Namespace_declarationContext; +import de.jplag.csharp.grammar.CSharpParser.Namespace_or_type_nameContext; import de.jplag.csharp.grammar.CSharpParser.Object_creation_expressionContext; import de.jplag.csharp.grammar.CSharpParser.Operator_declarationContext; import de.jplag.csharp.grammar.CSharpParser.Property_declarationContext; import de.jplag.csharp.grammar.CSharpParser.ReturnStatementContext; +import de.jplag.csharp.grammar.CSharpParser.Shift_expressionContext; +import de.jplag.csharp.grammar.CSharpParser.Specific_catch_clauseContext; import de.jplag.csharp.grammar.CSharpParser.Struct_bodyContext; import de.jplag.csharp.grammar.CSharpParser.Struct_definitionContext; import de.jplag.csharp.grammar.CSharpParser.SwitchStatementContext; import de.jplag.csharp.grammar.CSharpParser.Switch_sectionContext; import de.jplag.csharp.grammar.CSharpParser.ThrowStatementContext; import de.jplag.csharp.grammar.CSharpParser.TryStatementContext; +import de.jplag.csharp.grammar.CSharpParser.Type_argument_listContext; import de.jplag.csharp.grammar.CSharpParser.UncheckedExpressionContext; +import de.jplag.csharp.grammar.CSharpParser.UncheckedStatementContext; import de.jplag.csharp.grammar.CSharpParser.UnsafeStatementContext; -import de.jplag.csharp.grammar.CSharpParser.UsingStatementContext; -import de.jplag.csharp.grammar.CSharpParser.Using_directivesContext; +import de.jplag.csharp.grammar.CSharpParser.UsingAliasDirectiveContext; +import de.jplag.csharp.grammar.CSharpParser.UsingNamespaceDirectiveContext; +import de.jplag.csharp.grammar.CSharpParser.UsingStaticDirectiveContext; import de.jplag.csharp.grammar.CSharpParser.WhileStatementContext; -import de.jplag.csharp.grammar.CSharpParserBaseListener; /** - * Listener class for visiting the C# ANTLR parse tree. Transforms selected ANTLR token into JPlag tokens. - * @author Timur Saglam + * Extracts tokens for the {@link CSharpLanguage} */ -public class CSharpListener extends CSharpParserBaseListener { - - private final CSharpParserAdapter parserAdapter; - - /** - * Creates the listener. - * @param parserAdapter is the JPlag parser adapter which receives the transformed tokens. - */ - public CSharpListener(CSharpParserAdapter parserAdapter) { - this.parserAdapter = parserAdapter; - } - - /** - * Transforms an ANTLR Token into a JPlag token and transfers it to the token adapter. - * @param targetType is the type of the JPlag token to be created. - * @param token is the ANTLR token. - */ - private void transformToken(CSharpTokenType targetType, Token token) { - parserAdapter.addToken(targetType, token.getLine(), token.getCharPositionInLine() + 1, token.getText().length()); - } - - @Override - public void enterMethod_invocation(Method_invocationContext context) { - transformToken(INVOCATION, context.getStart()); - super.enterMethod_invocation(context); - } - - @Override - public void enterObject_creation_expression(Object_creation_expressionContext context) { - transformToken(OBJECT_CREATION, context.getStart()); - super.enterObject_creation_expression(context); - } - - @Override - public void enterArray_initializer(Array_initializerContext context) { - transformToken(ARRAY_CREATION, context.getStart()); - super.enterArray_initializer(context); - } - - @Override - public void enterAssignment_operator(Assignment_operatorContext context) { - transformToken(ASSIGNMENT, context.getStart()); - super.enterAssignment_operator(context); - } - - @Override - public void enterIfStatement(IfStatementContext context) { - transformToken(IF, context.getStart()); - super.enterIfStatement(context); - } - - @Override - public void enterIf_body(If_bodyContext context) { - transformToken(IF_BEGIN, context.getStart()); - super.enterIf_body(context); - } - - @Override - public void exitIf_body(If_bodyContext context) { - transformToken(IF_END, context.getStop()); - super.exitIf_body(context); - } - - @Override - public void enterSwitch_section(Switch_sectionContext context) { - transformToken(SWITCH_BEGIN, context.getStart()); - super.enterSwitch_section(context); - } - - @Override - public void exitSwitch_section(Switch_sectionContext context) { - transformToken(SWITCH_END, context.getStop()); - super.exitSwitch_section(context); - } - - @Override - public void enterSwitchStatement(SwitchStatementContext context) { - transformToken(CASE, context.getStart()); - super.enterSwitchStatement(context); - } - - @Override - public void enterDoStatement(DoStatementContext context) { - transformToken(DO, context.getStart()); - super.enterDoStatement(context); - } - - @Override - public void enterWhileStatement(WhileStatementContext context) { - transformToken(WHILE, context.getStart()); - super.enterWhileStatement(context); - } - - @Override - public void enterForStatement(ForStatementContext context) { - transformToken(FOR, context.getStart()); - super.enterForStatement(context); - } - - @Override - public void enterForeachStatement(ForeachStatementContext context) { - transformToken(FOREACH, context.getStart()); - super.enterForeachStatement(context); - } - - @Override - public void enterBreakStatement(BreakStatementContext context) { - transformToken(BREAK, context.getStart()); - super.enterBreakStatement(context); - } - - @Override - public void enterContinueStatement(ContinueStatementContext context) { - transformToken(CONTINUE, context.getStart()); - super.enterContinueStatement(context); - } - - @Override - public void enterGotoStatement(GotoStatementContext context) { - transformToken(GOTO, context.getStart()); - super.enterGotoStatement(context); - } - - @Override - public void enterReturnStatement(ReturnStatementContext context) { - transformToken(RETURN, context.getStart()); - super.enterReturnStatement(context); - } - - @Override - public void enterThrowStatement(ThrowStatementContext context) { - transformToken(THROW, context.getStart()); - super.enterThrowStatement(context); - } - - @Override - public void enterCheckedStatement(CheckedStatementContext context) { - transformToken(CHECKED, context.getStart()); - super.enterCheckedStatement(context); - } - - @Override - public void enterUncheckedExpression(UncheckedExpressionContext context) { - transformToken(UNCHECKED, context.getStart()); - super.enterUncheckedExpression(context); - } - - @Override - public void enterLockStatement(LockStatementContext context) { - transformToken(LOCK, context.getStart()); - super.enterLockStatement(context); - } - - @Override - public void enterUsingStatement(UsingStatementContext context) { - transformToken(USING, context.getStart()); - super.enterUsingStatement(context); - } - - @Override - public void enterTryStatement(TryStatementContext context) { - transformToken(TRY, context.getStart()); - super.enterTryStatement(context); - } - - @Override - public void enterCatch_clauses(Catch_clausesContext context) { - transformToken(CATCH, context.getStart()); - super.enterCatch_clauses(context); - } - - @Override - public void enterFinally_clause(Finally_clauseContext context) { - transformToken(FINALLY, context.getStart()); - super.enterFinally_clause(context); - } - - @Override - public void enterNamespace_body(Namespace_bodyContext context) { - transformToken(NAMESPACE_BEGIN, context.getStart()); - super.enterNamespace_body(context); - } - - @Override - public void exitNamespace_body(Namespace_bodyContext context) { - transformToken(NAMESPACE_END, context.getStop()); - super.exitNamespace_body(context); - } - - @Override - public void enterUsing_directives(Using_directivesContext context) { - transformToken(USING_DIRECTIVE, context.getStart()); - super.enterUsing_directives(context); - } - - @Override - public void enterClass_definition(Class_definitionContext context) { - transformToken(CLASS, context.getStart()); - super.enterClass_definition(context); - } - - @Override - public void enterClass_body(Class_bodyContext context) { - transformToken(CLASS_BEGIN, context.getStart()); - super.enterClass_body(context); - } - - @Override - public void exitClass_body(Class_bodyContext context) { - transformToken(CLASS_END, context.getStop()); - super.exitClass_body(context); - } - - @Override - public void enterMethod_declaration(Method_declarationContext context) { - transformToken(METHOD, context.getStart()); - super.enterMethod_declaration(context); - } - - @Override - public void enterMethod_body(Method_bodyContext context) { - transformToken(METHOD_BEGIN, context.getStart()); - super.enterMethod_body(context); - } - - @Override - public void exitMethod_body(Method_bodyContext context) { - transformToken(METHOD_END, context.getStop()); - super.exitMethod_body(context); - } - - @Override - public void enterProperty_declaration(Property_declarationContext context) { - transformToken(PROPERTY, context.getStart()); - super.enterProperty_declaration(context); - } - - @Override - public void enterEvent_declaration(Event_declarationContext context) { - transformToken(EVENT, context.getStart()); - super.enterEvent_declaration(context); - } - - @Override - public void enterIndexer_declaration(Indexer_declarationContext context) { - transformToken(INDEXER, context.getStart()); - super.enterIndexer_declaration(context); - } - - @Override - public void enterOperator_declaration(Operator_declarationContext context) { - transformToken(OPERATOR, context.getStart()); - super.enterOperator_declaration(context); - } - - @Override - public void enterConstructor_declaration(Constructor_declarationContext context) { - transformToken(CONSTRUCTOR, context.getStart()); - super.enterConstructor_declaration(context); - } - - @Override - public void enterDestructor_definition(Destructor_definitionContext context) { - transformToken(DESTRUCTOR, context.getStart()); - super.enterDestructor_definition(context); - } - - @Override - public void enterStruct_definition(Struct_definitionContext context) { - transformToken(STRUCT, context.getStart()); - super.enterStruct_definition(context); - } - - @Override - public void enterStruct_body(Struct_bodyContext context) { - transformToken(STRUCT_BEGIN, context.getStart()); - super.enterStruct_body(context); - } - - @Override - public void exitStruct_body(Struct_bodyContext context) { - transformToken(STRUCT_END, context.getStop()); - super.exitStruct_body(context); - } - - @Override - public void enterInterface_definition(Interface_definitionContext context) { - transformToken(INTERFACE, context.getStart()); - super.enterInterface_definition(context); - } - - @Override - public void enterInterface_body(Interface_bodyContext context) { - transformToken(INTERFACE_BEGIN, context.getStart()); - super.enterInterface_body(context); - } - - @Override - public void exitInterface_body(Interface_bodyContext context) { - transformToken(INTERFACE_END, context.getStart()); - super.exitInterface_body(context); - } - - @Override - public void enterEnum_definition(Enum_definitionContext context) { - transformToken(ENUM, context.getStart()); - super.enterEnum_definition(context); - } - - @Override - public void enterEnum_body(Enum_bodyContext context) { - transformToken(ENUM_BEGIN, context.getStart()); - super.enterEnum_body(context); - } - - @Override - public void exitEnum_body(Enum_bodyContext context) { - transformToken(ENUM_END, context.getStop()); - super.exitEnum_body(context); - } - - @Override - public void enterEnum_member_declaration(Enum_member_declarationContext context) { - transformToken(ENUMERAL, context.getStart()); - super.enterEnum_member_declaration(context); - } - - @Override - public void enterAttribute(AttributeContext context) { - transformToken(ATTRIBUTE, context.getStart()); - super.enterAttribute(context); - } - - @Override - public void enterDelegate_definition(Delegate_definitionContext context) { - transformToken(DELEGATE, context.getStart()); - super.enterDelegate_definition(context); - } - - @Override - public void enterUnsafeStatement(UnsafeStatementContext context) { - transformToken(UNSAFE, context.getStart()); - super.enterUnsafeStatement(context); - } - - @Override - public void enterFixedStatement(FixedStatementContext context) { - transformToken(FIXED, context.getStart()); - super.enterFixedStatement(context); - } - - @Override - public void enterAccessor_declarations(Accessor_declarationsContext context) { - transformToken(ACCESSORS_BEGIN, context.getStart()); - super.enterAccessor_declarations(context); - } - - @Override - public void exitAccessor_declarations(Accessor_declarationsContext context) { - transformToken(ACCESSORS_END, context.getStart()); - super.enterAccessor_declarations(context); - } - - @Override - public void enterAccessor_body(Accessor_bodyContext context) { - transformToken(ACCESSOR_BEGIN, context.getStart()); - super.enterAccessor_body(context); - } - - @Override - public void exitAccessor_body(Accessor_bodyContext context) { - transformToken(ACCESSOR_END, context.getStart()); - super.exitAccessor_body(context); - } - - @Override - public void enterConstant_declaration(Constant_declarationContext context) { - transformToken(CONSTANT, context.getStart()); - super.enterConstant_declaration(context); - } - - @Override - public void enterField_declaration(Field_declarationContext context) { - transformToken(FIELD, context.getStart()); - super.enterField_declaration(context); +public class CSharpListener extends AbstractAntlrListener { + public CSharpListener() { + visit(UsingNamespaceDirectiveContext.class).map(USING_DIRECTIVE); + visit(UsingAliasDirectiveContext.class, this::isAliasUsageAlsoImport).map(USING_DIRECTIVE); + visit(UsingStaticDirectiveContext.class).map(USING_DIRECTIVE); + + visit(Method_invocationContext.class).map(INVOCATION); + visit(Object_creation_expressionContext.class).map(OBJECT_CREATION); + visit(Array_initializerContext.class).map(ARRAY_CREATION); + visit(Assignment_operatorContext.class).map(ASSIGNMENT); + visit(IfStatementContext.class).map(IF); + visit(ELSE).map(IF); + visit(If_bodyContext.class).map(IF_BEGIN, IF_END); + visit(Switch_sectionContext.class).map(SWITCH_BEGIN, SWITCH_END); + visit(SwitchStatementContext.class).map(CASE); + + visit(DoStatementContext.class).map(LOOP_BEGIN, LOOP_END); + visit(WhileStatementContext.class).map(LOOP_BEGIN, LOOP_END); + visit(ForStatementContext.class).map(LOOP_BEGIN, LOOP_END); + visit(ForeachStatementContext.class).map(LOOP_BEGIN, LOOP_END); + + visit(BreakStatementContext.class).map(BREAK); + visit(ContinueStatementContext.class).map(CONTINUE); + visit(GotoStatementContext.class).map(GOTO); + + visit(ReturnStatementContext.class).map(RETURN); + visit(ThrowStatementContext.class).map(THROW); + + visit(CheckedStatementContext.class).map(CHECKED); + visit(CheckedExpressionContext.class).map(CHECKED); + visit(UncheckedStatementContext.class).map(UNCHECKED); + visit(UncheckedExpressionContext.class).map(UNCHECKED); + + visit(LockStatementContext.class).map(LOCK); + + visit(TryStatementContext.class).map(TRY); + visit(Specific_catch_clauseContext.class).map(CATCH); + visit(Finally_clauseContext.class).map(FINALLY); + + visit(Namespace_declarationContext.class).map(NAMESPACE); + visit(Namespace_bodyContext.class).map(NAMESPACE_BEGIN, NAMESPACE_END); + visit(Class_definitionContext.class).map(CLASS); + visit(Class_bodyContext.class, this::isClassBody).map(CLASS_BEGIN, CLASS_END); + visit(Method_declarationContext.class).map(METHOD); + visit(Method_bodyContext.class).map(METHOD_BEGIN, METHOD_END); + visit(Property_declarationContext.class).map(PROPERTY); + visit(Event_declarationContext.class).map(EVENT); + visit(Indexer_declarationContext.class).map(INDEXER); + visit(Operator_declarationContext.class).map(OPERATOR); + visit(BodyContext.class, this::isOperatorBody).map(METHOD_BEGIN, METHOD_END); + visit(Conversion_operator_declaratorContext.class).map(OPERATOR); + visit(BodyContext.class, this::isConversionOperatorBody).map(METHOD_BEGIN, METHOD_END); + visit(Constructor_declarationContext.class).map(CONSTRUCTOR); + visit(BodyContext.class, this::isConstructorBody).map(METHOD_BEGIN, METHOD_END); + visit(Destructor_definitionContext.class).map(DESTRUCTOR); + visit(Struct_definitionContext.class).map(STRUCT); + visit(Struct_bodyContext.class).map(STRUCT_BEGIN, STRUCT_END); + visit(Interface_definitionContext.class).map(INTERFACE); + visit(Class_bodyContext.class, this::isInterfaceBody).map(INTERFACE_BEGIN, INTERFACE_END); + visit(Enum_definitionContext.class).map(ENUM); + visit(Enum_bodyContext.class).map(ENUM_BEGIN, ENUM_END); + visit(Enum_member_declarationContext.class).map(ENUMERAL); + visit(AttributeContext.class).map(ATTRIBUTE); + visit(Delegate_definitionContext.class).map(DELEGATE); + visit(UnsafeStatementContext.class).map(UNSAFE); + visit(FixedStatementContext.class).map(FIXED); + visit(Accessor_declarationsContext.class).map(ACCESSORS_BEGIN, ACCESSORS_END); + visit(Accessor_bodyContext.class).map(ACCESSOR_BEGIN, ACCESSOR_END); + visit(Constant_declarationContext.class).map(CONSTANT); + visit(Field_declarationContext.class).map(FIELD); + visit(Local_variable_declarationContext.class).map(LOCAL_VARIABLE); + visit(Local_constant_declarationContext.class).map(LOCAL_VARIABLE); + + registerUnaryOperatorVisitors(); + } + + private void registerUnaryOperatorVisitors() { + visit(OP_DEC).map(ASSIGNMENT); + visit(OP_INC).map(ASSIGNMENT); + + visit(Shift_expressionContext.class, expr -> expr.additive_expression().size() == 2).map(ASSIGNMENT); + + visit(OP_ADD_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_SUB_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_AND_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_DIV_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_MOD_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_OR_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_XOR_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_MULT_ASSIGNMENT).map(ASSIGNMENT); + visit(OP_COALESCING_ASSIGNMENT).map(ASSIGNMENT); + } + + private boolean isClassBody(ParserRuleContext context) { + return hasAncestor(context, Class_definitionContext.class, Interface_definitionContext.class); + } + + private boolean isInterfaceBody(ParserRuleContext context) { + return hasAncestor(context, Interface_definitionContext.class, Class_definitionContext.class); + } + + private boolean isConstructorBody(BodyContext context) { + return context.parent instanceof Constructor_declarationContext; + } + + private boolean isOperatorBody(BodyContext context) { + return context.parent instanceof Operator_declarationContext; + } + + private boolean isConversionOperatorBody(BodyContext context) { + if (!(context.parent instanceof Common_member_declarationContext parent)) { + return false; + } + + return parent.conversion_operator_declarator() != null; } - @Override - public void enterLocal_variable_declaration(Local_variable_declarationContext context) { - transformToken(LOCAL_VARIABLE, context.getStart()); - super.enterLocal_variable_declaration(context); + private boolean isAliasUsageAlsoImport(UsingAliasDirectiveContext context) { + Namespace_or_type_nameContext namespace = getDescendant(context, Namespace_or_type_nameContext.class); + + return namespace != null && (!namespace.DOT().isEmpty() && getDescendant(namespace, Type_argument_listContext.class) == null); } } diff --git a/languages/csharp/src/main/java/de/jplag/csharp/CSharpParserAdapter.java b/languages/csharp/src/main/java/de/jplag/csharp/CSharpParserAdapter.java index 3b2b0d8a2..7d0b8951d 100644 --- a/languages/csharp/src/main/java/de/jplag/csharp/CSharpParserAdapter.java +++ b/languages/csharp/src/main/java/de/jplag/csharp/CSharpParserAdapter.java @@ -1,80 +1,37 @@ package de.jplag.csharp; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ParseTree; -import org.antlr.v4.runtime.tree.ParseTreeWalker; -import de.jplag.AbstractParser; -import de.jplag.ParsingException; -import de.jplag.Token; -import de.jplag.TokenType; +import de.jplag.antlr.AbstractAntlrListener; +import de.jplag.antlr.AbstractAntlrParserAdapter; import de.jplag.csharp.grammar.CSharpLexer; import de.jplag.csharp.grammar.CSharpParser; -import de.jplag.util.FileUtils; /** * Parser adapter for the ANTLR 4 CSharp Parser and Lexer. It receives file to parse and passes them to the ANTLR * pipeline. Then it walks the produced parse tree and creates JPlag token with the {@link CSharpListener}. - * @author Timur Saglam */ -public class CSharpParserAdapter extends AbstractParser { - private List tokens; - private File currentFile; - - /** - * Creates the parser adapter. - */ - public CSharpParserAdapter() { - super(); +public class CSharpParserAdapter extends AbstractAntlrParserAdapter { + @Override + protected Lexer createLexer(CharStream input) { + return new CSharpLexer(input); } - /** - * Parses all tokens from a set of files. - * @param files is the set of files. - * @return the list of parsed tokens. - */ - public List parse(Set files) throws ParsingException { - tokens = new ArrayList<>(); - for (File file : files) { - parseFile(file); - tokens.add(Token.fileEnd(file)); - } - return tokens; + @Override + protected CSharpParser createParser(CommonTokenStream tokenStream) { + return new CSharpParser(tokenStream); } - private void parseFile(File file) throws ParsingException { - try (BufferedReader reader = FileUtils.openFileReader(file)) { - currentFile = file; - - // create a lexer, a parser and a buffer between them. - CSharpLexer lexer = new CSharpLexer(CharStreams.fromReader(reader)); - CommonTokenStream tokens = new CommonTokenStream(lexer); - CSharpParser parser = new CSharpParser(tokens); - - // Create a tree walker and the entry context defined by the parser grammar - ParserRuleContext entryContext = parser.compilation_unit(); - ParseTreeWalker treeWalker = new ParseTreeWalker(); - - // Walk over the parse tree: - for (int i = 0; i < entryContext.getChildCount(); i++) { - ParseTree parseTree = entryContext.getChild(i); - treeWalker.walk(new CSharpListener(this), parseTree); - } - } catch (IOException exception) { - throw new ParsingException(file, exception.getMessage(), exception); - } + @Override + protected ParserRuleContext getEntryContext(CSharpParser parser) { + return parser.compilation_unit(); } - /* package-private */ void addToken(TokenType type, int line, int column, int length) { - tokens.add(new Token(type, currentFile, line, column, length)); + @Override + protected AbstractAntlrListener getListener() { + return new CSharpListener(); } } diff --git a/languages/csharp/src/main/java/de/jplag/csharp/CSharpTokenType.java b/languages/csharp/src/main/java/de/jplag/csharp/CSharpTokenType.java index f8d6a4347..3895ed55e 100644 --- a/languages/csharp/src/main/java/de/jplag/csharp/CSharpTokenType.java +++ b/languages/csharp/src/main/java/de/jplag/csharp/CSharpTokenType.java @@ -17,10 +17,6 @@ public enum CSharpTokenType implements TokenType { SWITCH_BEGIN("SWITCH{"), SWITCH_END("}SWITCH"), CASE("CASE"), - DO("DO"), - WHILE("WHILE"), - FOR("FOR"), - FOREACH("FOREACH"), BREAK("BREAK"), CONTINUE("CONTINUE"), GOTO("GOTO"), @@ -29,10 +25,10 @@ public enum CSharpTokenType implements TokenType { CHECKED("CHECKED"), UNCHECKED("UNCHECKED"), LOCK("LOCK"), - USING("USING"), TRY("TRY"), CATCH("CATCH"), FINALLY("FINALLY"), + NAMESPACE("NAMESPACE"), NAMESPACE_BEGIN("NAMESPACE{"), NAMESPACE_END("}NAMESPACE"), USING_DIRECTIVE("USING"), @@ -67,7 +63,10 @@ public enum CSharpTokenType implements TokenType { ACCESSORS_BEGIN("ACCESSORS{"), ACCESSORS_END("}ACCESSORS"), ACCESSOR_BEGIN("ACCESSOR{"), - ACCESSOR_END("}ACCESSOR"); + ACCESSOR_END("}ACCESSOR"), + + LOOP_BEGIN("LOOP{"), + LOOP_END("}LOOP"); private final String description; diff --git a/languages/csharp/src/test/java/de/jplag/csharp/CSharpTest.java b/languages/csharp/src/test/java/de/jplag/csharp/CSharpTest.java new file mode 100644 index 000000000..2acbe4d98 --- /dev/null +++ b/languages/csharp/src/test/java/de/jplag/csharp/CSharpTest.java @@ -0,0 +1,56 @@ +package de.jplag.csharp; + +import static de.jplag.csharp.CSharpTokenType.ACCESSORS_BEGIN; +import static de.jplag.csharp.CSharpTokenType.ACCESSORS_END; +import static de.jplag.csharp.CSharpTokenType.ACCESSOR_BEGIN; +import static de.jplag.csharp.CSharpTokenType.ACCESSOR_END; +import static de.jplag.csharp.CSharpTokenType.ASSIGNMENT; +import static de.jplag.csharp.CSharpTokenType.CLASS; +import static de.jplag.csharp.CSharpTokenType.CLASS_BEGIN; +import static de.jplag.csharp.CSharpTokenType.CLASS_END; +import static de.jplag.csharp.CSharpTokenType.CONSTRUCTOR; +import static de.jplag.csharp.CSharpTokenType.FIELD; +import static de.jplag.csharp.CSharpTokenType.IF; +import static de.jplag.csharp.CSharpTokenType.IF_BEGIN; +import static de.jplag.csharp.CSharpTokenType.IF_END; +import static de.jplag.csharp.CSharpTokenType.INVOCATION; +import static de.jplag.csharp.CSharpTokenType.LOCAL_VARIABLE; +import static de.jplag.csharp.CSharpTokenType.METHOD; +import static de.jplag.csharp.CSharpTokenType.METHOD_BEGIN; +import static de.jplag.csharp.CSharpTokenType.METHOD_END; +import static de.jplag.csharp.CSharpTokenType.PROPERTY; +import static de.jplag.csharp.CSharpTokenType.RETURN; + +import de.jplag.testutils.LanguageModuleTest; +import de.jplag.testutils.datacollector.TestDataCollector; +import de.jplag.testutils.datacollector.TestSourceIgnoredLinesCollector; + +public class CSharpTest extends LanguageModuleTest { + public CSharpTest() { + super(new CSharpLanguage(), CSharpTokenType.class); + } + + @Override + protected void collectTestData(TestDataCollector collector) { + collector.testFile("TestClass.cs").testSourceCoverage().testTokenSequence(CLASS, CLASS_BEGIN, FIELD, CONSTRUCTOR, METHOD_BEGIN, + LOCAL_VARIABLE, METHOD_END, METHOD, METHOD_BEGIN, IF, IF_BEGIN, INVOCATION, IF_END, IF, IF_BEGIN, INVOCATION, IF_END, METHOD_END, + PROPERTY, ACCESSORS_BEGIN, ACCESSOR_BEGIN, ACCESSOR_END, ACCESSOR_BEGIN, ACCESSOR_END, ACCESSORS_END, FIELD, PROPERTY, + ACCESSORS_BEGIN, ACCESSOR_BEGIN, RETURN, ACCESSOR_END, ACCESSOR_BEGIN, ASSIGNMENT, ACCESSOR_END, ACCESSORS_END, CLASS_END); + + collector.testFile("AllInOneNoPreprocessor.cs").testSourceCoverage().testTokenCoverage(); + } + + @Override + protected void configureIgnoredLines(TestSourceIgnoredLinesCollector collector) { + collector.ignoreMultipleLines("/*", "*/"); + collector.ignoreLinesByPrefix("//"); + collector.ignoreLinesByRegex(".*//test-ignore"); + + // Using (import) as alias + collector.ignoreLinesByRegex("using.*=.*<.*>.*;"); + collector.ignoreLinesByRegex("using.*=[^.]+;"); + + collector.ignoreLinesByPrefix("extern"); + collector.ignoreByCondition(line -> line.trim().matches("[a-zA-Z0-9]+:.*")); + } +} diff --git a/languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpTest.java b/languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpTest.java deleted file mode 100644 index e4f710ab0..000000000 --- a/languages/csharp/src/test/java/de/jplag/csharp/MinimalCSharpTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package de.jplag.csharp; - -import static de.jplag.csharp.CSharpTokenType.ACCESSORS_BEGIN; -import static de.jplag.csharp.CSharpTokenType.ACCESSORS_END; -import static de.jplag.csharp.CSharpTokenType.ACCESSOR_BEGIN; -import static de.jplag.csharp.CSharpTokenType.ACCESSOR_END; -import static de.jplag.csharp.CSharpTokenType.ASSIGNMENT; -import static de.jplag.csharp.CSharpTokenType.CLASS; -import static de.jplag.csharp.CSharpTokenType.CLASS_BEGIN; -import static de.jplag.csharp.CSharpTokenType.CLASS_END; -import static de.jplag.csharp.CSharpTokenType.CONSTRUCTOR; -import static de.jplag.csharp.CSharpTokenType.FIELD; -import static de.jplag.csharp.CSharpTokenType.IF; -import static de.jplag.csharp.CSharpTokenType.IF_BEGIN; -import static de.jplag.csharp.CSharpTokenType.IF_END; -import static de.jplag.csharp.CSharpTokenType.INVOCATION; -import static de.jplag.csharp.CSharpTokenType.LOCAL_VARIABLE; -import static de.jplag.csharp.CSharpTokenType.METHOD; -import static de.jplag.csharp.CSharpTokenType.METHOD_BEGIN; -import static de.jplag.csharp.CSharpTokenType.METHOD_END; -import static de.jplag.csharp.CSharpTokenType.PROPERTY; -import static de.jplag.csharp.CSharpTokenType.RETURN; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.nio.file.Path; -import java.util.List; -import java.util.Set; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import de.jplag.ParsingException; -import de.jplag.SharedTokenType; -import de.jplag.Token; -import de.jplag.TokenPrinter; -import de.jplag.TokenType; - -class MinimalCSharpTest { - private final Logger logger = LoggerFactory.getLogger(MinimalCSharpTest.class); - - private static final Path BASE_PATH = Path.of("src", "test", "resources", "de", "jplag", "csharp"); - private static final String TEST_SUBJECT = "TestClass.cs"; - - private de.jplag.Language language; - private File baseDirectory; - - @BeforeEach - public void setUp() { - language = new CSharpLanguage(); - baseDirectory = BASE_PATH.toFile(); - assertTrue(baseDirectory.exists(), "Could not find base directory!"); - } - - @Test - void testParsingTestClass() throws ParsingException { - List expectedToken = List.of(CLASS, CLASS_BEGIN, FIELD, CONSTRUCTOR, LOCAL_VARIABLE, METHOD, METHOD_BEGIN, IF, IF_BEGIN, - INVOCATION, IF_END, IF_BEGIN, INVOCATION, IF_END, METHOD_END, PROPERTY, ACCESSORS_BEGIN, ACCESSOR_BEGIN, ACCESSOR_END, ACCESSOR_BEGIN, - ACCESSOR_END, ACCESSORS_END, FIELD, PROPERTY, ACCESSORS_BEGIN, ACCESSOR_BEGIN, RETURN, ACCESSOR_END, ACCESSOR_BEGIN, ASSIGNMENT, - ACCESSOR_END, ACCESSORS_END, CLASS_END, SharedTokenType.FILE_END); - - // Parse test input - List result = language.parse(Set.of(new File(baseDirectory, TEST_SUBJECT))); - logger.info(TokenPrinter.printTokens(result, baseDirectory)); - - // Compare parsed tokens: - assertEquals(expectedToken.size(), result.size()); - List actualToken = result.stream().map(Token::getType).toList(); - assertEquals(expectedToken, actualToken); - } - -} diff --git a/languages/csharp/src/test/resources/de/jplag/csharp/AllInOneNoPreprocessor.cs b/languages/csharp/src/test/resources/de/jplag/csharp/AllInOneNoPreprocessor.cs new file mode 100644 index 000000000..b819b136b --- /dev/null +++ b/languages/csharp/src/test/resources/de/jplag/csharp/AllInOneNoPreprocessor.cs @@ -0,0 +1,1050 @@ +//From https://github.com/antlr/grammars-v4/tree/master/csharp/examples + +extern alias Foo; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Text; +using M = System.Math; + +using ConsoleApplication2.Test; + +/**/ +/* the previous comment is an empty delimited comment and not a document comment */ +/** this is a document comment */ +// this one is a single line comment + +using X = int1; +using Y = ABC.X; + +using static System.Math; +using static System.DayOfWeek; +using static System.Linq.Enumerable; + +[assembly: System.Copyright(@"(C)""2009")] +[module: System.Copyright("\n\t\u0123(C) \"2009" + "\u0123")] + +class TopLevelType : IDisposable +{ + void IDisposable.Dispose() { } +} + +namespace My +{ + using A.B; + + interface CoContra { } + delegate void CoContra2<[System.Obsolete()] out T, in K> () where T : struct; + + public unsafe partial class A : C, I + { + [DllImport("kernel32", SetLastError = true)] + static extern bool CreateDirectory(string name, SecurityAttribute sa); + + private const int global = int.MinValue - 1; + + static A() + { + } + + [method: Obsolete] + public A([param: Obsolete] int foo) : base(1) { + L: { //test-ignore + int i = sizeof(int); + ++i; + var s1 = $"x {1 , -2 :d}"; + var s2 = $@"x {1 , -2 :d}"; + } //test-ignore + + + Console.WriteLine(export.iefSupplied.command); + + const int? local = int.MaxValue; + const Guid? local0 = new Guid(r.ToString()); + + var привет = local; + var мир = local; + int local3 = 0, local4 = 1; + local3 = local4 = 1; + var local5 = null as Action ?? null; + var local6 = local5 is Action; + + var u = 1u; + var U = 1U; + long hex = 0xBADC0DE, Hex = 0XDEADBEEF, l = -1L, L = 1L, l2 = 2l; + ulong ul = 1ul, Ul = 1Ul, uL = 1uL, UL = 1UL, lu = 1lu, Lu = 1Lu, lU = 1lU, LU = 1LU; + int minInt32Value = -2147483648; + int minInt64Value = -9223372036854775808L; + + bool @bool; + byte @byte; + char @char = 'c', \u0066 = '\u0066', hexchar = '\x0130', hexchar2 = (char)0xBAD; + string \U00000065 = "\U00000065"; + decimal @decimal = 1.44M; + @decimal = 1.2m; + dynamic @dynamic; + double @double = M.PI; + @double = 1d; + @double = 1D; + @double = -1.2e3; + float @float = 1.2f; + @float = 1.44F; + int @int = local ?? -1; + long @long; + object @object; + sbyte @sbyte; + short @short; + string @string = @"""/*"; + uint @uint; + ulong @ulong; + ushort @ushort; + + dynamic dynamic = local5; + var add = 0; + var alias = 0; + var arglist = 0; + var ascending = 0; + var async = 0; + var await = 0; + var by = 0; + var descending = 0; + var dynamic = 0; + var equals = 0; + var from = 0; + var get = 0; + var group = 0; + var into = 0; + var join = 0; + var let = 0; + var nameof = 0; + var on = 0; + var orderby = 0; + var partial = 0; + var remove = 0; + var select = 0; + var set = 0; + var var = 0; + var when = 0; + var where = 0; + var yield = 0; + var __ = 0; + where = yield = 0; + + if (i > 0) + { + return; + } + else if (i == 0) + { + throw new Exception(); + } + var o1 = new MyObject(); + var o2 = new MyObject(var); + var o3 = new MyObject { A = i }; + var o4 = new MyObject(@dynamic) + { A = 0, B = 0, C = 0 };//test-ignore + var o5 = new { A = 0 }; + var dictionaryInitializer = new Dictionary + { //test-ignore + {1, ""}, //test-ignore + {2, "a"} //test-ignore + };//test-ignore + float[] a = new float[] + { 0f, 1.1f };//test-ignore + int[, ,] cube = { { { 111, 112, }, { 121, 122 } }, { { 211, 212 }, { 221, 222 } } }; + int[][] jagged = { { 111 }, { 121, 122 } }; + int[][,] arr = new int[5][,]; // as opposed to new int[][5,5] + arr[0] = new int[5,5]; // as opposed to arr[0,0] = new int[5]; + arr[0][0,0] = 47; + int[] arrayTypeInference = new[] { 0, 1, }; + switch (3) { } + switch (i) + {//test-ignore + case 0: case 1: + {//test-ignore + goto case 2; + }//test-ignore + case 2 + 3: + {//test-ignore + goto default; + break; + }//test-ignore + default: + {//test-ignore + return; + }//test-ignore + }//test-ignore + while (i < 10) { + ++i; + if (true) continue; + break; + } + do { + ++i; + if (true) continue; + break; + } while (i < 10); + for (int j = 0; j < 100; ++j) { + for(;;) { + for (int i = 0, j = 0; i < length; i++, j++) { } + if (true) continue; + break; + } + } + label: + goto label; + label2: ; + foreach (var i in Items()) { + if (i == 7) + return; + else + continue; + } + checked + {//test-ignore + checked(++i); + }//test-ignore + unchecked + {//test-ignore + unchecked(++i); + }//test-ignore + lock (sync) + process(); + using (var v = BeginScope()) + using (A a = new A()) + using (A a = new A(), b = new A()) + using (BeginScope()) + return; + yield return this.items[3];//test-ignore + yield break; //test-ignore + fixed (int* p = stackalloc int[100], q = &y) + { //test-ignore + *intref = 1; + } //test-ignore + fixed (int* p = stackalloc int[100]) + { //test-ignore + *intref = 1; + } //test-ignore + unsafe + { //test-ignore + int* p = null; + } //test-ignore + try + { //test-ignore + throw null; + } //test-ignore + catch (System.AccessViolationException av) + { //test-ignore + throw av; + } //test-ignore + catch (Exception) + { //test-ignore + throw; + } //test-ignore + finally + { //test-ignore + try { } catch { } + } //test-ignore + var anonymous = + { + A = 1, + B = 2, + C = 3, + }; //test-ignore + var query = from c in customers + let d = c//test-ignore + where d != null//test-ignore + join c1 in customers on c1.GetHashCode() equals c.GetHashCode() + join c1 in customers on c1.GetHashCode() equals c.GetHashCode() into e + group c by c.Country//test-ignore + into g //test-ignore + orderby g.Count() ascending + orderby g.Key descending //test-ignore + select new { Country = g.Key, CustCount = g.Count() }; + query = from c in customers + select c into d//test-ignore + select d;//test-ignore + } + ~A() + { //test-ignore + } //test-ignore + private readonly int f1; + [Obsolete] + [NonExisting] + [Foo::NonExisting(var, 5)] + [CLSCompliant(false)] + [Obsolete, System.NonSerialized, NonSerialized, CLSCompliant(true || false & true)] + private volatile int f2; + [return: Obsolete] + [method: Obsolete] + public void Handler(object value) + { + } + public int m(T t) where T : class, new() + { + base.m(t); + return 1; + } + public string P + { //test-ignore + get + { + return "A"; + } + set; + } //test-ignore + public abstract string P + { //test-ignore + get; + } //test-ignore + public abstract int this[int index] + { //test-ignore + protected internal get; + internal protected set; + } //test-ignore + [method: Obsolete] + [field: Obsolete] + [event: Obsolete] + public readonly event Event E; + [event: Test] + public event Action E1 + { //test-ignore + [Obsolete] + add { value = value; } + [Obsolete] + [return: Obsolete] + remove { E += Handler; E -= Handler; } + } //test-ignore + public static A operator +(A first, A second) + { + Delegate handler = new Delegate(Handler); + return first.Add(second); + } + [method: Obsolete] + [return: Obsolete] + public static bool operator true(A a) + { + return true; + } + public static bool operator false(A a) + { + return false; + } + class C + { + } + } + public struct S : I + { + public S() + { + } + private int f1; + [Obsolete("Use Script instead", error: false)] + private volatile int f2; + public abstract int m(T t) where T : struct + { + return 1; + } + public string P + { //test-ignore + get + { + int value = 0; + return "A"; + } + set; + } //test-ignore + public abstract string P + { //test-ignore + get; + } //test-ignore + public abstract int this[int index] + { //test-ignore + get; + internal protected set; + } //test-ignore + public event Event E; + public static A operator +(A first, A second) + { + return first.Add(second); + } + fixed int field[10];//test-ignore + class C + { + } + } + public interface I + { + void A(int value); + string Value + { //test-ignore + get; + set; + } //test-ignore + unsafe void UpdateSignatureByHashingContent([In]byte* buffer, int size); + } + [type: Flags] + public enum E + { + A, + B = A, + C = 2 + A, + D, + } + + public delegate void Delegate(object P); + namespace Test + { + using System; + using System.Collections; + public class Список + { + public static IEnumerable Power(int number, int exponent) + { + Список Список = new Список(); + Список.Main(); + int counter = (0 + 0); + int אתר = 0; + while (++counter++ < --exponent--) { + result = result * number + +number+++++number; + yield return result;//test-ignore + } + } + static void Main() + { + foreach (int i in Power(2, 8)) + { //test-ignore + Console.Write("{0} ", i); + } + } + async void Wait() + { + await System.Threading.Tasks.Task.Delay(0); + } + void AsyncAnonymous() // C # 5 feature + { + var task = Task.Factory.StartNew(async () => + { //test-ignore + return await new WebClient().DownloadStringTaskAsync("http://example.com"); + }); //test-ignore + } + } + } +} + +namespace ConsoleApplication1 +{ + namespace RecursiveGenericBaseType + { + class A : B, A> where T : A + { + protected virtual A M() { } + protected abstract B, A> N() { } + static B, A> O() { } + } + + sealed class B : A> + { + protected override A M() { } + protected sealed override B, A> N() { } + new static A O() { } + } + } + + namespace Boo + { + public class Bar where T : IComparable + { + public T f; + public class Foo : IEnumerable + { + public void Method(K k, T t, U u) + where K : IList, IList, IList //test-ignore + where V : IList //test-ignore + { + A a; + M(A(5)); + } + }; + }; + }; + + class Test + { + void Bar3() + { + var x = new Boo.Bar.Foo(); + x.Method(" ", 5, new object()); + + var q = from i in new int[] { 1, 2, 3, 4 } + where i > 5//test-ignore + select i;//test-ignore + } + + public static implicit operator Test(string s) + { + return new ConsoleApplication1.Test(); + } + public static explicit operator Test(string s = "") + { + return new Test(); + } + + public int foo = 5; + void Bar2() + { + foo = 6; + this.Foo = 5.GetType(); Test t = "sss"; + } + + public event EventHandler MyEvent = delegate { }; + + void Blah() + { + int i = 5; + int? j = 6; + + Expression> e = () => i; + Expression> e2 = b => () => { return; }; + Func f = async delegate (bool a) + { //test-ignore + return await !a; + }; //test-ignore + Func f2 = (a, b) => 0; + f2 = (int a, int b) => 1; + Action a = Blah; + f2 = () => {}; + f2 = () => {;}; + } + + delegate Recursive Recursive(Recursive r); + delegate Recursive Recursive(Recursive r); + + public Type Foo { + [Obsolete("Name", error = false)] + get//test-ignore + { + var result = typeof(IEnumerable); + var t = typeof(int?) == typeof(Nullable); + t = typeof(IEnumerable); + return typeof(IEnumerable<>); + } + set//test-ignore + { + var t = typeof(System.Int32); + t.ToString(); + t = value; + } + }//test-ignore + + public void Constants() + { + int i = 1 + 2 + 3 + 5; + global::System.String s = "a" + (System.String)"a" + "a" + "a" + "a" + "A"; + } + + public void ConstructedType() + { + List i = null; + int c = i.Count; + } + } +} + +namespace Comments.XmlComments.UndocumentedKeywords +{ + /// + /// Whatever + /// + /// + /// // + /// /* */ + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + class /*///*/C + { + void M(T t, U u) + { + // comment + /* *** / */ + /* // + */ + /*s*///comment + // /***/ + /*s*/int /*s*/intValue = 0; + intValue = intValue /*s*/+ 1; + string strValue = /*s*/"hello"; + /*s*/MyClass c = new MyClass(); + string verbatimStr = /*s*/@"\\\\"; + } + } + + //General Test F. Type a very long class name, verify colorization happens correctly only upto the correct size (118324) + class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*Scen8*/{ } + + class TestClassXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22/*Scen9*/{ } + + class yield + { + void Foo(__arglist) + { + C c = null; + c.M(5, default(U)); + TypedReference tr = __makeref(c); + Type t = __reftype(tr); + int j = __refvalue(tr, int); + Params(a: t, b: t); + Params(ref c, out c); + } + void Params(ref dynamic a, out dynamic b, params dynamic[] c) {} + void Params(out dynamic a = 2, ref dynamic c = default(dynamic), params dynamic[][] c) {} + + public override string ToString() { return base.ToString(); } + + public partial void OnError(); + + public partial void method() + { + int?[] a = new int?[5];/*[] bug*/ // YES [] + int[] var = { 1, 2, 3, 4, 5 };/*,;*/ + int i = a[i];/*[]*/ + Foo f = new Foo();/*<> ()*/ + f.method();/*().*/ + i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ + bool b = true & false | true ^ false;/*& | ^*/ + b = !b;/*!*/ + i = ~i;/*~i*/ + b = i < i && i > i;/*< && >*/ + int? ii = 5;/*? bug*/ // NO ? + int f = true ? 1 : 0;/*? :*/ // YES : + i++;/*++*/ + i--;/*--*/ + b = true && false || true;/*&& ||*/ + i << 5;/*<<*/ + i >> 5;/*>>*/ + b = i == i && i != i && i <= i && i >= i;/*= == && != <= >=*/ + i += 5.0;/*+=*/ + i -= i;/*-=*/ + i *= i;/**=*/ + i /= i;/*/=*/ + i %= i;/*%=*/ + i &= i;/*&=*/ + i |= i;/*|=*/ + i ^= i;/*^=*/ + i <<= i;/*<<=*/ + i >>= i;/*>>=*/ + object s = x => x + 1;/*=>*/ + double d = .3; + Point point; + unsafe + {//test-ignore + Point* p = &point;/** &*/ + p->x = 10;/*->*/ + }//test-ignore + IO::BinaryReader br = null; + x[i: 1] = 3; + x[i: 1, j: 5] = "str"; + } + + struct Point { public int X; public int Y; public void ThisAccess() { this = this; } } + } + + // From here:https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6 + class CSharp6Features + { + // Initializers for auto-properties + public string First { get; set; } = "Jane"; + public string Last { get; set; } = "Doe"; + + // Getter-only auto-properties + public string Third { get; } = "Jane"; + public string Fourth { get; } = "Doe"; + + // Expression bodies on method-like members + public Point Move(int dx, int dy) => new Point(x + dx, y + dy); + public static Complex operator +(Complex a, Complex b) => a.Add(b); + public static implicit operator string(Person p) => p.First + " " + p.Last; + public void Print() => Console.WriteLine(First + " " + Last); + + // Expression bodies on property-like function members + public string Name => First + " " + Last; + public int this[long id] => id; + + async void Test() + { + // Using static + WriteLine(Sqrt(3*3 + 4*4)); + WriteLine(Friday - Monday); + var range = Range(5, 17); // Ok: not extension + var even = range.Where(i => i % 2 == 0); // Ok + + // Null-conditional operators + int? length = customers?.Length; // null if customers is null + Customer first = customers?[0]; // null if customers is null + int length = customers?.Length ?? 0; // 0 if customers is null + int? first = customers?[0]?.Orders?.Count(); + PropertyChanged?.Invoke(this, args); + + // String interpolation + string s = $"{p.Name, 20} is {p.Age:D3} year{{s}} old #"; + s = $"{p.Name} is \"{p.Age} year{(p.Age == 1 ? "" : "s")} old"; + s = $"{(p.Age == 2 ? $"{new Person { } }" : "")}"; + s = $@"\{p.Name} + ""\"; //test-ignore + s = $"Color [ R={func(b: 3):#0.##}, G={G:#0.##}, B={B:#0.##}, A={A:#0.##} ]"; + + // nameof expressions + if (x == null) + throw new ArgumentNullException(nameof(x)); + WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode" + + // Index initializers + var numbers = new Dictionary { + [7] = "seven", //test-ignore + [9] = "nine", //test-ignore + [13] = "thirteen" //test-ignore + }; //test-ignore + + // Exception filters + try {} + catch (MyException e) when (myfilter(e)) + { } //test-ignore + + // Await in catch and finally blocks + Resource res = null; + try + { //test-ignore + res = await Resource.OpenAsync(); // You could do this. + } //test-ignore + catch(ResourceException e) + { //test-ignore + await Resource.LogAsync(res, e); // Now you can do this … + } //test-ignore + finally + { //test-ignore + if (res != null) + await res.CloseAsync(); // … and this. + } //test-ignore + } + } +} + +class CSharp70 +{ + void PatternMatching(string arg, int b) + { + switch (arg) + { //test-ignore + case "A" when b > 50: + case "B" when b < 50: //test-ignore + default: + break; + } //test-ignore + + (A D, E H) = e; + + if (x?.y?.z is Type value2) + { + // code using value + } + + if (expr is Type v) { Hello(); } + } + + public static async Task LocalFunctions(string[] args) + { + string Hello2(int i) //test-ignore + { //test-ignore + return args[i]; + } //test-ignore + + async Task Hello(T i) => await Task.FromResult(args[i]); + await Hello(1); + } + + public static void OutVar(string[] args) + { + int.TryParse(Hello(1), out var item); + int.TryParse(Hello(1), out int item); + } + + public void ThrowExpression() + { + var result = nullableResult ?? throw new NullReferenceException(); + } + + public void BinaryLiterals() + { + int nineteen = 0b10011; + } + + public void DigitSeparators() + { + int bin = 0b1001_1010_0001_0100; + int hex = 0x1b_a0_44_fe; + int dec = 33_554_432; + int weird = 1_2__3___4____5_____6______7_______8________9; + double real = 1_000.111_1e-1_000; + } +} + +class CSharp71 +{ + void DefaultWithoutTypeName(string content = default) + { + DefaultWithoutTypeName(default); + } + + void TupleRecognize(int a, (int, int) b, (int, int, int)? c) + { + var result = list.Select(c => (c.f1, f3: c.f2)).Where(t => t.f2 == 1); + } +} + +class CSharp72 +{ + readonly struct ReadonlyRef1 + { + Func s = (in int x) => x; + ref TValue this[in TKey index] => null; + public static Vector3 operator+(in Vector3 x, in Vector3 y) => null; + + static readonly ref Vector3 M1_Trace() + { + // OK + ref readonly var r1 = ref M1(); + + // Not valid. Need an LValue + ref readonly Vector3 r2 = ref default(Vector3); + + // Not valid. r1 is readonly. + Mutate(ref r1); + + // OK. + Print(in r1); + + // OK. + return ref r1; + } + } + + ref struct ReadonlyRef2 + { + ref readonly Guid Test(in Vector3 v1, in Vector3 v2) + { + // not OK!! + v1 = default(Vector3); + + // not OK!! + v1.X = 0; + + // not OK!! + foo(ref v1.X); + + return ref (arr != null ? ref arr[0]: ref otherArr[0]); + + Span span = stackalloc int[1]; + + // OK + return new Vector3(v1.X + v2.X, v1.Y + v2.Y, v1.Z + v2.Z); + } + + ref T Choice(bool condition, ref T consequence, ref T alternative) + { + if (condition) + { + return ref consequence; + } + else + { + return ref alternative; + } + } + } + + public void DoSomething(bool isEmployed, string personName, int personAge) { } + + public void NonTrailingNamedArguments() + { + DoSomething(isEmployed:true, name, age); // currently CS1738, but would become legal + DoSomething(true, personName:name, age); // currently CS1738, but would become legal + DoSomething(name, isEmployed:true, age); // remains illegal + DoSomething(name, age, isEmployed:true); // remains illegal + DoSomething(true, personAge:age, personName:name); // already legal + } + + public void ConditionalRef() + { + ref var r = ref (arr != null ? ref arr[0]: ref otherArr[0]); + } + + public void LeadingSeparator() + { + var res = 0 + + 123 // permitted in C# 1.0 and later //test-ignore + + 1_2_3 // permitted in C# 7.0 and later //test-ignore + + 0x1_2_3 // permitted in C# 7.0 and later //test-ignore + + 0b101 // binary literals added in C# 7.0 //test-ignore + + 0b1_0_1 // permitted in C# 7.0 and later //test-ignore + + // in C# 7.2, _ is permitted after the `0x` or `0b` + + 0x_1_2 // permitted in C# 7.2 and later //test-ignore + + 0b_1_0_1 // permitted in C# 7.2 and later //test-ignore + ; //test-ignore + } +} + +class CSharp73 +{ + void Blittable(T value) where T : unmanaged + { //test-ignore + var unmanaged = 666; + } //test-ignore + + unsafe struct IndexingMovableFixed + { + public fixed int myFixedField[10]; //test-ignore + } + + static IndexingMovableFixed s; + + public unsafe void IndexingMovableFixedFields() + { + int* ptr = s.myFixedField; + int t = s.myFixedField[5]; + } + + public void PatternBasedFixed() + { + fixed(byte* ptr = byteArray) + { //test-ignore + // ptr is a native pointer to the first element of the array + // byteArray is protected from being moved/collected by the GC for the duration of this block + } //test-ignore + } + + public void StackallocArrayInitializer() + { + Span a = stackalloc int[3]; // currently allowed + Span a = stackalloc int[3] { 1, 2, 3 }; + Span a = stackalloc int[] { 1, 2, 3 }; + Span a = stackalloc[] { 1, 2, 3 }; + } + + public void TupleEquality() + { + (int, (int, int)) t1, t2; + var res = t1 == (1, (2, 3)); + } +} + +namespace CSharp80 +{ + class CSharp80ExceptInterfaceDefaultImplement + { + void ReferenceNullable() + { + var? x = E; + x!.ToString(); + string? wtf = null; + int?[]? hello; + } + + void Patterns() + { + if (o is string { Length: 5 } s) Do(); + + return lang.CountOfTokens switch + { //test-ignore + 1 => 100, //test-ignore + 2 => 200, //test-ignore + _ => throw new global::System.Exception() + }; //test-ignore + + var newState = (GetState(), action, hasKey) switch + { //test-ignore + (DoorState.Closed, Action.Open, _) => DoorState.Opened, //test-ignore + (DoorState.Opened, Action.Close, _) => DoorState.Closed, //test-ignore + (DoorState.Closed, Action.Lock, true) => DoorState.Locked, //test-ignore + (DoorState.Locked, Action.Unlock, true) => DoorState.Closed, //test-ignore + (var state, _, _) => state //test-ignore + }; //test-ignore + } + + async Task AsyncStreams() + { + await foreach (var item in asyncEnumerables) + { //test-ignore + } + } + + void Ranges() + { + var thirdItem = list[2]; // list[2] + var lastItem = list[^1]; // list[Index.CreateFromEnd(1)] + var multiDimensional = list[3, ^2]; // list[3, Index.CreateFromEnd(2)] + + var slice1 = list[2..^3]; // list[Range.Create(2, Index.CreateFromEnd(3))] + var slice2 = list[..^3]; // list[Range.ToEnd(Index.CreateFromEnd(3))] + var slice3 = list[2..]; // list[Range.FromStart(2)] + var slice4 = list[..]; // list[Range.All] + var multiDimensional = list[1..2, ..]; // list[Range.Create(1, 2), Range.All] + } + + void UsingDeclarators() + { + using var item = new FileStream("./.f"); + fixed char* ch = "hell"; + item.Dispose(); // no! + } + + void StaticLocalFunction() + { + static unsafe void Func1() {} //test-ignore + static unsafe void Func1() {} //test-ignore + async static void Func2() {} //test-ignore + static async void Func2() {} //test-ignore + } + + void NullCoalescingAssignment() + { + var item = a ??= b ??= c ??= d ??= throw new Exception(); + } + + public readonly float Hello() + { + return 0.1f; + } + } + + interface IA + { + void M() { WriteLine("IA.M"); } + } + + interface IA + { + void M() { WriteLine("IA.M"); } + } + + interface IB : IA + { + override void IA.M() { WriteLine("IB.M"); } // explicitly named + } + + interface IC : IA + { + override void M() { WriteLine("IC.M"); } // implicitly named + } +} diff --git a/languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs b/languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs index 4188cd3cb..3b6a4bd14 100644 --- a/languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs +++ b/languages/csharp/src/test/resources/de/jplag/csharp/TestClass.cs @@ -15,8 +15,7 @@ public void MyMethod(int parameter1, string parameter2) if(parameter1 == 0) { Console.WriteLine("Second parameter {0}", parameter2); } else { - Console.WriteLine("First Parameter {0}, second parameter {1}", - parameter1, parameter2); + Console.WriteLine("First Parameter {0}, second parameter {1}", parameter1, parameter2); } } @@ -26,8 +25,8 @@ public void MyMethod(int parameter1, string parameter2) private int myPropertyVar; public int MyProperty - { + {//test-ignore get { return myPropertyVar; } set { myPropertyVar = value; } - } + }//test-ignore } \ No newline at end of file diff --git a/languages/scala/pom.xml b/languages/scala/pom.xml index 8eb11b59a..c768e9edb 100644 --- a/languages/scala/pom.xml +++ b/languages/scala/pom.xml @@ -25,7 +25,7 @@ org.scalameta scalameta_${scala.compat.version} - 4.8.11 + 4.8.12 diff --git a/pom.xml b/pom.xml index 968ba8cca..19c045873 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 17 17 - 2.39.0 + 2.40.0 2.0.9 5.10.0 @@ -140,7 +140,7 @@ com.fasterxml.jackson.core jackson-databind - 2.15.2 + 2.15.3 @@ -167,7 +167,7 @@ org.mockito mockito-core - 5.5.0 + 5.6.0 test @@ -239,12 +239,12 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.1 org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent diff --git a/report-viewer/package-lock.json b/report-viewer/package-lock.json index 3cd65c76e..fd06bfe03 100644 --- a/report-viewer/package-lock.json +++ b/report-viewer/package-lock.json @@ -14,9 +14,9 @@ "@fortawesome/vue-fontawesome": "^3.0.3", "chart.js": "^4.4.0", "chartjs-plugin-datalabels": "^2.2.0", - "highlight.js": "^11.8.0", + "highlight.js": "^11.9.0", "jszip": "^3.10.0", - "pinia": "^2.1.6", + "pinia": "^2.1.7", "slash": "^5.1.0", "vue": "^3.3.4", "vue-chartjs": "^5.2.0", @@ -25,29 +25,29 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.38.1", - "@rushstack/eslint-patch": "^1.4.0", - "@types/jsdom": "^21.1.3", - "@types/node": "^18.18.0", - "@vitejs/plugin-vue": "^4.3.4", + "@playwright/test": "^1.39.0", + "@rushstack/eslint-patch": "^1.5.1", + "@types/jsdom": "^21.1.4", + "@types/node": "^18.18.6", + "@vitejs/plugin-vue": "^4.4.0", "@vue/eslint-config-prettier": "^8.0.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.1", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.15", - "eslint": "^8.50.0", - "eslint-plugin-vue": "^9.17.0", + "eslint": "^8.52.0", + "eslint-plugin-vue": "^9.18.0", "husky": "^8.0.0", "jsdom": "^22.1.0", - "lint-staged": "^14.0.1", + "lint-staged": "^15.0.2", "npm-run-all": "^4.1.5", - "postcss": "^8.4.30", + "postcss": "^8.4.31", "prettier": "^3.0.3", - "prettier-plugin-tailwindcss": "^0.5.4", + "prettier-plugin-tailwindcss": "^0.5.6", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", - "vite": "^4.4.9", - "vitest": "^0.34.4", + "vite": "^4.5.0", + "vitest": "^0.34.6", "vue-tsc": "^1.8.15" } }, @@ -483,9 +483,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", - "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -546,12 +546,12 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.11", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", - "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, @@ -573,9 +573,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "node_modules/@jest/schemas": { @@ -716,12 +716,12 @@ "dev": true }, "node_modules/@playwright/test": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", - "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.39.0.tgz", + "integrity": "sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==", "dev": true, "dependencies": { - "playwright": "1.38.1" + "playwright": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -731,9 +731,9 @@ } }, "node_modules/@rushstack/eslint-patch": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.4.0.tgz", - "integrity": "sha512-cEjvTPU32OM9lUFegJagO0mRnIn+rbqrG89vV8/xLnLFX0DoR0r1oy5IlTga71Q7uT3Qus7qm7wgeiMT/+Irlg==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz", + "integrity": "sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==", "dev": true }, "node_modules/@sinclair/typebox": { @@ -767,9 +767,9 @@ } }, "node_modules/@types/jsdom": { - "version": "21.1.3", - "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.3.tgz", - "integrity": "sha512-1zzqSP+iHJYV4lB3lZhNBa012pubABkj9yG/GuXuf6LZH1cSPIJBqFDrm5JX65HHt6VOnNYdTui/0ySerRbMgA==", + "version": "21.1.4", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.4.tgz", + "integrity": "sha512-NzAMLEV0KQ4cBaDx3Ls8VfJUElyDUm1xrtYRmcMK0gF8L5xYbujFVaQlJ50yinQ/d47j2rEP1XUzkiYrw4YRFA==", "dev": true, "dependencies": { "@types/node": "*", @@ -778,21 +778,21 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", "dev": true }, "node_modules/@types/node": { - "version": "18.18.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz", - "integrity": "sha512-3xA4X31gHT1F1l38ATDIL9GpRLdwVhnEFC8Uikv5ZLlXATwrCYyPq7ZWHxzxc3J/30SUiwiYT+bQe0/XvKlWbw==", + "version": "18.18.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.6.tgz", + "integrity": "sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==", "dev": true }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==", "dev": true }, "node_modules/@types/tough-cookie": { @@ -802,32 +802,33 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.1.tgz", - "integrity": "sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz", + "integrity": "sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.59.1", - "@typescript-eslint/type-utils": "5.59.1", - "@typescript-eslint/utils": "5.59.1", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/type-utils": "6.7.5", + "@typescript-eslint/utils": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -836,25 +837,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.1.tgz", - "integrity": "sha512-nzjFAN8WEu6yPRDizIFyzAfgK7nybPodMNFGNH0M9tei2gYnYszRDqVA0xlnRjkl7Hkx2vYrEdb6fP2a21cG1g==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.5.tgz", + "integrity": "sha512-bIZVSGx2UME/lmhLcjdVc7ePBwn7CLqKarUBL4me1C5feOd663liTGjMBGVcGr+BhnSLeP4SgwdvNnnkbIdkCw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.59.1", - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/typescript-estree": "5.59.1", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -863,16 +865,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.1.tgz", - "integrity": "sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -880,25 +882,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.1.tgz", - "integrity": "sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz", + "integrity": "sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.59.1", - "@typescript-eslint/utils": "5.59.1", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/utils": "6.7.5", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -907,12 +909,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.1.tgz", - "integrity": "sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -920,21 +922,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.1.tgz", - "integrity": "sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/visitor-keys": "5.59.1", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -947,52 +949,57 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.1.tgz", - "integrity": "sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.5.tgz", + "integrity": "sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.59.1", - "@typescript-eslint/types": "5.59.1", - "@typescript-eslint/typescript-estree": "5.59.1", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.1.tgz", - "integrity": "sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==", + "version": "6.7.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.7.5", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@vitejs/plugin-vue": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.3.4.tgz", - "integrity": "sha512-ciXNIHKPriERBisHFBvnTbfKa6r9SAesOYXeGDzgegcvy9Q4xdScSHAmKbNT0M3O0S9LKhIf5/G+UYG4NnnzYw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.4.0.tgz", + "integrity": "sha512-xdguqb+VUwiRpSg+nsc2HtbAUSGak25DXYvpQQi4RVU1Xq1uworyoH/md9Rfd8zMmPR/pSghr309QNcftUVseg==", "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -1003,26 +1010,26 @@ } }, "node_modules/@vitest/expect": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.4.tgz", - "integrity": "sha512-XlMKX8HyYUqB8dsY8Xxrc64J2Qs9pKMt2Z8vFTL4mBWXJsg4yoALHzJfDWi8h5nkO4Zua4zjqtapQ/IluVkSnA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.6.tgz", + "integrity": "sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==", "dev": true, "dependencies": { - "@vitest/spy": "0.34.4", - "@vitest/utils": "0.34.4", - "chai": "^4.3.7" + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", + "chai": "^4.3.10" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.4.tgz", - "integrity": "sha512-hwwdB1StERqUls8oV8YcpmTIpVeJMe4WgYuDongVzixl5hlYLT2G8afhcdADeDeqCaAmZcSgLTLtqkjPQF7x+w==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", + "integrity": "sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==", "dev": true, "dependencies": { - "@vitest/utils": "0.34.4", + "@vitest/utils": "0.34.6", "p-limit": "^4.0.0", "pathe": "^1.1.1" }, @@ -1058,9 +1065,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.4.tgz", - "integrity": "sha512-GCsh4coc3YUSL/o+BPUo7lHQbzpdttTxL6f4q0jRx2qVGoYz/cyTRDJHbnwks6TILi6560bVWoBpYC10PuTLHw==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", + "integrity": "sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==", "dev": true, "dependencies": { "magic-string": "^0.30.1", @@ -1072,9 +1079,9 @@ } }, "node_modules/@vitest/spy": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.4.tgz", - "integrity": "sha512-PNU+fd7DUPgA3Ya924b1qKuQkonAW6hL7YUjkON3wmBwSTIlhOSpy04SJ0NrRsEbrXgMMj6Morh04BMf8k+w0g==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.6.tgz", + "integrity": "sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==", "dev": true, "dependencies": { "tinyspy": "^2.1.1" @@ -1084,9 +1091,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.4.tgz", - "integrity": "sha512-yR2+5CHhp/K4ySY0Qtd+CAL9f5Yh1aXrKfAT42bq6CtlGPh92jIDDDSg7ydlRow1CP+dys4TrOrbELOyNInHSg==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", "dev": true, "dependencies": { "diff-sequences": "^29.4.3", @@ -1190,14 +1197,14 @@ } }, "node_modules/@vue/eslint-config-typescript": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.3.tgz", - "integrity": "sha512-dkt6W0PX6H/4Xuxg/BlFj5xHvksjpSlVjtkQCpaYJBIEuKj2hOVU7r+TIe+ysCwRYFz/lGqvklntRkCAibsbPw==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-12.0.0.tgz", + "integrity": "sha512-StxLFet2Qe97T8+7L8pGlhYBBr8Eg05LPuTDVopQV6il+SK6qqom59BA/rcFipUef2jD8P2X44Vd8tMFytfvlg==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", - "vue-eslint-parser": "^9.1.1" + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "vue-eslint-parser": "^9.3.1" }, "engines": { "node": "^14.17.0 || >=16.0.0" @@ -1762,18 +1769,18 @@ ] }, "node_modules/chai": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", - "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", + "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" @@ -1815,10 +1822,13 @@ } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -2410,18 +2420,19 @@ } }, "node_modules/eslint": { - "version": "8.50.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", - "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.50.0", - "@humanwhocodes/config-array": "^0.11.11", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2505,9 +2516,9 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.17.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.17.0.tgz", - "integrity": "sha512-r7Bp79pxQk9I5XDP0k2dpUC7Ots3OSWgvGZNu3BxmKK6Zg7NgVtcOB6OCna5Kb9oQwJPl5hq183WD0SY5tZtIQ==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.18.0.tgz", + "integrity": "sha512-yUM8a2OD/7Qs0PiugkRaxgz5KBRvzMvWShity2UvVFAN0yk8029mGpTdg/TNARPiYzp335mEwDHwcAR8tQNe4g==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", @@ -2525,19 +2536,6 @@ "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -2634,15 +2632,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -2896,9 +2885,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -3075,12 +3064,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -3178,9 +3161,9 @@ } }, "node_modules/highlight.js": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.8.0.tgz", - "integrity": "sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz", + "integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==", "engines": { "node": ">=12.0.0" } @@ -3850,27 +3833,27 @@ "dev": true }, "node_modules/lint-staged": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-14.0.1.tgz", - "integrity": "sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==", + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.0.2.tgz", + "integrity": "sha512-vnEy7pFTHyVuDmCAIFKR5QDO8XLVlPFQQyujQ/STOxe40ICWqJ6knS2wSJ/ffX/Lw0rz83luRDh+ET7toN+rOw==", "dev": true, "dependencies": { "chalk": "5.3.0", - "commander": "11.0.0", + "commander": "11.1.0", "debug": "4.3.4", - "execa": "7.2.0", + "execa": "8.0.1", "lilconfig": "2.1.0", - "listr2": "6.6.1", + "listr2": "7.0.2", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", - "yaml": "2.3.1" + "yaml": "2.3.3" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { - "node": "^16.14.0 || >=18.0.0" + "node": ">=18.12.0" }, "funding": { "url": "https://opencollective.com/lint-staged" @@ -3889,14 +3872,58 @@ } }, "node_modules/lint-staged/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "engines": { "node": ">=16" } }, + "node_modules/lint-staged/node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, "node_modules/lint-staged/node_modules/pidtree": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", @@ -3909,10 +3936,22 @@ "node": ">=0.10" } }, + "node_modules/lint-staged/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/listr2": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-6.6.1.tgz", - "integrity": "sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", "dev": true, "dependencies": { "cli-truncate": "^3.1.0", @@ -3924,14 +3963,6 @@ }, "engines": { "node": ">=16.0.0" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } } }, "node_modules/load-json-file": { @@ -4199,12 +4230,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -4760,9 +4785,9 @@ } }, "node_modules/pinia": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.6.tgz", - "integrity": "sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.7.tgz", + "integrity": "sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==", "dependencies": { "@vue/devtools-api": "^6.5.0", "vue-demi": ">=0.14.5" @@ -4830,12 +4855,12 @@ } }, "node_modules/playwright": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", - "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.39.0.tgz", + "integrity": "sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==", "dev": true, "dependencies": { - "playwright-core": "1.38.1" + "playwright-core": "1.39.0" }, "bin": { "playwright": "cli.js" @@ -4848,9 +4873,9 @@ } }, "node_modules/playwright-core": { - "version": "1.38.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", - "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", + "version": "1.39.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.39.0.tgz", + "integrity": "sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -4860,9 +4885,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -5026,9 +5051,9 @@ } }, "node_modules/prettier-plugin-tailwindcss": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.4.tgz", - "integrity": "sha512-QZzzB1bID6qPsKHTeA9qPo1APmmxfFrA5DD3LQ+vbTmAnY40eJI7t9Q1ocqel2EKMWNPLJqdTDWZj1hKYgqSgg==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.6.tgz", + "integrity": "sha512-2Xgb+GQlkPAUCFi3sV+NOYcSI5XgduvDBL2Zt/hwJudeKXkyvRS65c38SB0yb9UB40+1rL83I6m0RtlOQ8eHdg==", "dev": true, "engines": { "node": ">=14.21.3" @@ -6131,9 +6156,9 @@ } }, "node_modules/tinyspy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", - "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.0.tgz", + "integrity": "sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==", "dev": true, "engines": { "node": ">=14.0.0" @@ -6190,33 +6215,24 @@ "node": ">=14" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, "engines": { - "node": ">= 6" + "node": ">=16.13.0" }, "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "typescript": ">=4.2.0" } }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6278,9 +6294,9 @@ } }, "node_modules/ufo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", + "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==", "dev": true }, "node_modules/unbox-primitive": { @@ -6381,9 +6397,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz", + "integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -6436,9 +6452,9 @@ } }, "node_modules/vite-node": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.4.tgz", - "integrity": "sha512-ho8HtiLc+nsmbwZMw8SlghESEE3KxJNp04F/jPUCLVvaURwt0d+r9LxEqCX5hvrrOQ0GSyxbYr5ZfRYhQ0yVKQ==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.6.tgz", + "integrity": "sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -6446,7 +6462,7 @@ "mlly": "^1.4.0", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "vite": "^3.0.0 || ^4.0.0" + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" @@ -6459,23 +6475,23 @@ } }, "node_modules/vitest": { - "version": "0.34.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.4.tgz", - "integrity": "sha512-SE/laOsB6995QlbSE6BtkpXDeVNLJc1u2LHRG/OpnN4RsRzM3GQm4nm3PQCK5OBtrsUqnhzLdnT7se3aeNGdlw==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.6.tgz", + "integrity": "sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==", "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.34.4", - "@vitest/runner": "0.34.4", - "@vitest/snapshot": "0.34.4", - "@vitest/spy": "0.34.4", - "@vitest/utils": "0.34.4", + "@vitest/expect": "0.34.6", + "@vitest/runner": "0.34.6", + "@vitest/snapshot": "0.34.6", + "@vitest/spy": "0.34.6", + "@vitest/utils": "0.34.6", "acorn": "^8.9.0", "acorn-walk": "^8.2.0", "cac": "^6.7.14", - "chai": "^4.3.7", + "chai": "^4.3.10", "debug": "^4.3.4", "local-pkg": "^0.4.3", "magic-string": "^0.30.1", @@ -6486,7 +6502,7 @@ "tinybench": "^2.5.0", "tinypool": "^0.7.0", "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", - "vite-node": "0.34.4", + "vite-node": "0.34.6", "why-is-node-running": "^2.2.2" }, "bin": { @@ -6908,9 +6924,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz", + "integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==", "dev": true, "engines": { "node": ">= 14" diff --git a/report-viewer/package.json b/report-viewer/package.json index b55301372..7445c40b3 100644 --- a/report-viewer/package.json +++ b/report-viewer/package.json @@ -23,9 +23,9 @@ "@fortawesome/vue-fontawesome": "^3.0.3", "chart.js": "^4.4.0", "chartjs-plugin-datalabels": "^2.2.0", - "highlight.js": "^11.8.0", + "highlight.js": "^11.9.0", "jszip": "^3.10.0", - "pinia": "^2.1.6", + "pinia": "^2.1.7", "slash": "^5.1.0", "vue": "^3.3.4", "vue-chartjs": "^5.2.0", @@ -34,29 +34,29 @@ "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { - "@playwright/test": "^1.38.1", - "@rushstack/eslint-patch": "^1.4.0", - "@types/jsdom": "^21.1.3", - "@types/node": "^18.18.0", - "@vitejs/plugin-vue": "^4.3.4", + "@playwright/test": "^1.39.0", + "@rushstack/eslint-patch": "^1.5.1", + "@types/jsdom": "^21.1.4", + "@types/node": "^18.18.6", + "@vitejs/plugin-vue": "^4.4.0", "@vue/eslint-config-prettier": "^8.0.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.1", "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.15", - "eslint": "^8.50.0", - "eslint-plugin-vue": "^9.17.0", + "eslint": "^8.52.0", + "eslint-plugin-vue": "^9.18.0", "husky": "^8.0.0", "jsdom": "^22.1.0", - "lint-staged": "^14.0.1", + "lint-staged": "^15.0.2", "npm-run-all": "^4.1.5", - "postcss": "^8.4.30", + "postcss": "^8.4.31", "prettier": "^3.0.3", - "prettier-plugin-tailwindcss": "^0.5.4", + "prettier-plugin-tailwindcss": "^0.5.6", "tailwindcss": "^3.3.3", "typescript": "^5.2.2", - "vite": "^4.4.9", - "vitest": "^0.34.4", + "vite": "^4.5.0", + "vitest": "^0.34.6", "vue-tsc": "^1.8.15" } }