Skip to content

Flags and Debugging

yulia edited this page Mar 31, 2020 · 3 revisions

We have a few different types of logging to help us understand what is going on in the frontend. This is controlled by a couple of flags that you can turn on by either running cargo run -- <flag> or <target> <flag>. Flags are preceeded by two dashes. For example cargo run -- --help and target/debug/jsparagus-driver --help will both print out the help menu.

Available flags

  • --ast: prints out the ast. Example output:
> 1 + 1
(Script
  directives=[]
  statements=[
    (BinaryExpression
      operator=Add
      left=(NumericLiteral value=1)
      right=(NumericLiteral value=1))
  ])
2
  • -D, --bytecode: prints out the bytecode. example output:
> 1 + 1

Int8 1
Int8 1
Add
SetRval
RetRval

2
  • --emit-result: prints out a verbose emitter result object. The output is very long, so no example is provided here.
  • -h, --help: Prints help information
  • -V, --version: Prints version information
Clone this wiki locally