From 8beb9796b17b6ca48eb62df8fd3d31421e43c761 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 4 Sep 2014 09:40:09 +0300 Subject: New helper file, chlistref.awk. --- helpers/chlistref.awk | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 helpers/chlistref.awk (limited to 'helpers/chlistref.awk') diff --git a/helpers/chlistref.awk b/helpers/chlistref.awk new file mode 100644 index 00000000..49f63f59 --- /dev/null +++ b/helpers/chlistref.awk @@ -0,0 +1,31 @@ +BEGIN { + chapters["Getting Started"]++ + chapters["Invoking Gawk"]++ + chapters["Regexp"]++ + chapters["Reading Files"]++ + chapters["Printing"]++ + chapters["Expressions"]++ + chapters["Patterns and Actions"]++ + chapters["Arrays"]++ + chapters["Functions"]++ + chapters["Library Functions"]++ + chapters["Sample Programs"]++ + chapters["Advanced Features"]++ + chapters["Internationalization"]++ + chapters["Debugger"]++ + chapters["Arbitrary Precision Arithmetic"]++ + chapters["Dynamic Extensions"]++ + chapters["Language History"]++ + chapters["Installation"]++ + chapters["Notes"]++ + chapters["Basic Concepts"]++ + + Pattern = ".*@ref\\{([^}]+)\\},.*" +} + +$0 ~ Pattern { + ref = gensub(Pattern, "\\1", 1, $0) + if (! (ref in chapters)) + printf("%s:%d: %s\n", FILENAME, FNR, $0) +} + -- cgit v1.2.3