From 5acb2499c1df14d6275b1ad9e139f02d1280cb9c Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Thu, 13 Jan 2022 10:15:12 +0100 Subject: facilitate managing repository URLs in a list; minor other changes --- compute_scripts.awk | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'compute_scripts.awk') diff --git a/compute_scripts.awk b/compute_scripts.awk index 1db79e0..6235e19 100755 --- a/compute_scripts.awk +++ b/compute_scripts.awk @@ -119,8 +119,7 @@ BEGIN { function process_file(path, read_path, mode, line, result, line_part, directive, directive_args, - if_nesting, if_nesting_true, if_branch_processed, - additional_line_nr) { + if_nesting, if_nesting_true, if_branch_processed) { if (path in modes && modes[path] != mode) { printf "ERROR: File %s used multiple times in different contexts\n", path > "/dev/stderr" @@ -166,10 +165,10 @@ function process_file(path, read_path, mode, } if (result == 0) { if (!(path in appended_lines_counts) || \ - additional_line_nr == appended_lines_counts[path]) + additional_line_nr[path] == appended_lines_counts[path]) break - line = appended_lines[path,++additional_line_nr] + line = appended_lines[path,++additional_line_nr[path]] } if (line !~ /^#/) { @@ -188,8 +187,8 @@ function process_file(path, read_path, mode, } if (result == 0) { if (path in appended_lines_counts && \ - additional_line_nr < appended_lines_counts[path]) { - line_part = appended_lines[path,++additional_line_nr] + additional_line_nr[path] < appended_lines_counts[path]) { + line_part = appended_lines[path,++additional_line_nr[path]] } else { printf "ERROR: Unexpected EOF in %s\n", read_path > "/dev/stderr" @@ -646,7 +645,7 @@ function print_amalgamation(js_deps, js_deps_count, } function print_usage() { - printf "USAGE: %s compute_scripts.awk -- [-D PREPROCESSOR_DEFINITION]... [-M manifest/to/process/manifest.json]... [-H html/to/process.html]... [-J js/to/process.js]... [-A js/to/append/to.js:appended_code]... [--help|-h] [--output-dir=./build] [--write-js-deps] [--write-html-deps] [--output=files-to-copy|--output=amalgamate-js:js/to/process.js]\n", + printf "USAGE: %s compute_scripts.awk -- [-D PREPROCESSOR_DEFINITION]... [-M manifest/to/process/manifest.json]... [-H html/to/process.html]... [-J js/to/process.js]... [-A file/to/append/to.js:appended_code]... [--help|-h] [--output-dir=./build] [--write-js-deps] [--write-html-deps] [--output=files-to-copy|--output=amalgamate-js:js/to/process.js]\n", ARGV[0] > "/dev/stderr" } @@ -711,8 +710,6 @@ function main(i, j, path, letter, dir, max_line_nr, js_deps, js_deps_count, return 1 } - modes[path] = "js" - clear_array(tmp_lines) code = ARGV[i] sub(/^[^:]+:/, "", code) -- cgit v1.2.3