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

CURA-12386 G-Code replacement fails with single line code #20318

Open
wants to merge 5 commits into
base: 5.10
Choose a base branch
from

Conversation

wawanbreton
Copy link
Contributor

@wawanbreton wawanbreton commented Feb 26, 2025

The regex was not specific enough and would catch the rest of the line, now we force stopping as soon as we see a { or }

CURA-12386
Fixes 20183

CURA-12386
The regex was not specific enough and would catch the rest of the line, now we force stopping as soon as we see a { or }
Copy link
Contributor

github-actions bot commented Feb 26, 2025

Test Results

0 tests   - 23 701   0 ✅  - 23 699   0s ⏱️ -47s
0 suites  -      1   0 💤  -      2 
0 files    -      1   0 ❌ ±     0 

Results for commit 884983c. ± Comparison against base commit 9ac0f11.

♻️ This comment has been updated with latest results.

Copy link
Member

@rburema rburema left a comment

Choose a reason for hiding this comment

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

Looks good to me.

  • Unit-tests! Yes! 🎈
  • I briefly thought about [^}] instead of [^{}], but that wouldn't allow us to nest either (future features ...) and this does indeed make just as much sense (it's just wether you have a malformed bracket inside the replacement versus one outside -- but in the end it's the same syntax error).

@rburema
Copy link
Member

rburema commented Feb 27, 2025

Interestingly, it produces None in the GCode when you do {}, and just ignores any errors (so there's not error shown to the user) -- but I think it's quite fine for now!

@wawanbreton
Copy link
Contributor Author

Yeah, the idea is just to have this working as best as possible within the current limitations, until we replace it by something more powerful (Jinja !!!)

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.

3 participants