=== modified file 'query.pl' --- query.pl 2015-09-10 07:58:55 +0000 +++ query.pl 2015-09-09 16:23:54 +0000 @@ -61,11 +61,9 @@ awk_string_content(L) --> awk_string_content(L,[]). awk_regex_content([0'\\,H|T],R) --> - [0'\\,H], - !, - awk_regex_content(T,R). + [0'\\,H], !, awk_regex_content(T,R). awk_regex_content([H|T],R) --> - [H], { H\=0'\\, H\=0'/ }, + [H], { H \= 0'" }, !, awk_regex_content(T,R). awk_regex_content(R,R) --> []. @@ -83,8 +81,8 @@ awk_code([0'/|T0],R,Prev,F) --> { memberchk(Prev, [delim, op]) }, `/`, !, awk_regex_content(T0,T1), `/`, { T1=[0'/|T2] }, awk_code(T2,R,expr,F). -awk_code([0'#|T],R,_,F) --> - `#`, !, awk_comment(T,T1), awk_code(T1,R,op,F). +awk_code([0'#|T],R,Prev,F) --> + `#`, !, awk_comment(T,T1), awk_code(T1,R,Prev,F). awk_code([H|T],R,Prev,F) --> [H], { code_type(H, white) }, !, awk_code(T,R,Prev,F). awk_code([H|T],R,_,F) --> @@ -151,7 +149,7 @@ %%% -main([InFile]) :- !, +main([InFile]) :- (phrase_from_file(query_awk(Awk), InFile) -> true ; throw(parsing_failed)), (phrase(out_awk(Awk), Out) -> true ; throw(formatting_failed(Awk))), format('~s', [Out]).