@@ -890,8 +890,8 @@ let _ = printfn "%s %s"
890890do printfn "%6d %% % 06d" 1 2
891891"""
892892 => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ]
893- 3 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 19 ; Cat.Printf, 20 , 22 ]
894- 4 , [ Cat.Function, 3 , 10 ; Cat.Printf, 12 , 15 ; Cat.Printf, 16 , 18 ; Cat.Printf, 20 , 25 ]]
893+ 3 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 20 ; Cat.Printf, 20 , 23 ]
894+ 4 , [ Cat.Function, 3 , 10 ; Cat.Printf, 12 , 16 ; Cat.Printf, 16 , 19 ; Cat.Printf, 20 , 26 ]]
895895
896896[<Test>]
897897let ``printf formatters in try / with / finally ``() =
@@ -905,10 +905,10 @@ try
905905with _ ->
906906 failwithf "foo %d bar" 0
907907"""
908- => [ 3 , [ Cat.Operator, 10 , 11 ; Cat.Function, 12 , 19 ; Cat.Printf, 25 , 27 ]
909- 5 , [ Cat.Function, 8 , 15 ; Cat.Printf, 21 , 23 ]
910- 7 , [ Cat.Function, 8 , 14 ; Cat.Printf, 20 , 22 ]
911- 9 , [ Cat.Function, 4 , 13 ; Cat.Printf, 19 , 21 ]]
908+ => [ 3 , [ Cat.Operator, 10 , 11 ; Cat.Function, 12 , 19 ; Cat.Printf, 25 , 28 ]
909+ 5 , [ Cat.Function, 8 , 15 ; Cat.Printf, 21 , 24 ]
910+ 7 , [ Cat.Function, 8 , 14 ; Cat.Printf, 20 , 23 ]
911+ 9 , [ Cat.Function, 4 , 13 ; Cat.Printf, 19 , 22 ]]
912912
913913[<Test>]
914914let ``printf formatters in record / DU members`` () =
@@ -926,10 +926,10 @@ type DU = DU
926926 override __.ToString() =
927927 sprintf "%d " 1
928928"""
929- => [ 5 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 23 ]
930- 7 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 23 ]
931- 11 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 23 ]
932- 13 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 23 ]]
929+ => [ 5 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 24 ]
930+ 7 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 24 ]
931+ 11 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 24 ]
932+ 13 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 24 ]]
933933
934934[<Test>]
935935let ``printf formatters in extension members`` () =
@@ -938,19 +938,19 @@ type System.Object with
938938 member __.M1 =
939939 sprintf "%A "
940940"""
941- => [ 4 , [ Cat.Function, 8 , 15 ; Cat.Printf, 17 , 19 ]]
941+ => [ 4 , [ Cat.Function, 8 , 15 ; Cat.Printf, 17 , 20 ]]
942942
943943[<Test>]
944944let ``printf formatters in escaped string`` () =
945945 """
946946let _ = sprintf @"%A "
947947"""
948- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 18 , 20 ]]
948+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 18 , 21 ]]
949949
950950[<Test>]
951951let ``printf formatters in triple - quoted string`` () =
952952 " let _ = sprintf \"\"\" %A \"\"\" "
953- => [ 1 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 19 , 21 ]]
953+ => [ 1 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 19 , 22 ]]
954954
955955[<Test>]
956956let ``multi - line printf formatters`` () =
@@ -959,9 +959,9 @@ let _ = printfn "foo %s %d
959959 %A bar
960960%i "
961961"""
962- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 21 , 23 ; Cat.Printf, 24 , 26 ]
963- 3 , [ Cat.Printf, 17 , 19 ]
964- 4 , [ Cat.Printf, 0 , 2 ] ]
962+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 21 , 24 ; Cat.Printf, 24 , 27 ]
963+ 3 , [ Cat.Printf, 17 , 20 ]
964+ 4 , [ Cat.Printf, 0 , 3 ] ]
965965
966966[<Test>]
967967let ``printf formatters in for expressions`` () =
@@ -974,18 +974,18 @@ for _ in (sprintf "%d" 1).ToCharArray() do
974974|> ignore
975975
976976 """
977- => [ 2 , [ Cat.Function, 10 , 17 ; Cat.Printf, 19 , 21 ; Cat.Function, 26 , 37 ]
978- 3 , [ Cat.Function, 4 , 11 ; Cat.Printf, 13 , 15 ]
979- 5 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 23 ; Cat.Function, 28 , 39 ]
980- 6 , [ Cat.Function, 10 , 17 ; Cat.Printf, 19 , 21 ]
977+ => [ 2 , [ Cat.Function, 10 , 17 ; Cat.Printf, 19 , 22 ; Cat.Function, 26 , 37 ]
978+ 3 , [ Cat.Function, 4 , 11 ; Cat.Printf, 13 , 16 ]
979+ 5 , [ Cat.Function, 12 , 19 ; Cat.Printf, 21 , 24 ; Cat.Function, 28 , 39 ]
980+ 6 , [ Cat.Function, 10 , 17 ; Cat.Printf, 19 , 22 ]
981981 ]
982982
983983[<Test>]
984984let ``printf formatters in quoted expressions`` () =
985985 """
986986let _ = <@ sprintf "%A " @>
987987"""
988- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 11 , 18 ; Cat.Printf, 20 , 22 ; Cat.Quotation, 8 , 26 ]]
988+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 11 , 18 ; Cat.Printf, 20 , 23 ; Cat.Quotation, 8 , 26 ]]
989989
990990[<Test>]
991991let ``printf formatters if printf function is namespace qualified`` () =
@@ -994,8 +994,8 @@ let _ = Microsoft.FSharp.Core.Printf.printf "%A" 0
994994open Microsoft.FSharp.Core
995995let _ = Printf.printf "%A " 0
996996"""
997- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Module, 30 , 36 ; Cat.Function, 37 , 43 ; Cat.Printf, 45 , 47 ]
998- 4 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 21 ; Cat.Printf, 23 , 25 ]]
997+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Module, 30 , 36 ; Cat.Function, 37 , 43 ; Cat.Printf, 45 , 48 ]
998+ 4 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 21 ; Cat.Printf, 23 , 26 ]]
999999
10001000[<Test>]
10011001let ``printf formatters are not colorized in plane strings`` () =
@@ -1011,34 +1011,34 @@ let _ = fprintf null "%A" 0
10111011let _ = Microsoft.FSharp.Core.Printf.fprintf null "%A " 0
10121012let _ = fprintfn null "%A " 0
10131013"""
1014- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 22 , 24 ]
1015- 3 , [ Cat.Operator, 6 , 7 ; Cat.Module, 30 , 36 ; Cat.Function, 37 , 44 ; Cat.Printf, 51 , 53 ]
1016- 4 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 16 ; Cat.Printf, 23 , 25 ]]
1014+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 22 , 25 ]
1015+ 3 , [ Cat.Operator, 6 , 7 ; Cat.Module, 30 , 36 ; Cat.Function, 37 , 44 ; Cat.Printf, 51 , 54 ]
1016+ 4 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 16 ; Cat.Printf, 23 , 26 ]]
10171017
10181018[<Test>]
10191019let ``kprintf and bprintf formatters`` () =
10201020 """
10211021let _ = Printf.kprintf (fun _ -> ()) "%A " 1
10221022let _ = Printf.bprintf null "%A " 1
10231023"""
1024- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 22 ; Cat.Printf, 38 , 40 ]
1025- 3 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 22 ; Cat.Printf, 29 , 31 ]]
1024+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 22 ; Cat.Printf, 38 , 41 ]
1025+ 3 , [ Cat.Operator, 6 , 7 ; Cat.Module, 8 , 14 ; Cat.Function, 15 , 22 ; Cat.Printf, 29 , 32 ]]
10261026
10271027[<Test>]
10281028let ``wildcards in printf formatters`` () =
10291029 """
10301030let _ = sprintf "%*d" 1
10311031"""
1032- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 20 ]]
1032+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 21 ]]
10331033
10341034[<Test>]
10351035let ``float printf formatters`` () =
10361036 """
10371037let _ = sprintf "%7.1f " 1.0
10381038let _ = sprintf "%-8.1e +567" 1.0
10391039"""
1040- => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 22 ]
1041- 3 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 23 ]]
1040+ => [ 2 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 23 ]
1041+ 3 , [ Cat.Operator, 6 , 7 ; Cat.Function, 8 , 15 ; Cat.Printf, 17 , 24 ]]
10421042
10431043[<Test>]
10441044let ``malformed printf formatters`` () =
0 commit comments