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

[FIX] Proper marking of flat compound statements while debugging #4766

Merged
merged 7 commits into from
Dec 4, 2023

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Nov 16, 2023

Description

Changes the regex that was used to group the different parts of the flat compound statements to be able to properly color nested flat statements. Also changes the way the line is computed.

A nested flat statement are if with repeat inside or viceversa. You cannot place an if inside a if, but you can place a
repeat inside a repeat.

Even though we say these statements are flat, it's possible to add newlines between them. And this is where the problem lied. When these statements where split between lines, the code did not account for beginning and end of statements properly.

**Fixes #4725 **

How to test

I added a couple of tests!

@jpelay jpelay changed the title [FIX] [FIX] Proper marking of flat compound statements while debugging Nov 16, 2023
@jpelay jpelay requested a review from Felienne December 1, 2023 20:44
Copy link
Member

@Felienne Felienne left a comment

Choose a reason for hiding this comment

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

Fixes the problem!

image

(hope the broken Cypress test will be fixed with an update form main)

Copy link
Contributor

mergify bot commented Dec 4, 2023

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 2643ba9 into hedyorg:main Dec 4, 2023
9 checks passed
@@ -452,7 +451,7 @@ describe('Test editor box functionality', () => {
cy.focused().type("repeat 1 times if x is x print 'a'\nelse print 'b'");

cy.get('#debug_button').click();
cy.wait('@parse');
cy.wait('@parse')
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed a semicolon and they magically worked again 😐

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.

[BUG] Debugger not coloring correctly flat ifs
2 participants