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

exhaustive quickcheck syntax fails formatting with ParseError #1831

Closed
mikex-oss opened this issue Jan 7, 2025 · 4 comments
Closed

exhaustive quickcheck syntax fails formatting with ParseError #1831

mikex-oss opened this issue Jan 7, 2025 · 4 comments
Assignees
Labels
bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter

Comments

@mikex-oss
Copy link
Collaborator

mikex-oss commented Jan 7, 2025

Describe the bug
The new feature implementing #1715 by PR #1829 seems to work as a DSLX test, but the formatter errors out with:

Formatting failed: Error: INVALID_ARGUMENT: ParseError: 
Expected '=', got ')'
=== Source Location Trace: ===
xls/dslx/frontend/bindings.h:58
xls/dslx/frontend/token_parser.cc:102
xls/dslx/frontend/parser.cc:1714
xls/dslx/frontend/parser.cc:391
xls/dslx/parse_and_typecheck.cc:71
xls/dslx/dslx_fmt.cc:91

To Reproduce
The new example in the documentation triggers this behavior:

// `u8` space is small enough to check exhaustively.
#[quickcheck(exhaustive)]
fn prop_double_bitreverse(x: u8) -> bool {
  x == rev(rev(x))
}

Expected behavior
Formatting succeeds.

@mikex-oss mikex-oss added bug Something isn't working or is incorrect dslx:fmt DSLX auto-formatter labels Jan 7, 2025
@mikex-oss
Copy link
Collaborator Author

@cdleary for vis

@cdleary
Copy link
Collaborator

cdleary commented Jan 7, 2025

@mikex-oss thanks, we should probably also check the documentation examples auto-format in addition to running them as tests -- I should be able to fix quickly

@cdleary
Copy link
Collaborator

cdleary commented Jan 7, 2025

@mikex-oss note in #1832 I could not observe this via unit tests, your dslx_fmt may be stale?

@mikex-oss
Copy link
Collaborator Author

Sorry for the noise. I forgot (again) about the delay due to the release cadence of our autoformatter, so these types of changes aren't available atomically.

Confirmed this is working now.

@cdleary cdleary closed this as completed Jan 8, 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
Projects
None yet
Development

No branches or pull requests

2 participants