Give multiple times to enable a list of certain types of logs to stderr help debugging, e.g.:Note that this follows commander.js' insane variadic argumentso syntax, and thus the
./ourbigbook --log ast tokens -- index.bigb
--
is required above. If you want to omit it for a single value you have to add the =
sign as in:./ourbigbook --log=ast index.bigb
Values not documented in other sections:
ast
: the full final parsed abstract syntax tree as JSONast-simple
: a simplified view of the abstract syntax tree with one AstNode or AstArgument per line and showing only the most important fieldsast-pp-simple
: view snapshots of the various abstract syntax tree post process stages, more info at: conversion process overviewast-inside
: print the AST from inside theourbigbook.convert
call before it returns.This is useful to debug the program ifourbigbook.convert
blows up on the next stages before returning.db
: show database transactions done by OurBigBook, to help debug stuff like cross file referencesmem
: show process memory usage as per Node.js'process.memoryUsage()
after each--log perf
step: stackoverflow.com/questions/12023359/what-do-the-return-values-of-node-js-process-memoryusage-stand-for. Implies--log perf
.To use this options, you must run OurBigBook with the--expose-gc
command line option, e.g. with:node --expose-gc $(which ourbigbook) myfile.bigb
parse
: parsing stepstokenize
: tokenization stepstokens
: final parsed token streamtokens-inside
: likeast-inside
but for tokens.Also adds token index to the output, which makes debugging the parser way easier.