Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: start breaking up edParse() #771

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Commits on Oct 28, 2024

  1. ed: start breaking up edParse()

    * 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
    mknos authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    7df8487 View commit details
    Browse the repository at this point in the history