=== modified file 'bin/aat.awk' --- bin/aat.awk 2015-07-25 04:11:12 +0000 +++ bin/aat.awk 2014-08-13 11:49:58 +0000 @@ -363,7 +363,7 @@ match_dbg("query", str) processed = processed "<" substr(str, 1, RLENGTH) ">" str = substr(str, RLENGTH+1) - } else if(match(str, /^\|[a-zA-Z_]/)) { + } else if(match(str, /^\|[a-zA-Z]/)) { # filters ahead match_dbg("filter", str) break === removed file 'query.pl' --- query.pl 2015-07-25 04:11:12 +0000 +++ query.pl 1970-01-01 00:00:00 +0000 @@ -1,92 +0,0 @@ -#!/usr/bin/swipl -q -g main -s -% vim: ft=prolog textwidth=80 tabstop=4 softtabstop=4 shiftwidth=4 expandtab - -:- use_module(library(pure_input)). -%%% :- use_module(library(dcg/basics)). - -query_name([H|T]) --> - [H], - { code_type(H, csymf) }, - query_name_next(T). -query_name_next([H|T]) --> - [H], - { H = 0'.; code_type(H, csym) }, - query_name_next(T). -query_name_next([]) --> []. - -query_content([name(Name)|T]) --> query_name(Name), query_content(T). -query_content([query(Query)|T]) --> query_exp(Query), query_content(T). -query_content([expr(Expr)|T]) --> `'`, query_awk(Expr), `'`, query_content(T). -query_content([]) --> []. - -query_exp(Content) --> `<`, query_content(Content), `>`. - -awk_string(String) --> `"`, awk_string_content(String), `"`. - -awk_string_content([0'\\,H|T],R) --> - [0'\\,H], !, awk_string_content(T,R). -awk_string_content([H|T],R) --> - [H], { H \= 0'/ }, awk_string_content(T,R). -awk_string_content(R,R) --> []. -awk_string_content(L) --> awk_string_content(L,[]). - -awk_regex_content([0'\\,H|T],R) --> - [0'\\,H], !, awk_regex_content(T,R). -awk_regex_content([H|T],R) --> - [H], { H \= 0'" }, awk_regex_content(T,R). -awk_regex_content(R,R) --> []. -awk_regex_content(L) --> awk_regex_content(L,[]). - -awk_comment([0'\n|R],R) --> `\n`, !. -awk_comment([H|T],R) --> [H], {assertion(H \= 0'\n)}, awk_comment(T,R). -awk_comment(L) --> awk_comment(L,[]). - -awk_code([0'"|T0],R,_,F) --> - `"`, !, awk_string_content(T0,T1), `"`, { T1=[0'"|T2] }, awk_code(T2,R,expr,F). -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,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) --> - [H], { memberchk(H, `\n,;([{=`) }, !, awk_code(T,R,delim,F). -awk_code([H|T],R,_,F) --> - [H], { memberchk(H, `!+-*/%^&|?:>~`) }, !, awk_code(T,R,op,F). -% awk_code([0'<|T],R,Prev,F) --> -% `<`, !, { Prev \= delim }, awk_code(T,R,op,F). -awk_code([H|T],R,Prev,F) --> -[H], { H \= 0'', H \= 0'@, (H \= 0'< ; Prev \= delim ) }, awk_code(T,R,expr,F). -awk_code(R,R,L,L) --> []. -% awk_code(L) --> awk_code(L,[],delim,_). - -query_awk([query(Query)|T],delim) --> - query_exp(Query), - query_awk(T, expr). -query_awk([code(Code)|T], Last) --> - awk_code(Code, [], Last, Next), - { Code \= [] }, - query_awk(T, Next). -query_awk([], _) --> []. -query_awk(L) --> query_awk(L,delim). - -%%% - -awk_out([code(Code)|T]) --> Code, awk_out(T). -awk_out([query(Query)|T]) --> `get(`, query_out(Query), `)`, awk_out(T). -awk_out([]) --> []. - -query_out([name(Name)|T]) --> `"`, Name, `"`, query_out(T). -query_out([query(Query)|T]) --> `get(`, query_out(Query), `)`, query_out(T). -query_out([expr(Expr)|T]) --> `(`, awk_out(Expr), `)`, query_out(T). -query_out([]) --> []. - -%%% - -main([InFile]) :- - phrase_from_file(query_awk(Awk), InFile), - phrase(awk_out(Awk), Out), - format('~s', [Out]). - -main([]) :- main("/dev/stdin"). === removed file 'query_example.awk' --- query_example.awk 2015-07-25 04:11:12 +0000 +++ query_example.awk 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -BEGIN { - foo() - x[>] = -}