I'm trying to get the hang of the Ada.Text_IO package, and it has many differences with IO of C.
One of them differences is how Get treats control characters and Horizontal or Character Tabulation specifically. I've read 83 and 2022 Reference Manual and I couldn't find anything about how Tab effects the column counter of a file (which is funny, because it specifically tells you it does at Ada2022 RM A.10 (8/5) :)).
I've written a small test:
procedure Ada_Parser.Parse (File : Ada.Text_IO.File_Type) is package TIO renames Ada.Text_IO; C : Character; Last_Column : TIO.Positive_Count; begin TIO.Get (File, C); Last_Column := TIO.Col (File); while not Ada.Text_IO.End_Of_File (File) loop case C is when ASCII.HT => TIO.Put_Line ("Tab! " & TIO.Col (File)'Image & " " & Last_Column'Image); when others => -- TIO.Put_Line ("Unhandled """ & C & """"); null; end case; Last_Column := TIO.Col (File); TIO.Get (File, C); end loop; end Ada_Parser.Parse; And in output I can see that Tab is only 1 column long:
Tab! 2 18 Tab! 3 2 Tab! 4 3 Tab! 2 91 Tab! 3 2
My goal is to write text file reading program with an option to set Tab Width, so the column number interpreted accordingly.
Unfortunately, I didn't find procedures to set Tab width in Ada.Text_IO package. How can I do it?