prql icon indicating copy to clipboard operation
prql copied to clipboard

feat: Support underscores in numbers

Open max-sixty opened this issue 2 years ago • 2 comments

Completes https://github.com/PRQL/prql/issues/1451

I haven't updated all the various grammars, I think that doesn't need to block (there will be some false errors but no false successes)

The pest is actually kinda difficult; expressing "can't end with an underscore".

max-sixty avatar Jan 09 '23 06:01 max-sixty

Very cool!

I was wondering if for your small example you might want to use 0.000_000_1 rather than 1.000_000_1? Of course that could also be expressed as 1e-7 so perhaps your example is better.

snth avatar Jan 09 '23 09:01 snth

That's what I had — but unfortunately sqlformat-rs messes up the formatting... (Something we should work out separately)

max-sixty avatar Jan 09 '23 16:01 max-sixty

I've now updated the grammars — the only one not updated is the textmate grammar in prql-vscode

max-sixty avatar Jan 09 '23 20:01 max-sixty