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

vtrace_fmt! is not compatible with formatter #1943

Open
mikex-oss opened this issue Feb 21, 2025 · 0 comments
Open

vtrace_fmt! is not compatible with formatter #1943

mikex-oss opened this issue Feb 21, 2025 · 0 comments
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end

Comments

@mikex-oss
Copy link
Collaborator

Describe the bug
I am unable to use vtrace_fmt! (introduced in 0af7633) due to interactions with the autoformatter.

To Reproduce
Write some code:

fn main() { 
    trace_fmt!("Hello world");
    vtrace_fmt!(4, "Hello world"); 
}

Run DSLX formatter and get:

fn main() {
    trace_fmt!("Hello world");
    vtrace_fmt!("Hello world");
}

Notice the verbosity level is dropped. Run DSLX formatter and get a parse error:

Formatting failed: Error: INVALID_ARGUMENT: ParseError: foo.x:3:16-3:31 vtrace_fmt! macro must have at least 2 arguments.
=== Source Location Trace: ===
xls/dslx/frontend/bindings.h:59
xls/dslx/frontend/parser.cc:2062
xls/dslx/frontend/parser.cc:2227
xls/dslx/frontend/parser.cc:2487
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1434
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:1328
xls/dslx/frontend/parser.cc:706
xls/dslx/frontend/parser.cc:3535
xls/dslx/frontend/parser.cc:1752
xls/dslx/frontend/parser.cc:224
xls/dslx/frontend/parser.cc:473
xls/dslx/parse_and_typecheck.cc:71
xls/dslx/dslx_fmt.cc:102
xls/dslx/dslx_fmt.cc:206

Expected behavior
The formatter shouldn't drop args in vtrace_fmt!.

@mikex-oss mikex-oss added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end dslx:fmt DSLX auto-formatter labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

No branches or pull requests

1 participant