Skip to content

XMILE operators should be case insensitive #463

@benslavin

Description

@benslavin

The XMILE specification states that "identifiers MAY use any mixture of uppercase and lowercase letters, but identifiers that differ only by case will be considered the same" (3.2.2.2) and that "the operator names AND, OR, and NOT [...] are reserved identifiers." (3.2.2.5)

Given this, the operators should be treated in a case insensitive manner. However, pysd currently only recognizes XMILE operators (AND, OR) when presented in lowercase.

When using uppercase, for example...

Given the input equation:
<eqn>( IF true_input AND false_input THEN 1 ELSE 0 )</eqn>

A parsing error will be generated of the form:
parsimonious.exceptions.VisitationError: KeyError: '012e2740d4ee4180969f747b5b71c02bAND756dca4992c74317b8c54296494a7758'

Note the 'AND' in the middle of the generated key, which has been improperly handled.

I'll generate a PR to address this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions