36 lines
718 B
Plaintext
36 lines
718 B
Plaintext
|
|
:- style_check(all).
|
|
|
|
:- yap_flag( write_strings, on).
|
|
%:- yap_flag( gc_trace, verbose ).
|
|
|
|
:- use_module(library(readutil)).
|
|
:- use_module(library(lineutils)).
|
|
:- use_module(library(lists)).
|
|
:- use_module(library(maplist)).
|
|
:- use_module(library(system)).
|
|
|
|
:- initialization(main).
|
|
|
|
:- style_check(all).
|
|
|
|
:- yap_flag( double_quotes, string ).
|
|
%:- yap_flag( dollar_as_lower_case, on ).
|
|
|
|
main :-
|
|
nb_setval( state, out ),
|
|
repeat,
|
|
read_line_to_codes( S, Codes ),
|
|
( String == end_of_file
|
|
->
|
|
!
|
|
;
|
|
nb_getval( state, S0 ),
|
|
fix_indent( Codes, NCodes, S, S0),
|
|
nb_setval( state, S ),
|
|
format('~s', [NCodes]),
|
|
fail
|
|
).
|
|
|
|
fix_indent( Codes, NCodes, out, S0 ) :-
|
|
|