Skip to content

Commit

Permalink
fix tests about the parser
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Oct 23, 2021
1 parent c587a71 commit eda2fc4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/frontend/types.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,12 @@ and untyped_math = Range.t * untyped_math_main

and untyped_math_main =
| UTMChars of Uchar.t list
[@printer (fun ppf uchs -> Format.fprintf ppf "UTMChars(_)")]
[@printer (fun ppf uchs ->
let buf = Buffer.create (4 * List.length uchs) in
uchs |> List.iter (Buffer.add_utf_8_uchar buf);
let s = Buffer.contents buf in
Format.fprintf ppf "(UTMChars \"%s\")" s
)]
| UTMSuperScript of untyped_math * bool * untyped_math
| UTMSubScript of untyped_math * bool * untyped_math
| UTMCommand of untyped_abstract_tree * untyped_command_argument list
Expand Down
10 changes: 5 additions & 5 deletions test/parsing/parser.expected
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@
((Range.Normal ("mathlist.saty", 2, 11, 2, 12)),
(UTMList
[((Range.Normal ("mathlist.saty", 2, 11, 2, 12)),
(UTMChar "a"))]))),
(UTMChars "a"))]))),
(UTListCons (
(UTMath
((Range.Normal ("mathlist.saty", 2, 13, 2, 15)),
(UTMList
[((Range.Normal ("mathlist.saty", 2, 13, 2, 14)),
(UTMChar "a"));
(UTMChars "a"));
((Range.Normal ("mathlist.saty", 2, 14, 2, 15)),
(UTMChar "b"))
(UTMChars "b"))
]))),
UTEndOfList))
)),
Expand All @@ -317,7 +317,7 @@
((Range.Dummy "dec-constructor-unit1"),
(Types.MTypeName ([], [], "unit"))));
((Range.Normal ("toplevel.saty", 2, 12, 2, 13)), "B",
((Range.Dummy "dec-constructor-unit2"),
((Range.Dummy "dec-constructor-unit1"),
(Types.MTypeName ([], [], "unit"))))
],
(UTMutualVariantCons ([],
Expand All @@ -326,7 +326,7 @@
((Range.Dummy "dec-constructor-unit1"),
(Types.MTypeName ([], [], "unit"))));
((Range.Normal ("toplevel.saty", 5, 4, 5, 5)), "B",
((Range.Dummy "dec-constructor-unit2"),
((Range.Dummy "dec-constructor-unit1"),
(Types.MTypeName ([], [], "unit"))))
],
UTEndOfMutualVariant))
Expand Down

0 comments on commit eda2fc4

Please sign in to comment.