FreeBSD Bugzilla – Attachment 6098 Details for
Bug 14087
update sys/boot/ficl/softwords/softcore.awk
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.10 KB, created by
Joe Abley
on 1999-10-02 12:30:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Joe Abley
Created:
1999-10-02 12:30:00 UTC
Size:
4.10 KB
patch
obsolete
>*** softcore.awk.orig Sat Oct 2 23:19:48 1999 >--- softcore.awk Sat Oct 2 23:18:52 1999 >*************** >*** 1,6 **** >--- 1,15 ---- > #!/usr/bin/awk -f >+ # > # Convert forth source files to a giant C string >+ # > # Joe Abley <jabley@patho.gen.nz>, 12 January 1999 >+ # >+ # 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: src/sys/boot/ficl/softwords/softcore.awk,v 1.3 1999/09/29 10:58:43 dcs Exp $ > > BEGIN \ >*************** >*** 19,60 **** > printf "** Created automagically by ficl/softwords/softcore.awk\n"; > printf "*/\n\n"; > printf "#include \"ficl.h\"\n\n"; >! printf "static char softWords[] =\n"; > > commenting = 0; > } > > # some general early substitutions > { >! gsub("\t", " "); # replace each tab with 4 spaces >! gsub("\"", "\\\""); # escape quotes >! gsub("\\\\[[:space:]]+$", ""); # toss empty comments >! } >! >! # strip out empty lines >! /^ *$/ \ >! { >! next; > } > > # emit \ ** lines as multi-line C comments >! /^\\[[:space:]]\*\*/ && (commenting == 0) \ > { >! sub("^\\\\[[:space:]]", ""); >! printf "/*\n%s\n", $0; > commenting = 1; > next; > } > >! /^\\[[:space:]]\*\*/ \ > { >- sub("^\\\\[[:space:]]", ""); >- printf "%s\n", $0; > next; > } > >! # if we are in a comment, then close it now (actual meat for this >! # input line processed in later predicates) > (commenting != 0) \ > { > commenting = 0; >--- 28,64 ---- > printf "** Created automagically by ficl/softwords/softcore.awk\n"; > printf "*/\n\n"; > printf "#include \"ficl.h\"\n\n"; >! printf "static char softWords[] = \n"; > > commenting = 0; > } > > # some general early substitutions > { >! gsub(/\t/, " "); # replace each tab with 4 spaces >! gsub(/\"/, "\\\""); # escape quotes >! gsub(/\\[[:space:]]+$/, ""); # toss empty comments > } > > # emit \ ** lines as multi-line C comments >! /^\\[[:space:]]\*\*/ \ > { >! sub(/^\\[[:space:]]/, ""); >! if (commenting == 0) printf "/*\n"; >! printf "%s\n", $0; > commenting = 1; > next; > } > >! # strip blank lines >! /^[[:space:]]*$/ \ > { > next; > } > >! # if we have previously been processing a multi-line comment, then >! # close the comment now (since this line isn't part of a multi-line >! # comment) > (commenting != 0) \ > { > commenting = 0; >*************** >*** 65,110 **** > # (supports single-line directives only) > /^\\[[:space:]]#/ \ > { >! sub("^\\\\[[:space:]]", ""); > printf "%s\n", $0; > next; > } > >! # toss all other comments > /^[[:space:]]*\\/ \ > { > next; > } > >! # lop off trailing comments > /\\[[:space:]]+/ \ > { >! sub("\\\\[[:space:]]+.*$", ""); > } > >! # delete ( ) comments >! /[[:space:]]+\([[:space:]].*\)/ \ > { >! gsub("[[:space:]]+\([[:space:]].*\)", ""); > } > > # remove leading spaces > /^[[:space:]]+/ \ > { >! sub("^[[:space:]]+", ""); > } > > # removing trailing spaces > /[[:space:]]+$/ \ > { >! sub("[[:space:]]+$", ""); > } > > # emit all other lines as quoted string fragments > { >! sub("\\\\[[:space:]]+.*$", ""); # lop off trailing \ comments >! sub("[[:space:]]+$", ""); # remove trailing spaces >! printf " \"%s\"\n", $0; > next; > } > >--- 69,118 ---- > # (supports single-line directives only) > /^\\[[:space:]]#/ \ > { >! sub(/^\\[[:space:]]/, ""); > printf "%s\n", $0; > next; > } > >! # toss all other full-line \ comments > /^[[:space:]]*\\/ \ > { > next; > } > >! # lop off trailing \ comments > /\\[[:space:]]+/ \ > { >! sub(/\\[[:space:]]+.*$/, ""); > } > >! # expunge ( ) comments >! /[[:space:]]+\([[:space:]][^\)]*\)/ \ > { >! gsub(/[[:space:]]+\([[:space:]][^\)]*\)/, ""); > } > > # remove leading spaces > /^[[:space:]]+/ \ > { >! sub(/^[[:space:]]+/, ""); > } > > # removing trailing spaces > /[[:space:]]+$/ \ > { >! sub(/[[:space:]]+$/, ""); >! } >! >! # strip out empty lines again (preceding rules may have generated some) >! /^[[:space:]]*$/ \ >! { >! next; > } > > # emit all other lines as quoted string fragments > { >! printf " \"%s \"\n", $0; > next; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14087
: 6098