From 6ede1232709548c5cdc6f35e3abd0bf71b875043 Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sun, 22 Sep 2024 21:37:27 +0000 Subject: [PATCH] discard expunge for backwards compat --- cbake.l | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cbake.l b/cbake.l index 56f551b..5e90348 100644 --- a/cbake.l +++ b/cbake.l @@ -1,4 +1,4 @@ -/* cbake.l @BAKE flex @FILE && cc -std=c99 -D_GNU_SOURCE -o @SHORT lex.yy.c @ARGS -lfl @STOP */ +/* cbake.l @BAKE flex @FILE && cc -std=c99 -D_GNU_SOURCE -o @{@SHORT} lex.yy.c @ARGS -lfl @STOP */ %{ #include @@ -18,8 +18,9 @@ int gac; char ** gav; /* Options */ int gselect = 1; -/* Line accum */ -int line = 1; +/* accum */ +int line = 1, expunge_depth = 0; + extern void root(char * filename); extern void args(int n); @@ -41,6 +42,8 @@ NUM [[:digit:]] @ARGS:{NUM}+ { args(atoi(strrchr(yytext, ':')+1)); } @ARGS|$\+ { args(-1); } @STOP { CHAR('\n'); if (gpipe) { fprintf(stderr, "output: "); } if (!gselect) { return 0; } BEGIN INITIAL; } + @\{ { ++expunge_depth; } + \} {if (!expunge_depth--) { ECHO; } } {SPACE}+ { CHAR(' '); } . { ECHO; } }