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

AST dumper should have more new lines in the output #76

Open
kevin1 opened this issue Nov 16, 2015 · 1 comment
Open

AST dumper should have more new lines in the output #76

kevin1 opened this issue Nov 16, 2015 · 1 comment

Comments

@kevin1
Copy link
Collaborator

kevin1 commented Nov 16, 2015

Probably each expr should be followed by a new line. As we compile bigger and bigger programs, a one-line ast will not be readable.

@kevin1 kevin1 added the bug label Nov 16, 2015
@edwadli edwadli added tech debt and removed bug labels Nov 24, 2015
@kevin1
Copy link
Collaborator Author

kevin1 commented Dec 9, 2015

here's an example of what ocamldebug does:

sexpr: Sast.expr_typed =
  (Init ("key_sig",
    (Struct ("key_signature",
      [("scale",
        (Arr
          ([(LitFloat 261.63, Ast.Float); (LitFloat 293.66, Ast.Float);
            (LitFloat 329.63, Ast.Float); (LitFloat 349.23, Ast.Float);
            (LitFloat 392., Ast.Float); (LitFloat 440., Ast.Float);
            (LitFloat 493.88, Ast.Float)],
          Ast.Float),
         Ast.Array Ast.Float))]),
     Ast.Type "key_signature"),
    Ast.Mutable),
   Ast.Unit)

i remember there was some ocaml library that makes it easier to print indented stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants