Underscore does not work as expected
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
The bug is in how the PRQL parser lexes binary integer literals, so start in the Rust parser crate where numeric literals are tokenized and find the binary branch, which accepts _ directly after the 0b prefix but not between digits. Reproduce it by running the four filter foo == 0b... lines from the issue through the compiler and check which ones fail. Done means all four compile to SQL and the existing literal tests still pass.
Written by the indexing model from the issue text.
Description
What happened?
I can do 0b11110000 and 0b_11110000 but not 0b1111_0000.
PRQL input
filter foo == 0b11110000 # Works
filter foo == 0b_11110000 # Works
filter foo == 0b1111_0000 # Does not work
filter foo == 0b1111_0000_1111_0000 # Does not work
SQL output
-
Expected SQL output
MVCE confirmation
- Minimal example
- New issue
Anything else?
I expect it to work like Python and Rust.
fn main() {
println!("Hello, world! {}", 0x1111_0000);
}
- Dominant language
- Rust
- Stars
- 10.9k
- Forks
- 261
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 84
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PRQL/prql
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 3 days
-
friendliness integrations
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
PRQL/prql#1636 · 2 comments · 2 reactions ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 1-2 days Newbie friendliness 12/100
Maintainers usually reply within 3 days
-
review-runs-tracking
Difficulty 3/5 Half a day Newbie friendliness 5/100
Maintainers usually reply within 3 days
-
Formatted SQL adds spaces inside the next string literal after a string ending in a backslashMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 4/5 1-2 days Newbie friendliness 38/100
Maintainers usually reply within 3 days
Similar issues
-
state:needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
zed-industries/zed#66543 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ruffle-rs/rust-flash-lso#142 ·
-
area: docs type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
light-curve/light-curve-python#870 ·
Maintainers usually reply within 1 day
-
bug file-compat priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
storytold/photocraft#11330 · 1 comment ·
Maintainers usually reply within 1 day