Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openpyxl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 233
    • Issues 233
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • openpyxl
  • openpyxl
  • Merge requests
  • !345

Treat : as infix operator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Bitbucket Importer requested to merge topic/default/bitbucket-pr-345 into branch/2.6 Sep 14, 2019
  • Overview 6
  • Commits 8
  • Changes 4

Created originally on Bitbucket by piti118 (Piti Ongmongkolkul)

Currently the cell that is of the form function:range function:function range:function are not correctly parsed.

For example, =SUM(OFFSET(A1,1,1):C3) is parsed as

[
('SUM(', 'FUNC', 'OPEN'),
('OFFSET(', 'FUNC', 'OPEN'),
('A1', 'OPERAND', 'RANGE'),
(',', 'SEP', 'ARG'),
('1', 'OPERAND', 'NUMBER'),
(',', 'SEP', 'ARG'),
('1', 'OPERAND', 'NUMBER'),
(')', 'FUNC', 'CLOSE'),
(':C3', 'OPERAND', 'RANGE'), # note the colon
(')', 'FUNC', 'CLOSE')
]

This PR fix it such that it is parsed to

[
('SUM(', 'FUNC', 'OPEN'),
('OFFSET(', 'FUNC', 'OPEN'),
('A1', 'OPERAND', 'RANGE'),
(',', 'SEP', 'ARG'),
('1', 'OPERAND', 'NUMBER'),
(',', 'SEP', 'ARG'),
('1', 'OPERAND', 'NUMBER'),
(')', 'FUNC', 'CLOSE'),
(':', OP_IN, ''), # notice : is now treated as OP_IN
('C3', 'OPERAND', 'RANGE'),
(')', 'FUNC', 'CLOSE')
]

This PR also maintain backward compatibility of how the parser treat constant range such as A1:A2 or A1:3 as a single range.

‌

This issue affect library such as pycel which the PR for the said library will be submitted shortly.

https://github.com/dgorissen/pycel/issues/17

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: topic/default/bitbucket-pr-345