aboutsummaryrefslogtreecommitdiff
path: root/compute_scripts.awk
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-01-13 10:15:12 +0100
committerWojtek Kosior <koszko@koszko.org>2022-01-13 10:15:12 +0100
commit5acb2499c1df14d6275b1ad9e139f02d1280cb9c (patch)
tree9407e99955a654cd04cbf96b8f28f5a6e7f36289 /compute_scripts.awk
parentdd8de100acda322f2124c58163ecde6f1b37d61d (diff)
downloadbrowser-extension-5acb2499c1df14d6275b1ad9e139f02d1280cb9c.tar.gz
browser-extension-5acb2499c1df14d6275b1ad9e139f02d1280cb9c.zip
facilitate managing repository URLs in a list; minor other changes
Diffstat (limited to 'compute_scripts.awk')
-rwxr-xr-xcompute_scripts.awk15
1 files changed, 6 insertions, 9 deletions
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)