-
Notifications
You must be signed in to change notification settings - Fork 5
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
Partial Row and Column Ranges #7
Conversation
This is good effort but there are some things we need to fix here:
From the looks of it, how ranges are parsed may need a bigger change. I noted, while exploring this, that Google Sheets has a dynamic range size limit. They won't parse (or perhaps expose?) a range if it exceeds current sheet bounds. So in the default "new sheet", which is sized |
@borgar Thanks for the review, really good points! Here are some thoughts:
Good point. I figure we could introduce a
Hmm, we may need to align on terminology here. To me, a "range beam" is equivalent to "column or row range", and I consider partial col/row ranges such as But I think you're right that we need to distunguish partial col/row ranges from whole col/row ranges. We have a few options:
Google Sheets seems to consider
Since
I had not considered this. I'll have to do some research to figure out how this should work.
We could add the sheet size as an option and use that in |
What
Add support for
A1:A
,A:A1
,1:A1
, andA1:1
ranges.How
Match
re_A1COL_PARTIAL
andre_A1ROW_PARTIAL
beforere_A1RANGE
re_A1RANGE
matchesA1
, so it can match the prefix of both partial row and column ranges:A1:A
- partial column rangeA1:1
- partial row rangeThis means that we need to match partial row and column ranges before attempting to match normal ranges.
re_A1COL_PARTIAL
andre_A1ROW_PARTIAL
regexes both have two capture groups, which can be represented like so (heavily simplified):I would have liked to do something like so:
But this would match normal ranges such as
A1:B2
, so we need to match both partial cases explicitly.The
re_A1COL_PARTIAL
regex contains a negative lookahead in theA1:A
case that disallows the match being followed by:(
, or.
, orThis prevents the following matches:
This is documented in a comment, and captured in tests.