The objective here is easy: improve the debugging experience of the Perlang compiler by making all Stmt and Expr subclasses have a good (preferably, excellent) ToString() implementation. This method is typically called by debuggers when viewing the contents of local variables and parameters.
Here's what it looks like right now:
The screenshot above illustrates this well. Stmt.Var has a good implementation, where it virtually reconstructs the Perlang source code (var i = 12). Stmt.ExpressionStmt and Stmt.Print are much harder to debug; you more or less have to manually inspect these variables to get a glimpse of what's going on.
This should be pretty straightforward for most expression types, and we should clearly call other ToString() methods recursively in this.
Moved to GitLab
Please continue to the new version of this issue here: https://gitlab.perlang.org/perlang/perlang/-/issues/411. The GitHub page you are currently reading will not contain the latest information on this issue.
The objective here is easy: improve the debugging experience of the Perlang compiler by making all
Stmt
andExpr
subclasses have a good (preferably, excellent)ToString()
implementation. This method is typically called by debuggers when viewing the contents of local variables and parameters.Here's what it looks like right now:
The screenshot above illustrates this well.
Stmt.Var
has a good implementation, where it virtually reconstructs the Perlang source code (var i = 12
).Stmt.ExpressionStmt
andStmt.Print
are much harder to debug; you more or less have to manually inspect these variables to get a glimpse of what's going on.This should be pretty straightforward for most expression types, and we should clearly call other
ToString()
methods recursively in this.