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

XMILE operators should be case insensitive #463

Open
benslavin opened this issue Feb 26, 2025 · 0 comments
Open

XMILE operators should be case insensitive #463

benslavin opened this issue Feb 26, 2025 · 0 comments

Comments

@benslavin
Copy link

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.

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

No branches or pull requests

1 participant