Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ed: start breaking up edParse() (#771)
* Unhook commands E, e, f, H, h, P, Q and q from the large regex in edParse(); the idea is to remove the large regex entirely * Commands E, e and f allow zero or one argument; the other commands require no argument * None of these commands allows an address prefix, e.g. 1,2P is invalid * When testing against GNU ed I discovered "f FILENAME" should still print the filename when setting it * Later the remaining commands can be removed from the large regex if calculateLine() function strips address prefix from $_ at start of edParse() %perl ed # start with empty buffer and no saved filename P ---> toggle * prompt *e a.c ---> start editing file a.c 197 *H ---> toggle auto-help *123d ? invalid address ---> error message displays by itself *H ---> disable auto-help *,d ---> delete all lines *h ---> display previous error saved from 123d command invalid address *E ---> reload a.c because I don't want to delete all lines 197 *f ---> show saved filename a.c *f a.c.copy ---> set new filename to write to a.c.copy *1,2d ---> delete first two lines *w ---> write changes to a.c.copy 158 *q
- Loading branch information