Skip to content

Strip stray unquoted backslashes in action normalization#89

Merged
jrfaeder merged 1 commit into
RuleWorld:mainfrom
wshlavacek:modelapi-b4-strip-unquoted-backslashes
May 12, 2026
Merged

Strip stray unquoted backslashes in action normalization#89
jrfaeder merged 1 commit into
RuleWorld:mainfrom
wshlavacek:modelapi-b4-strip-unquoted-backslashes

Conversation

@wshlavacek
Copy link
Copy Markdown
Contributor

Summary

  • extend _normalize_action_text() to drop stray \ characters outside quoted strings
  • preserve backslashes inside quoted strings
  • add focused regression coverage in tests/test_bng_parsing.py

Why

BNG2.pl tolerates typo residue like ,\log_scale=>1, but the pyparsing action parser does not.

Testing

  • uv run python -m pytest -q tests/test_bng_parsing.py
  • uvx black --check bionetgen/modelapi/bngparser.py tests/test_bng_parsing.py

@jrfaeder jrfaeder merged commit 763888c into RuleWorld:main May 12, 2026
17 checks passed
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.

2 participants