Ignore:
Timestamp:
Oct 31, 2011, 7:00:42 PM (14 years ago)
Author:
dmik
Message:

def_quote_names: Fix regexp to make sure space before ordinal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/tools/bin/def_quote_names.sh

    r21752 r21768  
    2626AZ09_WITH_Q=$AZ_$AZ09_Q'*'$Q'+'$AZ09_Q'*'
    2727
     28REMINDER='(('$SP'+@[0-9]+('$SP'+NONAME)?)?('$SP'*;.*)?'$SP'*)'
     29
    2830sed -r '
    2931{
    3032  # foo = bar@0       =>     foo = "bar@0"
    31   s/^('$SP'*)("?'$AZ_$AZ09_'+"?'$SP'*='$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)(('$SP'+@[0-9]+)?.*)$/\1\2"\4"\6/
     33  s/^('$SP'*)("?'$AZ_$AZ09_'*"?'$SP'*='$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)'$REMINDER'$/\1\2"\4"\6/
    3234  # foo@0 = bar@0     =>     "foo" = "bar@0"
    33   s/^('$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)('$SP'*='$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)(('$SP'+@[0-9]+)?.*)$/\1"\3"\5"\7"\9/
     35  s/^('$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)('$SP'*='$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)'$REMINDER'$/\1"\3"\5"\7"\9/
    3436  # foo@0 = bar       =>     "foo" = bar
    3537  # foo@0             =>     "foo"
    36   s/^('$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)('$SP'*='$SP'*"?'$AZ_$AZ09_'+"?)?(('$SP'+@[0-9]+)?.*)?$/\1"\3"\5\6/
     38  s/^('$SP'*)(('$AZ09_WITH_Q')('$SP$SP')?)('$SP'*='$SP'*"?'$AZ_$AZ09_'*"?)?'$REMINDER'$/\1"\3"\5\6/
    3739}
    3840' < "$IN_DEF" > "$OUT_DEF"
Note: See TracChangeset for help on using the changeset viewer.