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

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Oct 28, 2024

  • 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 # empty buffer and no saved filename
P     ---> toggle * prompt
*e a.c   ---> start editing a file
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

* 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
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: ed The ed program labels Oct 28, 2024
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:07 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 28, 2024 06:08 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Oct 28, 2024

Pull Request Test Coverage Report for Build 11548331391

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 73.069%

Totals Coverage Status
Change from base Build 11512237477: -0.7%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

@coveralls
Copy link

coveralls commented Oct 28, 2024

Pull Request Test Coverage Report for Build 11548331389

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 73.069%

Totals Coverage Status
Change from base Build 11512237477: -0.7%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

@briandfoy briandfoy self-assigned this Oct 28, 2024
@briandfoy briandfoy merged commit 4c33692 into briandfoy:master Oct 28, 2024
22 of 23 checks passed
@briandfoy briandfoy removed the Priority: low get to this whenever label Oct 28, 2024
@briandfoy briandfoy added the Status: accepted The fix is accepted label Oct 28, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: ed The ed program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants