-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Taking care of a small subset of the prerequisites for awkpaste. Also, preparing to rename 'lib/' to 'src/'. == Build process == * Adding a Makefile to enable a build process as an optimizatoin for awkpaste and possibly awkbot, although awkbot has special needs. * note: cpp still outputs metric fucktons of warnings as a result of normal comments, this should be corrected through whatever means is necessary even if it means just figuring out a reasonable way for hiding a particular class of warning * Added bin/teststrap - a little script to run the tests in t/ and report on their status. Doesn't work particularly well. Things needed on it: * Return error code properly * Report success/failure accordingly though stderr * Might want to build it into the makefile, actually * Added a cpp-filter sed script, this is probably temporary as I've discovered it doesn't particularly work well due to the fact that it is unable to filter all files that are included == Additional == * Found atleast one more include directive. include doesn't work very well with awk, so import is being used instead despite the fact that it's a deprecated feature. * Added lib/tempfile.awk since several things are now dependent upon it git-svn-id: http://svn.blisted.org/trunk/awkbot@48 ebfa9934-6f10-0410-9599-894cdf3d53f0
- Loading branch information
scott
committed
Jul 27, 2007
1 parent
fd8d688
commit 42666a6
Showing
8 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
|
|||
# Awkbot makefile, mostly just to bootstrap the test suite, but will also run | |||
# cpp to perminantly generate awkbot and awkpaste.. | |||
|
|||
awkbot: | |||
cpp -I /usr/share/awk -I lib lib/awkbot-boot.awk 2> /dev/null > bootstrap | |||
cpp -I /usr/share/awk/ -I lib lib/awkbot.awk 2> /dev/null > bootstrap | |||
|
|||
awkpaste: | |||
cpp -I /usr/share/awk -I lib lib/awkpaste.awk 2> /dev/null > awkpaste | |||
|
|||
test: | |||
./bin/teststrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
#!/bin/sh | |||
|
|||
failed=1 | |||
|
|||
for file in t/*.awk | |||
do | |||
tmpfile=`tempfile` | |||
echo processing $file | |||
# Strip comments, stolen from perl! | |||
sed -f cpp-filter.sed $file | cpp -I lib -I /usr/share/awk > $tmpfile | |||
echo running $file | |||
awk -f $tmpfile | |||
if [ $? = 1 ] | |||
then | |||
echo "$file failed" | |||
failed=`expr $failed + 1` | |||
fi | |||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
# if it's a comment | |||
/^ *#/ { | |||
|
|||
# The below would look like this, if it wasn't so way too long to fit | |||
# within a terminal | |||
# /^ *# | |||
# *\(\(if\|ifn\|un\)def\|if\|\(el\|end\)if\|define\|include\|import | |||
# \|else\|error\|pragma\)/b | |||
|
|||
# if it's a preprocessing directive, or atleast looks like one, leave it. | |||
/^ *# *if/p | |||
/^ *# *else/p | |||
/^ *# *ifdef/p | |||
/^ *# *ifndef/p | |||
/^ *# *undef/p | |||
/^ *# *define/p | |||
/^ *# *include/p | |||
/^ *# *import/p | |||
/^ *# *else/p | |||
/^ *# *elif/p | |||
/^ *# *endif/p | |||
/^ *# *error/p | |||
/^ *# *pragma/p | |||
/^ *# *line/p | |||
# Just delete everything else | |||
d | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
|
|||
function tempfile (prefix ,call,result) { | |||
call = "tempfile -p " prefix | |||
call | getline result | |||
close(call) | |||
return result | |||
} | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
|
#import <irc.awk> | ||
BEGIN { | BEGIN { | ||
irc_set("debug", 1) | irc_set("debug", 1) | ||
|
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters