uutils / uutils/awk

Parser: accept exprs like `$$0++--`.

Open
#67 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

GNU bug
Dominant language
Rust
Stars
27
Forks
7
Avg merge
4h 32m
Merged PRs (30d)
11

Description

Title. Isomorphic expressions also fail to parse. These should parse the same way we currently accept $($0++)--. This is a bug because GNU AWK does accept them, but very amusingly, their docs give it as an example of an incorrect expression:

Also, operators cannot be combined in a way that violates the precedence rules; for example, $$0++-- is not a valid expression because the first $ has higher precedence than the ++; to avoid the problem the expression can be rewritten as $($0++)--.

Thus, and if possible, I would like the patch to be easily revertible.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Rust parser entry points that handle prefix $ and postfix ++/--, then compare their behavior with the already accepted $($0++)-- form. Add regression coverage for $$0++-- and verify that it parses successfully while preserving existing precedence behavior; keep the parser change easy to revert.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.