aureliojargas / sedsed

Debugger and code formatter for sed scripts
https://aurelio.net/projects/sedsed/
GNU General Public License v3.0
115 stars 10 forks source link

Only regex addresses should be saved as lastaddr #69

Closed aureliojargas closed 4 years ago

aureliojargas commented 4 years ago

Currently, numeric and $ are also saving lastaddr. They shouldn't.

$ python sedsed.py --token -e '999x;s///'
    linenr:1
     addr1:999
 addr1flag:
     addr2:
 addr2flag:
  lastaddr:
  modifier:
        id:x
   content:
 delimiter:
   pattern:
   replace:
      flag:
   comment:

    linenr:1
     addr1:
 addr1flag:
     addr2:
 addr2flag:
  lastaddr:999
  modifier:
        id:s
   content:
 delimiter:/
   pattern:
   replace:
      flag:
   comment:

$ python sedsed.py --token -e '$x;s///'
    linenr:1
     addr1:$
 addr1flag:
     addr2:
 addr2flag:
  lastaddr:
  modifier:
        id:x
   content:
 delimiter:
   pattern:
   replace:
      flag:
   comment:

    linenr:1
     addr1:
 addr1flag:
     addr2:
 addr2flag:
  lastaddr:$
  modifier:
        id:s
   content:
 delimiter:/
   pattern:
   replace:
      flag:
   comment:

Note how lastaddr was incorrectly set to 999 and $ in the examples.