Skip to content

Commit

Permalink
Moving extracted method to bottom of file
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehonti authored and ForNeVeR committed Feb 2, 2025
1 parent 516cb81 commit 839b7b0
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/XamlMath.Shared/TexFormulaParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,32 +192,6 @@ private DelimiterInfo ParseUntilDelimiter(
return new DelimiterInfo(bodyAtom, lastDelimiter);
}

private static Atom CreateForRow(RowAtom? bodyRow, SourceSpan? source)
{
if (bodyRow == null)
{
return new RowAtom(source);
}
else if (bodyRow.Elements.Count > 2)
{
return
bodyRow.Elements
.Take(bodyRow.Elements.Count - 1)
.Aggregate(
new RowAtom(source),
(r, atom) => r.Add(atom)
);
}
else if (bodyRow.Elements.Count == 2)
{
return bodyRow.Elements[0];
}
else
{
throw new NotSupportedException($"Cannot convert {bodyRow} to fenced atom body");
}
}

private TexFormula Parse(
SourceSpan value,
ref int position,
Expand Down Expand Up @@ -919,4 +893,30 @@ private static int WithSkippedWhiteSpace(SourceSpan value, int position)

return position;
}

private static Atom CreateForRow(RowAtom? bodyRow, SourceSpan? source)
{
if (bodyRow == null)
{
return new RowAtom(source);
}
else if (bodyRow.Elements.Count > 2)
{
return
bodyRow.Elements
.Take(bodyRow.Elements.Count - 1)
.Aggregate(
new RowAtom(source),
(r, atom) => r.Add(atom)
);
}
else if (bodyRow.Elements.Count == 2)
{
return bodyRow.Elements[0];
}
else
{
throw new NotSupportedException($"Cannot convert {bodyRow} to fenced atom body");
}
}
}

0 comments on commit 839b7b0

Please sign in to comment.