aat

git mirror of https://ccx.te2000.cz/bzr/aat
git clone https://ccx.te2000.cz/git/aat
Log | Files | Refs | README

commit 721a1f05d3a54107cf5bf5f474f29eacb529dab9
parent 6f84459aac721cd8d2f2f824c29faf8731b385d5
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Tue,  8 Jul 2014 22:10:05 +0200

fix macro readinto, more debug printouts
Diffstat:
Mbin/aat.awk | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/aat.awk b/bin/aat.awk @@ -60,6 +60,7 @@ function sh_escape(str) { # find a file relative to current filename and overwrite that variable function find_file(name) { + if(DEBUG) printf "find_file(\"%s\") PWD=\"%s\"\n", name, PWD >"/dev/stderr" # TODO: include search path if(name ~ /^\//) { # absolute path @@ -81,9 +82,11 @@ function find_file(name) { print_dep(filename) } -function macro_readinto(args, varname) { - varname = sub(/[ \t].*$/, "", args) - find_file(sub(/^[^ \t]+[ \t]+/, "", args)) +function macro_readinto(args, varname, fname) { + varname = fname = args + sub(/[ \t].*$/, "", varname) + sub(/^[^ \t]+[ \t]+/, "", fname) + find_file(fname) tok_type=T_AWK while(getline <filename) { gsub(/["\\]/, "\\&", $0) @@ -94,6 +97,7 @@ function macro_readinto(args, varname) { } function call_macro(name, args, file_old) { + if(DEBUG) printf "call_macro(\"%s\", \"%s\")\n", name, args >"/dev/stderr" # Macro to recursively parse another template if(name == "include"){ file_old = filename