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(ranges): allow dollar signs #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rkretzschmar
Copy link

This PR adds support for ranges like $A1:$A3 or $1:$3 I found in an Excel file lately.

I added according unit tests.

Thanks for considering.

@rmdort
Copy link
Contributor

rmdort commented May 29, 2023

IMO, Its better to add a new pattern

const RowAbsolute = createToken({
  name: 'RowAbsolute',
  pattern: /[$][0-9]/,
})

And add an ALT branching to referenceItem rule

{
  ALT: () => {
    const address = $.CONSUME(RowAbsolute).image;
    return $.ACTION(() => {
      const row = this.utils.extractRowFromAddress(address)
      return $.ACTION(() => this.utils.parseRow(row));
    });
  },
}

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.

3 participants