Skip to content

Parser error newline #303

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

Merged

Conversation

TooMuchDakka
Copy link
Collaborator

@TooMuchDakka TooMuchDakka commented Jul 12, 2025

Description

This PR replaces the workflow (read from widget -> write to file -> read from file) used by the syrec-editor python application to synthesis the user-defined SyReC program in the code editor widget by simply passing the contents of the code editor to the parser.

The current workflow does not work under Windows due to a hard-coded path to the temporary file used to store the contents of the code editor and while a refactoring with the cross-platform QTemporaryFile would be possible, simply parsing the contents of the code editor using the mqt.syrec.program_read_from_string(...) functionality is easier.

A small update to the regex used to split the reported errors of the parser as mentioned in the related issue was also added to cover all potential line endings generated by the parser.

Fixes #287

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

…e editor to file used during synthesis with cross-platform solution utilizing QtTemporaryFile
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@TooMuchDakka TooMuchDakka marked this pull request as ready for review July 13, 2025 00:24
@TooMuchDakka TooMuchDakka added python Anything related to Python code fix Changes fixing something that was not working labels Jul 18, 2025
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@burgholzer burgholzer merged commit fd25af8 into munich-quantum-toolkit:main Jul 19, 2025
17 checks passed
@TooMuchDakka TooMuchDakka deleted the parser-error-newline branch July 19, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Changes fixing something that was not working python Anything related to Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Parsing errors regex of syrec-editor not considering OS-dependent line endings of error messages
2 participants