Skip to content

parser: track @namespace context in AST pretty-printing#66

Merged
Alonely0 merged 1 commit into
uutils:mainfrom
Franklin-Qi:fix-issue#39-namespace-pretty-print
Jul 6, 2026
Merged

parser: track @namespace context in AST pretty-printing#66
Alonely0 merged 1 commit into
uutils:mainfrom
Franklin-Qi:fix-issue#39-namespace-pretty-print

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Contributor

Identifiers are fully qualified at parse time, but Display was emitting awk:: prefixes and dropping @namespace directives. Pretty-print now tracks the active namespace, omits redundant qualifiers, restores @namespace for non-awk scopes, and fixes Delete debug formatting to use Debug for indices.

Closed: #39

@Alonely0

Alonely0 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

I was just finished working on this 🫠... I had said I was working on this issue.

I went the hard route and just refactored everything not to use Display to avoid the thread_local and shenanigans. I ended up making a macro just for it not to explode in size tho.

@Alonely0

Alonely0 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Let me at least salvage the tests... This frustrates me a lot because I really hate effort going to waste. Please, next time check out with people if you want to take issues that are assigned to them. Makes collaboration easier as well :)

@Alonely0 Alonely0 force-pushed the fix-issue#39-namespace-pretty-print branch from a40a9fd to b827a46 Compare July 6, 2026 17:28
Identifiers are fully qualified at parse time, but Display was emitting
awk:: prefixes and dropping @namespace directives. Pretty-print now tracks
the active namespace, omits redundant qualifiers, restores @namespace for
non-awk scopes, and fixes Delete debug formatting to use Debug for indices.

Closed: uutils#39
@Alonely0 Alonely0 force-pushed the fix-issue#39-namespace-pretty-print branch from b827a46 to a3a4b19 Compare July 6, 2026 17:32
@Alonely0 Alonely0 merged commit 60c5698 into uutils:main Jul 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hard] Parser: @namespace tracking on pretty printing

2 participants