In each of the examples, the words in slanted font are entered by the user, and the text in typewriter font displays the normal output from iccfmt.
Assume the file simple.ada (following) exists:
-- A simple program for testing the ICC pretty printer. with text_io; use text_io; procedure simple is package int_io is new integer_io(integer); use int_io; begin int_io.default_width := 0; for i in 1..10 loop put(i); put(' '); end loop; new_line; end;
-- A simple program for testing the ICC pretty printer. with text_io; use text_io; procedure simple is package int_io is new integer_io(integer); use int_io; begin int_io.default_width := 0; for i in 1..10 loop put(i); put(' '); end loop; new_line; end simple;
% iccfmt -unit=upper -dotdot -for=5 simple
The resulting file simple.fmt:
-- A simple program for testing the ICC pretty printer. with TEXT_IO; use TEXT_IO; procedure SIMPLE is package int_io is new integer_io(integer); use int_io; begin int_io.default_width := 0; for i in 1 .. 10 loop put(i); put(' '); end loop; new_line; end simple;
% iccfmt simple.ada
ICC Ada Source Code Formatter [vx.x.x MMM DD, YYYY] "simple.ada", 2: Error: Syntax error before token "with". "simple.fmt": Info: Deleting file because of errors.