Branch: Tag:

2003-08-18

2003-08-18 09:54:49 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now passes through #line directives.
Now supports a larger number of newlines without overflowing hold.

Rev: src/strip_opcodes:1.12

9:   # o Character ranges may not contain literal newlines.      sed -e ' -  # First convert #line directives. +  # First pass-through and convert #line directives. +  /^#line/b    s/^# \([0-9]* "[^"]*"\).*$/#line \1/    s/^# \([0-9]*\).*$/#line \1/    t
21:       # Stupid IRIX cpp turns --- into -- -    # SysV sed does not support multi-character *-expressions, -  # so we use % instead. +  # so we use ½ instead.    s/ -- \{0,1\}- / ½ /g       # Make sure the substitute flag is cleared.
43:    # Keep only the newlines.   : keepnl    s/.//g' | sed -e ' +  # Redundant or extra newline and #line removal. +     # Remove newlines that were inserted by p.   : loop    /¤$/{
55:    # We are only interrested in the newline...    s/.//g    H +  x +  # RLE encode newlines so that we can avoid overflowing hold. +  s/\n\{16,16\}/¤/ +  s/¤\{16,16\}/½/ +  x    d    }    # Clear hold, and put #line directives there,
66:       # Print hold except for a possible initial newline.    x +  # Unpack the RLE. +  s/½/¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤/g +  s/¤/\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + /g    s/^\n//    p