Skip to content

Commit

Permalink
debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesroddie committed Jun 28, 2020
1 parent 31f3387 commit 917a295
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions CSharpMath/Atom/LaTeXParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Drawing;

namespace CSharpMath.Atom {
using System.Diagnostics;
using Atoms;
using CSharpMath.Structures;
using InvalidCodePathException = Structures.InvalidCodePathException;
Expand Down Expand Up @@ -218,6 +219,7 @@ private string ReadString() {
}
}
var str = builder.ToString();
Debug.WriteLine("str: " + str);
if (ColorExtensions.ParseColor(str) is Color color) {
SkipSpaces();
if (!ExpectCharacter('}')) {
Expand Down Expand Up @@ -401,12 +403,17 @@ private string ReadCommand() {
return null;
}
return BuildTable(env, null, false, stopChar);
case "color":
return (ReadColor()) switch
{
Color color when BuildInternal(true) is MathList ml => new Colored(color, ml),
_ => null,
};
case "color": {
Color? c = ReadColor();
if (c.HasValue) {
Debug.WriteLine("c NonNull");
MathList? ml = BuildInternal(true);
if (ml != null) { return new Colored(c.Value, ml); } else { Debug.WriteLine("ml null"); return null; }
} else {
Debug.WriteLine("c Null");
return null;
}
}
case "colorbox":
return (ReadColor()) switch
{
Expand Down

0 comments on commit 917a295

Please sign in to comment.