Skip to content

Commit

Permalink
ForNeVeR#141: incorporate requested changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
gsomix committed Mar 17, 2019
1 parent cca9b9b commit abaf867
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 17 deletions.
4 changes: 4 additions & 0 deletions src/WpfMath.Tests/ParserTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ let cyrillicText() =
let underscoreText() =
verifyParseResult @"\text{_}"

[<Fact>]
let commandsInText() =
verifyParseResult @"\text{\alpha \beta \unknowncommand}"

[<Fact>]
let mathrm() =
verifyParseResult @"\mathrm{sin}"
Expand Down
371 changes: 371 additions & 0 deletions src/WpfMath.Tests/TestResults/ParserTests.commandsInText.approved.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,371 @@
{
"TextStyle": null,
"RootAtom": {
"PreviousAtom": null,
"Elements": [
{
"Character": "\\",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 6,
"End": 7,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "a",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 7,
"End": 8,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "l",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 8,
"End": 9,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "p",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 9,
"End": 10,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "h",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 10,
"End": 11,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "a",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 11,
"End": 12,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Type": "Ordinary",
"Source": {
"Start": 12,
"End": 13,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "\\",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 13,
"End": 14,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "b",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 14,
"End": 15,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "e",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 15,
"End": 16,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "t",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 16,
"End": 17,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "a",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 17,
"End": 18,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Type": "Ordinary",
"Source": {
"Start": 18,
"End": 19,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "\\",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 19,
"End": 20,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "u",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 20,
"End": 21,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "n",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 21,
"End": 22,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "k",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 22,
"End": 23,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "n",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 23,
"End": 24,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "o",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 24,
"End": 25,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "w",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 25,
"End": 26,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "n",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 26,
"End": 27,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "c",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 27,
"End": 28,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "o",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 28,
"End": 29,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "m",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 29,
"End": 30,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "m",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 30,
"End": 31,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "a",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 31,
"End": 32,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "n",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 32,
"End": 33,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
},
{
"Character": "d",
"TextStyle": "text",
"IsDefaultTextStyle": false,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 33,
"End": 34,
"Length": 1,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
}
],
"Type": "Ordinary",
"Source": {
"Start": 6,
"End": 34,
"Length": 28,
"Source": "\\text{\\alpha \\beta \\unknowncommand}"
}
}
}
Loading

0 comments on commit abaf867

Please sign in to comment.