diff options
author | obrien <obrien@FreeBSD.org> | 2001-11-03 01:33:12 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-11-03 01:33:12 +0000 |
commit | 8e8327cb31c33403af87ab81fe7f799889901963 (patch) | |
tree | 43955333c0f16f2d85ea947a8cb132c2414815ed /sys/boot/ficl | |
parent | 572d6d9be0c8fbb4a339b02b8cef53de4c80f9ea (diff) | |
download | FreeBSD-src-8e8327cb31c33403af87ab81fe7f799889901963.zip FreeBSD-src-8e8327cb31c33403af87ab81fe7f799889901963.tar.gz |
Revert rev 1.7 which moved us away from POSIX character classes.
The community feels our base AWK must handle them.
Diffstat (limited to 'sys/boot/ficl')
-rw-r--r-- | sys/boot/ficl/softwords/softcore.awk | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/sys/boot/ficl/softwords/softcore.awk b/sys/boot/ficl/softwords/softcore.awk index 1a7a2ed..c41996a 100644 --- a/sys/boot/ficl/softwords/softcore.awk +++ b/sys/boot/ficl/softwords/softcore.awk @@ -7,6 +7,9 @@ # 02-oct-1999: Cleaned up awk slightly; added some additional logic # suggested by dcs to compress the stored forth program. # +# Note! This script uses strftime() which is a gawk-ism, and the +# POSIX [[:space:]] character class. +# # $FreeBSD$ BEGIN \ @@ -34,7 +37,7 @@ BEGIN \ { gsub(/\t/, " "); # replace each tab with 4 spaces gsub(/\"/, "\\\""); # escape quotes - gsub(/\\[ ]+$/, ""); # toss empty comments + gsub(/\\[[:space:]]+$/, ""); # toss empty comments } # strip out empty lines @@ -44,9 +47,9 @@ BEGIN \ } # emit / ** lines as multi-line C comments -/^\\[ ]\*\*/ \ +/^\\[[:space:]]\*\*/ \ { - sub(/^\\[ ]/, ""); + sub(/^\\[[:space:]]/, ""); if (commenting == 0) printf "/*\n"; printf "%s\n", $0; commenting = 1; @@ -54,7 +57,7 @@ BEGIN \ } # strip blank lines -/^[ ]*$/ \ +/^[[:space:]]*$/ \ { next; } @@ -67,10 +70,10 @@ function end_comments() } # pass commented preprocessor directives -/^\\[ ]#/ \ +/^\\[[:space:]]#/ \ { if (commenting) end_comments(); - sub(/^\\[ ]/, ""); + sub(/^\\[[:space:]]/, ""); printf "%s\n", $0; next; } @@ -83,31 +86,31 @@ function end_comments() } # lop off trailing \ comments -/\\[ ]+/ \ +/\\[[:space:]]+/ \ { - sub(/\\[ ]+.*$/, ""); + sub(/\\[[:space:]]+.*$/, ""); } # expunge ( ) comments -/[ ]+\([ ][^)]*\)/ \ +/[[:space:]]+\([[:space:]][^)]*\)/ \ { - sub(/[ ]+\([ ][^)]*\)/, ""); + sub(/[[:space:]]+\([[:space:]][^)]*\)/, ""); } # remove leading spaces -/^[ ]+/ \ +/^[[:space:]]+/ \ { - sub(/^[ ]+/, ""); + sub(/^[[:space:]]+/, ""); } # removing trailing spaces -/[ ]+$/ \ +/[[:space:]]+$/ \ { - sub(/[ ]+$/, ""); + sub(/[[:space:]]+$/, ""); } # strip out empty lines again (preceding rules may have generated some) -/^[ ]*$/ \ +/^[[:space:]]*$/ \ { if (commenting) end_comments(); next; |