Skip to content

[Compiler][Meta] Steps to allow compiling of syntactically wrong code when loading code #11944

Open
@MarcusDenker

Description

@MarcusDenker

Bug description
When executing a DoIt with code that has syntax errors or if you load code (e.g a .cs), the compiler raises a SyntaxErrorNotification which then opens a SyntaxErrorDebugger.

  • SyntaxErrorDebugger is broken and looks strange, it is hard to use, too
  • Every error opens a new SyntaxErrorDebugger, making it in practice very time consuming and not scriptable
  • The mechanism behind, the idea that an SyntaxErrorNotification can lead to the code being fixed in the exception raise code and then the compiler re-starting is very complex. See exception ReparseAfterSourceEditing

Idea

  • The Compiler already can compiled any text to some kind of AST (we use it for syntax higlighting).
  • The Code Generator can generate code for the RBParseErrorNode (this for raises a RuntimeSyntaxError and open a normal Debugger )

We should make a list of questions to answer and things todo that would allow us to just load syntactically wrong code and compile a method for it.

This would then mean that all interaction about fixing syntax errors is delayed to after the code is loaded and uses normal tools. People could even use meta-programming (e.g. a RBParseErrorNode awary ParseTreeRewriter) to fix all the methods.

TO CHECK

Next step after:

  • Enable it for DoIts and #evaluate:, as these do not create code that tools see, it should be save.

Fixed:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🏗 In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions