fix: directive and line test.
This commit is contained in:
@@ -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) {
|
private fun withStatement(statement: JsStatement, action: () -> Unit) {
|
||||||
val oldStatement = currentStatement
|
val oldStatement = currentStatement
|
||||||
currentStatement = statement
|
currentStatement = statement
|
||||||
|
|||||||
@@ -687,7 +687,7 @@ public class DirectiveTestUtils {
|
|||||||
private final List<String> positionalArguments = new ArrayList<>();
|
private final List<String> positionalArguments = new ArrayList<>();
|
||||||
private final Map<String, String> namedArguments = new HashMap<>();
|
private final Map<String, String> namedArguments = new HashMap<>();
|
||||||
private final String entry;
|
private final String entry;
|
||||||
private final Pattern argumentsPattern = Pattern.compile("\\w+(=((\".*?\")|([\\w$_;])+))?");
|
private final Pattern argumentsPattern = Pattern.compile("[\\w$_;]+(=((\".*?\")|[\\w$_;]+))?");
|
||||||
|
|
||||||
ArgumentsHelper(@NotNull String directiveEntry) {
|
ArgumentsHelper(@NotNull String directiveEntry) {
|
||||||
entry = directiveEntry;
|
entry = directiveEntry;
|
||||||
|
|||||||
Reference in New Issue
Block a user