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

[LANGUAGE] Allow for translations of erroneous programs #4875

Merged
merged 19 commits into from
Dec 12, 2023

Conversation

Felienne
Copy link
Member

@Felienne Felienne commented Dec 8, 2023

(This is a redo of #4867 which contained some commits now already on main)

Since #4828 translation features are more prominently visible, so I figured we need to do a bit better. This actually changes some conceptual assumptions, so let's document here:

  • Programs that have a ParseError or contain Placeholders, or have indentation issues, still cannot be translated (since they can't be parsed and then we don't have a tree to work wtih)
  • All other errors however create a parsetree with error nodes, and thus... can just be translated keeping the error nodes, so that is what we now do!

How to test

Try a program with an error production, f.e. in German, level 7:
repeat 3 times 'Hedy macht Spaß!'

Main shows an error:
image

This PR translates the code:
image

@ghost
Copy link

ghost commented Dec 8, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@Felienne Felienne marked this pull request as ready for review December 9, 2023 09:37
@Felienne Felienne closed this Dec 9, 2023
@Felienne Felienne deleted the translations-cherrypicked branch December 9, 2023 10:50
@Felienne Felienne restored the translations-cherrypicked branch December 9, 2023 10:50
@Felienne Felienne reopened this Dec 9, 2023
@Felienne
Copy link
Member Author

Felienne commented Dec 9, 2023

(oops closed by mistake!)

Copy link
Member

@jpelay jpelay left a comment

Choose a reason for hiding this comment

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

It works nicely! This is very cool!!

Copy link
Contributor

mergify bot commented Dec 12, 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 34391db into main Dec 12, 2023
11 checks passed
@mergify mergify bot deleted the translations-cherrypicked branch December 12, 2023 14:19
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