-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💻 Add curly braces around teacher adventures' code (#5253)
Adds curly braces automatically around keywords in the teacher's adventure code. For that, we iterate over the code snippets inside the contents of the editor, and use Lezer to parse and the code, and eventually iterate over the syntax tree to add curly braces around the keywords. The generated code should be as close as possible to the original one, maintaining indentation levels, spaces, and even errors. Also adds a warning for the case when the teacher selects several levels and also have code snippets, letting them know this can lead to trouble. Fixes #5140 **How to test** * Automated tests should pass (WIP) * Create an adventure, and write your code normally. * Log in as a student, or preview the class where that adventure was added and see that you can change the keywords language. * You could also see the generated code by going to the local database, searching for the adventure you just created and check that the keywords have curly braces around them.
- Loading branch information
Showing
63 changed files
with
866 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.