From: joey Date: Tue, 15 Apr 2003 22:15:55 +0000 (+0000) Subject: * Better flex fixups; make sure to link with -lfl even if building X-Git-Tag: 2.39~12 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=fb5da53f9aebccc37fa1aea6b6939fbbcb9ad659;p=filters.git * Better flex fixups; make sure to link with -lfl even if building indivitually, and move stuff that uses unput into %{ %} delimited blocks in rules section. --- diff --git a/Makefile b/Makefile index 1244d28..61342fb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ LEX = flex BUILD = jethro kraut cockney jive nyc ken ky00te newspeak OTHER = eleet b1ff chef jibberish upside-down rasterman studly fudd censor spammer -CFLAGS = -O2 +CFLAGS = -O2 -lfl INSTALL_PROGRAM = install # DEB_BUILD_OPTIONS suport, to control binary stripping. @@ -39,7 +39,7 @@ clean: .l: $(RM) $*.c $(LEX) -t $< > $*.c - $(CC) -O -o $@ $*.c -lfl $(CFLAGS) + $(CC) -o $@ $*.c $(CFLAGS) $(RM) $*.c .SUFFIXES: .dir diff --git a/cockney.l b/cockney.l index 823af7e..f6d0ad2 100644 --- a/cockney.l +++ b/cockney.l @@ -16,6 +16,20 @@ EW [ \t.,;!\?$] %Start junk %% + +%{ + void eos() { + if (yytext[yyleng-1] == '.') + dintI(); + else + unput(yytext[yyleng-1]); + } + + void plastc() { + unput(yytext[yyleng-1]); + } +%} + . { srandom(time(0L)); unput(yytext[0]); BEGIN 0; } {BW}[Tt]he{EW} { ECHO; bloody(); } {BW}[Ss]teal{EW} { printf("%c%cick",yytext[0],yytext[1]-5); @@ -89,29 +103,6 @@ ime{EW} { printf("oime"); eos(); } %% -eos() -{ - if (yytext[yyleng-1] == '.') - dintI(); - else - yyunput(yytext[yyleng-1], yytext); -} - -plastc() -{ - yyunput(yytext[yyleng-1], yytext); -} - -main() -{ - yylex(); -} - -int yywrap() -{ - return 1; -} - caseify(c) char c; { diff --git a/debian/changelog b/debian/changelog index 8079bbc..0809c26 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +filters (2.33) unstable; urgency=low + + * Better flex fixups; make sure to link with -lfl even if building + indivitually, and move stuff that uses unput into %{ %} delimited blocks + in rules section. + + -- Joey Hess Tue, 15 Apr 2003 15:06:25 -0400 + filters (2.32) unstable; urgency=low * Deal with the new flex 2.5.31 as follows: diff --git a/jethro.l b/jethro.l index 89ed150..408d396 100644 --- a/jethro.l +++ b/jethro.l @@ -263,13 +263,3 @@ er{EW} ESUB("uh"); ! SUB(". Ye DAWGies!!!"); %% - -main() -{ - yylex(); -} - -int yywrap() -{ - return 1; -} diff --git a/jive.l b/jive.l index 750b3cd..1171975 100644 --- a/jive.l +++ b/jive.l @@ -18,6 +18,12 @@ BW [ \t\(] EW [ \t.,;!\?$\)] %% +%{ + void plastc() + { + unput(yytext[yyleng-1]); + } +%} @[Bb]egin(.*) | ".so ".*$ printf("%s", yytext); {BW}send printf("%ct'row",yytext[0]); @@ -195,10 +201,6 @@ against printf("agin'"); meta printf("meta-fuckin'"); cally printf("c'l"); %% -plastc() -{ - yyunput(yytext[yyleng-1], yytext); -} caseify(c) char c; @@ -243,16 +245,6 @@ expletive() } } -main() -{ - yylex(); -} - -int yywrap() -{ - return 1; -} - /* * Bugs: * diff --git a/ken.l b/ken.l index 6c6788c..a8ee14c 100644 --- a/ken.l +++ b/ken.l @@ -286,14 +286,3 @@ aw printf("or"); . printf(yytext); \n printf("\n"); %% - -main() -{ - srand(getpid()); - yylex(); -} - -int yywrap() -{ - return 1; -} diff --git a/nyc.l b/nyc.l index e6546b2..b00f2b0 100644 --- a/nyc.l +++ b/nyc.l @@ -12,6 +12,11 @@ BW [ \t] SP [ \t] EW [ \t.,;!\?$] %% +%{ + void plastc() { + yyunput(yytext[yyleng-1], yytext); + } +%} ".so ".*$ printf("%s", yytext); [ao]ther printf("%cdder", yytext[0]=='a'?'a':'u'); [Nn]othing printf("%cuttin'", yytext[0]); @@ -66,10 +71,6 @@ negro printf("spade"); ! printf("! Okay?"); [a-z]"." { printf("%s", yytext);expletive();} %% -plastc() -{ - yyunput(yytext[yyleng-1], yytext); -} caseify(c) char c;