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

fix: handle subscripts correctly when nested in expr within array function call #48

Merged
merged 1 commit into from
Sep 17, 2020

Conversation

chrispcampbell
Copy link
Contributor

The primary part of this fix was to keep track of the current array function in a separate variable, currentArrayFunctionName, and use that in a couple places instead of accessing the most direct currentFunctionName, which is not accurate in the case of nested expressions.

As part of this, I changed LOOKUP so that it returns :NA: when the given Lookup is NULL, which can happen in the case of sparse datasets. I made this change here since the new sumif test case uses a sparse matrix (i.e., it's purposely missing data in one dimension).

I also changed initMode to mode and made the values more explicit, because I found that the previous approach was not fine-grained enough and would cause lookups to sometimes be initialized redundantly (for example, if a lookup is referenced inside of initLevels). With this new approach, we're more clear about whether we are in "decl" mode, or a specific kind of "init" mode, or "eval" mode.

Fixes #46

@chrispcampbell chrispcampbell merged commit b2458ab into develop Sep 17, 2020
@chrispcampbell chrispcampbell deleted the ccampbell/46-array-func-subscripts branch September 17, 2020 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscripts not handled correctly when nested in expr within array function
1 participant