xlsx: fix shared formula expansion corrupting function names#645
Open
cilladev wants to merge 4 commits intotafia:masterfrom
Open
xlsx: fix shared formula expansion corrupting function names#645cilladev wants to merge 4 commits intotafia:masterfrom
cilladev wants to merge 4 commits intotafia:masterfrom
Conversation
`replace_cell_names()` treated `LOG10` as a cell reference (column LOG, row 10) and offset the row, producing LOG11, LOG12, etc. Skip tokens immediately followed by `(` — those are function calls, not cell refs.
Collapse `if` into outer `match` arms (collapsible_match) and replace explicit loop counter with iterator zip (explicit_counter_loop).
Collaborator
|
Thanks. Could you also add a test case to the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #644.
What
replace_cell_names()treatsLOG10as a cell reference (columnLOG= #8509, row10) and applies the row offset during shared formula expansion. This producesLOG11,LOG12, ...,LOG19for subsequent rows.Why
Reference::parse()acceptsLOG10becauseLOGis a valid Excel column name (within the 16,384 column limit) and10is a valid row number. The tokenizer inreplace_cell_names()cannot distinguish function names from cell references.How
Skip tokens immediately followed by
(— in Excel formula syntax, a(after an alphanumeric token always means function call, never cell reference.Testing
Test file (
log10_shared.xlsx) attached to #644.