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: better relative addresses #902

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Jan 3, 2025

  • The initial implementation of relative addresses was too limited
  • GNU and OpenBSD ed allow repeated +n, mixed +n and --++, as well as basing address from dot, dollar or a marked address
For tests, current address was set to 10.

3+3=    6 (+n pattern applied to literal 3)
3++=    5 (++ applied to literal)
++1=    invalid: ambiguous
+=      current + 1
.+=     current + 1
+1=     current + 1
.+1=    current + 1
.+3++=  current + 5: ++ follows +n
$---=   end - 3
$-3=    end - 3
$-3+3=  end (repeated +n)
'x-5,'x+5nl      list 5 lines of context around marked line x

```

* The initial implementation of relative addresses was too limited
* GNU and OpenBSD ed allow repeated +n, mixed +n and --++, as well as basing address from dot, dollar or a marked address
* tests..

++1= invalid: ambiguous
+=   current +1
.+=  current + 1
+1=  current + 1
.+1= current + 1
.+3++=   current + 5: ++ follows +n
$---=   end - 3
$-3=   end - 3
$-3+3=   end: repeated +n
'x-5,'x+5nl      list 5 lines of context around marked line x
@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 Jan 3, 2025
@mknos mknos temporarily deployed to automated_testing January 3, 2025 06:37 — with GitHub Actions Inactive
@mknos mknos had a problem deploying to automated_testing January 3, 2025 06:37 — with GitHub Actions Failure
@mknos mknos had a problem deploying to automated_testing January 3, 2025 06:37 — with GitHub Actions Failure
@mknos mknos temporarily deployed to automated_testing January 3, 2025 06:37 — with GitHub Actions Inactive
@mknos mknos had a problem deploying to automated_testing January 3, 2025 06:37 — with GitHub Actions Failure
@briandfoy briandfoy merged commit 9f22ceb into briandfoy:master Jan 3, 2025
3 of 22 checks passed
@briandfoy briandfoy self-assigned this Jan 3, 2025
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Jan 3, 2025
@briandfoy
Copy link
Owner

changes: allow repeated - and + for relative addresses, such as 3++ or $--10

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: accepted The fix is accepted Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants