437 lines
12 KiB
Smali
437 lines
12 KiB
Smali
.class public Lcom/discord/simpleast/a/a$a;
|
|
.super Lcom/discord/simpleast/a/a$b;
|
|
.source "MarkdownRules.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/simpleast/a/a;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x9
|
|
name = "a"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<RC:",
|
|
"Ljava/lang/Object;",
|
|
"T:",
|
|
"Ljava/lang/Object;",
|
|
"S:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Lcom/discord/simpleast/a/a$b<",
|
|
"TRC;TS;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final classSpanProvider:Lkotlin/jvm/functions/Function1;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"Ljava/lang/String;",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final innerRules:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"+",
|
|
"Landroid/text/style/CharacterStyle;",
|
|
">;",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"+TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "styleSpanProvider"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "classSpanProvider"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {v0}, Lcom/discord/simpleast/core/a/a;->q(Z)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Collection;
|
|
|
|
sget-object v1, Lcom/discord/simpleast/core/a/a;->BA:Lcom/discord/simpleast/core/a/a;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/simpleast/core/a/a;->eQ()Lcom/discord/simpleast/core/parser/Rule;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lkotlin/a/m;->plus(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Lcom/discord/simpleast/a/a$a;-><init>(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Ljava/util/List;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Ljava/util/List;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"+",
|
|
"Landroid/text/style/CharacterStyle;",
|
|
">;",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/String;",
|
|
"+TT;>;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "styleSpanProvider"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "classSpanProvider"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "innerRules"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/simpleast/a/a;->BL:Lcom/discord/simpleast/a/a;
|
|
|
|
invoke-static {}, Lcom/discord/simpleast/a/a;->eW()Ljava/util/regex/Pattern;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/simpleast/a/a$b;-><init>(Ljava/util/regex/Pattern;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
iput-object p2, p0, Lcom/discord/simpleast/a/a$a;->classSpanProvider:Lkotlin/jvm/functions/Function1;
|
|
|
|
iput-object p3, p0, Lcom/discord/simpleast/a/a$a;->innerRules:Ljava/util/List;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getClassSpanProvider()Lkotlin/jvm/functions/Function1;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"Ljava/lang/String;",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/simpleast/a/a$a;->classSpanProvider:Lkotlin/jvm/functions/Function1;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method protected final getInnerRules()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/simpleast/a/a$a;->innerRules:Ljava/util/List;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public parse(Ljava/util/regex/Matcher;Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/Object;)Lcom/discord/simpleast/core/parser/ParseSpec;
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/regex/Matcher;",
|
|
"Lcom/discord/simpleast/core/parser/Parser<",
|
|
"TRC;-",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;TS;)",
|
|
"Lcom/discord/simpleast/core/parser/ParseSpec<",
|
|
"TRC;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TRC;>;TS;>;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "matcher"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "parser"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v0, 0x4
|
|
|
|
invoke-virtual {p1, v0}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "matcher.group(4)"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v0}, Lcom/discord/simpleast/a/a$a;->createHeaderStyleNode(Ljava/lang/String;)Lcom/discord/simpleast/core/node/StyleNode;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p1, v1}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
const/4 v2, 0x3
|
|
|
|
invoke-virtual {p1, v2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_0
|
|
check-cast v2, Ljava/lang/CharSequence;
|
|
|
|
iget-object v3, p0, Lcom/discord/simpleast/a/a$a;->innerRules:Ljava/util/List;
|
|
|
|
invoke-virtual {p2, v2, p3, v3}, Lcom/discord/simpleast/core/parser/Parser;->parse(Ljava/lang/CharSequence;Ljava/lang/Object;Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Ljava/lang/Iterable;
|
|
|
|
invoke-interface {p2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_0
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
check-cast v2, Lcom/discord/simpleast/core/node/Node;
|
|
|
|
invoke-virtual {v0, v2}, Lcom/discord/simpleast/core/node/StyleNode;->addChild(Lcom/discord/simpleast/core/node/Node;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p1, Lkotlin/r;
|
|
|
|
const-string p2, "null cannot be cast to non-null type com.discord.simpleast.core.node.Node<RC>"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/r;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
const/4 p2, 0x2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
check-cast p1, Ljava/lang/CharSequence;
|
|
|
|
invoke-static {p1}, Lkotlin/text/l;->trim(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
move-object v2, p1
|
|
|
|
check-cast v2, Ljava/lang/CharSequence;
|
|
|
|
new-array v3, v1, [C
|
|
|
|
const/4 p1, 0x0
|
|
|
|
const/16 p2, 0x20
|
|
|
|
aput-char p2, v3, p1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
invoke-static/range {v2 .. v7}, Lkotlin/text/l;->split$default(Ljava/lang/CharSequence;[CZIILjava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
new-instance p1, Lkotlin/r;
|
|
|
|
const-string p2, "null cannot be cast to non-null type kotlin.CharSequence"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/r;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
const/4 p1, 0x0
|
|
|
|
:goto_1
|
|
if-eqz p1, :cond_7
|
|
|
|
check-cast p1, Ljava/lang/Iterable;
|
|
|
|
new-instance p2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
check-cast p2, Ljava/util/Collection;
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_5
|
|
:goto_2
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
iget-object v3, p0, Lcom/discord/simpleast/a/a$a;->classSpanProvider:Lkotlin/jvm/functions/Function1;
|
|
|
|
invoke-interface {v3, v2}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
check-cast p2, Ljava/util/List;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_7
|
|
invoke-static {}, Lkotlin/a/m;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_3
|
|
move-object p1, p2
|
|
|
|
check-cast p1, Ljava/util/Collection;
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
xor-int/2addr p1, v1
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
new-instance p1, Lcom/discord/simpleast/core/node/StyleNode;
|
|
|
|
invoke-direct {p1, p2}, Lcom/discord/simpleast/core/node/StyleNode;-><init>(Ljava/util/List;)V
|
|
|
|
check-cast v0, Lcom/discord/simpleast/core/node/Node;
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/simpleast/core/node/StyleNode;->addChild(Lcom/discord/simpleast/core/node/Node;)V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
move-object p1, v0
|
|
|
|
:goto_4
|
|
sget-object p2, Lcom/discord/simpleast/core/parser/ParseSpec;->Bs:Lcom/discord/simpleast/core/parser/ParseSpec$a;
|
|
|
|
check-cast p1, Lcom/discord/simpleast/core/node/Node;
|
|
|
|
invoke-static {p1, p3}, Lcom/discord/simpleast/core/parser/ParseSpec$a;->a(Lcom/discord/simpleast/core/node/Node;Ljava/lang/Object;)Lcom/discord/simpleast/core/parser/ParseSpec;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|