From 9aa158d530492c846fc8bd50d955f70cfe658a51 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 6 Jan 2009 20:39:06 +0000 Subject: [PATCH] Bring back our local ylwrap fix. --- ylwrap | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ylwrap b/ylwrap index 7278b6a..80cd57f 100755 --- a/ylwrap +++ b/ylwrap @@ -177,8 +177,21 @@ if test $ret -eq 0; then -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + prefix=`echo $input | sed \ + -e 's,^.*/,,g' \ + -e 's/_parse.[yl]$/_/g' \ + -e 's/_tok.[yl]$/_/g'` + + case $prefix in + *.y) + code_prefix="$(basename $prefix _gram.y)_yy";; + *.l) + code_prefix="$(basename $prefix _lex.l)_yy";; + *) + code_prefix="$prefix";; + esac sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ - -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + -e "s,$FROM,$TARGET," "$from" | sed "s/yy/$code_prefix/g" > "$target" || ret=$? # Check whether header files must be updated. if test $first = no; then -- 2.43.0