fix: directive and line test.

This commit is contained in:
Artem Kobzar
2022-04-07 23:56:16 +02:00
committed by teamcity
parent e68ee4053e
commit f5e7b9886c
2 changed files with 14 additions and 1 deletions
@@ -147,6 +147,19 @@ class LineCollector : RecursiveJsVisitor() {
}
}
override fun visitSingleLineComment(comment: JsSingleLineComment) {
withStatement(comment) {
lineNumbersByStatement[comment]?.add(-1)
}
}
override fun visitMultiLineComment(comment: JsMultiLineComment) {
withStatement(comment) {
lineNumbersByStatement[comment]?.add(-1)
}
}
private fun withStatement(statement: JsStatement, action: () -> Unit) {
val oldStatement = currentStatement
currentStatement = statement
@@ -687,7 +687,7 @@ public class DirectiveTestUtils {
private final List<String> positionalArguments = new ArrayList<>();
private final Map<String, String> namedArguments = new HashMap<>();
private final String entry;
private final Pattern argumentsPattern = Pattern.compile("\\w+(=((\".*?\")|([\\w$_;])+))?");
private final Pattern argumentsPattern = Pattern.compile("[\\w$_;]+(=((\".*?\")|[\\w$_;]+))?");
ArgumentsHelper(@NotNull String directiveEntry) {
entry = directiveEntry;