Natools

Check-in [ce1e6e8edb]
Login
Overview
Comment:s_expressions-printers-pretty: fix cursor position after two-byte newlines in quoted strings
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ce1e6e8edb1d9d17998cf6e2435319b1c2af0290
User & Date: nat on 2014-07-28 20:18:16
Other Links: manifest | tags
Context
2014-07-29
21:53
s_expressions-printers-pretty-tests: new test to check tabulation width in quoted strings check-in: 01fc582c43 user: nat tags: trunk
2014-07-28
20:18
s_expressions-printers-pretty: fix cursor position after two-byte newlines in quoted strings check-in: ce1e6e8edb user: nat tags: trunk
2014-07-27
17:32
s_expressions-printers-pretty: fix cursor position after writing a quoted string check-in: 8fffe1590c user: nat tags: trunk
Changes

Modified src/natools-s_expressions-printers-pretty.adb from [e858dfbb7a] to [bf089f67f2].

353
354
355
356
357
358
359

360
361
362
363
364
365
366
                  Width_Adjust := -Offset (Cursor);
                  case Newline is
                     when LF | CR =>
                        Output_Delta := 1;
                     when CR_LF | LF_CR =>
                        Output_Delta := 2;
                        Input_Delta := 2;

                  end case;
               end if;
            when 0 .. 7 | 14 .. 31 =>
               Output_Delta := 4;
            when 16#80# .. 16#FF# =>
               case Encoding is
                  when ASCII =>







>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
                  Width_Adjust := -Offset (Cursor);
                  case Newline is
                     when LF | CR =>
                        Output_Delta := 1;
                     when CR_LF | LF_CR =>
                        Output_Delta := 2;
                        Input_Delta := 2;
                        Width_Adjust := Width_Adjust - 1;
                  end case;
               end if;
            when 0 .. 7 | 14 .. 31 =>
               Output_Delta := 4;
            when 16#80# .. 16#FF# =>
               case Encoding is
                  when ASCII =>
646
647
648
649
650
651
652

653
654
655
656
657
658
659
                     Width_Adjust := -Offset (Output.Cursor);
                     if Output.Param.Newline = CR_LF
                       or Output.Param.Newline = LF_CR
                     then
                        Input_Delta := 2;
                        Result (O + 1) := Data (I + 1);
                        Output_Delta := 2;

                     end if;
                  end if;
               when 11 =>
                  Result (O) := Encodings.Escape;
                  Result (O + 1) := Character'Pos ('v');
                  Output_Delta := 2;
               when 12 =>







>







647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
                     Width_Adjust := -Offset (Output.Cursor);
                     if Output.Param.Newline = CR_LF
                       or Output.Param.Newline = LF_CR
                     then
                        Input_Delta := 2;
                        Result (O + 1) := Data (I + 1);
                        Output_Delta := 2;
                        Width_Adjust := Width_Adjust - 1;
                     end if;
                  end if;
               when 11 =>
                  Result (O) := Encodings.Escape;
                  Result (O + 1) := Character'Pos ('v');
                  Output_Delta := 2;
               when 12 =>
673
674
675
676
677
678
679

680
681
682
683
684
685
686
                     Width_Adjust := -Offset (Output.Cursor);
                     if Output.Param.Newline = CR_LF
                       or Output.Param.Newline = LF_CR
                     then
                        Input_Delta := 2;
                        Result (O + 1) := Data (I + 1);
                        Output_Delta := 2;

                     end if;
                  end if;
               when Encodings.Quoted_Atom_End | Encodings.Escape =>
                  Result (O) := Encodings.Escape;
                  Result (O + 1) := Data (I);
                  Output_Delta := 2;
               when 0 .. 7 | 14 .. 31 =>







>







675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
                     Width_Adjust := -Offset (Output.Cursor);
                     if Output.Param.Newline = CR_LF
                       or Output.Param.Newline = LF_CR
                     then
                        Input_Delta := 2;
                        Result (O + 1) := Data (I + 1);
                        Output_Delta := 2;
                        Width_Adjust := Width_Adjust - 1;
                     end if;
                  end if;
               when Encodings.Quoted_Atom_End | Encodings.Escape =>
                  Result (O) := Encodings.Escape;
                  Result (O + 1) := Data (I);
                  Output_Delta := 2;
               when 0 .. 7 | 14 .. 31 =>