From b8c7e935b637dbc756f692132a945fec423afe1c Mon Sep 17 00:00:00 2001 From: Jason Williams <936006+jasonwilliams@users.noreply.github.com> Date: Mon, 1 Jul 2019 00:20:27 +0100 Subject: [PATCH] Update CONTRIBUTING.md Adding debugging help --- CONTRIBUTING.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c1542b2db..b47078098a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,19 @@ If you don't already have Rust installed rustup is the recommended tool to use. Then simply clone this project and `cargo build` +### Debugging + +You can see the output of tokens by adding a `dbg!(&tokens);` here: +https://github.com/jasonwilliams/boa/blob/master/src/lib/lib.rs#L31 + +This is useful to know if the tokens are in the right order, or any unexpected tokens are appearing. + +The parser's expression tree can be viewed by adding `dbg!(&expr)` here: +https://github.com/jasonwilliams/boa/blob/master/src/lib/lib.rs#L34 + +To get a full backtrace you will need to set the environment variable `RUST_BACKTRACE=1` + + ### Web Assembly If you want to develop on the web assembly side you can run yarn serve then go to http://localhost:8080