48 lines
1.7 KiB
Java
48 lines
1.7 KiB
Java
package c.a.l.h;
|
|
|
|
import android.text.style.StyleSpan;
|
|
import c.a.l.g.c;
|
|
import com.discord.simpleast.core.node.Node;
|
|
import com.discord.simpleast.core.node.StyleNode;
|
|
import com.discord.simpleast.core.parser.ParseSpec;
|
|
import com.discord.simpleast.core.parser.Parser;
|
|
import com.discord.simpleast.core.parser.Rule;
|
|
import d0.z.d.m;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Pattern;
|
|
/* compiled from: ItalicsRule.kt */
|
|
public final class h extends Rule<T, Node<T>, c> {
|
|
public h(Pattern pattern) {
|
|
super(pattern);
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.util.regex.Matcher, com.discord.simpleast.core.parser.Parser, java.lang.Object] */
|
|
@Override // com.discord.simpleast.core.parser.Rule
|
|
public ParseSpec parse(Matcher matcher, Parser parser, c cVar) {
|
|
int i;
|
|
int i2;
|
|
c cVar2 = cVar;
|
|
m.checkNotNullParameter(matcher, "matcher");
|
|
m.checkNotNullParameter(parser, "parser");
|
|
m.checkNotNullParameter(cVar2, "state");
|
|
boolean z2 = false;
|
|
Node aVar = cVar2.a ? new Node.a(new Node[0]) : new StyleNode(d0.t.m.listOf(new StyleSpan(2)));
|
|
String group = matcher.group(2);
|
|
if (group != null) {
|
|
if (group.length() > 0) {
|
|
z2 = true;
|
|
}
|
|
if (z2) {
|
|
i2 = matcher.start(2);
|
|
i = matcher.end(2);
|
|
m.checkNotNullParameter(aVar, "node");
|
|
return new ParseSpec(aVar, cVar2, i2, i);
|
|
}
|
|
}
|
|
i2 = matcher.start(1);
|
|
i = matcher.end(1);
|
|
m.checkNotNullParameter(aVar, "node");
|
|
return new ParseSpec(aVar, cVar2, i2, i);
|
|
}
|
|
}
|