* lib/ylwrap: Make indentation consistent (two spaces). --- ChangeLog | 5 ++++ lib/ylwrap | 64 ++++++++++++++++++++++++++++++------------------------------ 2 files changed, 37 insertions(+), 32 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 9e7adf6..52656b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-05-06 Stefano Lattarini <stefano.lattar...@gmail.com> + ylwrap: fix indentation + * lib/ylwrap: Make indentation consistent (two spaces). + +2011-05-06 Stefano Lattarini <stefano.lattar...@gmail.com> + ylwrap: some renaming of variables and subroutines * lib/ylwrap ($dirname): Renamed ... ($tempdir): ... to this. diff --git a/lib/ylwrap b/lib/ylwrap index d19d4db..90b087b 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -32,9 +32,9 @@ scriptversion=2011-05-05.12; # UTC usage_error () { - echo "$0: $*" >&2 - echo "Try \`$0 --help' for more information." >&2 - exit 2 + echo "$0: $*" >&2 + echo "Try \`$0 --help' for more information." >&2 + exit 2 } # Escape (most) sed metacharacters in the given string, so that it can @@ -81,34 +81,34 @@ set_yacc_filenames () # Usage: handle_renaming FROM TARGET handle_renaming () { - from=$1 - target=$2 - if test ! -f $tempdir/$from; then - echo "ylwrap: expected file \`$from' not found" >&2 - ret=1 - return - fi + from=$1 + target=$2 + if test ! -f $tempdir/$from; then + echo "ylwrap: expected file \`$from' not found" >&2 + ret=1 + return + fi - # Edit out `#line' or `#' directives. - # - # We don't want the resulting debug information to point at - # an absolute srcdir; it is better for it to just mention the - # .y file with no path. - # - # We want to use the real output file name, not yy.lex.c for - # instance. - # - # We want the include guards to be adjusted too. - # TODO: This include guards seems not to be generated anymore - # by newer bison versions (at least starting from 1.875; they - # were still generated in version 1.75, though). Also, BSD and - # Solaris yacc seems not to generate such include guards either. - # So, how much is this code still relevant today? - FROM=`tr_cpp "$from"` - TARGET=`tr_cpp "$target"` + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + # TODO: This include guards seems not to be generated anymore + # by newer bison versions (at least starting from 1.875; they + # were still generated in version 1.75, though). Also, BSD and + # Solaris yacc seems not to generate such include guards either. + # So, how much is this code still relevant today? + FROM=`tr_cpp "$from"` + TARGET=`tr_cpp "$target"` - sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$target," \ - -e "s,$FROM,$TARGET," $tempdir/"$from" >"$target" || ret=$? + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$target," \ + -e "s,$FROM,$TARGET," $tempdir/"$from" >"$target" || ret=$? } move_if_change () @@ -121,7 +121,7 @@ move_if_change () else echo "updating $dest" mv -f "$src" "$dest" - fi + fi } test $# -gt 0 || usage_error "missing argument" -- 1.7.2.3