4 Pretty-Printing
This library provides facilities for pretty-printing JavaScript source. It be can required via:
(require (planet dherman/javascript:6/print)) |
This library depends on the pprint PLaneT package, which can be required via:
(require (planet dherman/pprint:4))
See the documentation for pprint for information on how to use it.
4.1 Formatting Terms
term : Term/X? |
Formats a JavaScript term as a doc for pretty-printing.
4.2 Configuration Parameters
The number of spaces to indent.
(Currently ignored.)
Non-block substatements stay on same line?
4.3 Extending the Pretty-Printer
As described in Extending the Language, it is possible to extend the language with custom forms. The pretty-printer can be extended with extra matchers that recognize just their form types and produce pretty-printed docs. Matchers should simple fail to match (raising the same error as (match) would for anything other than the forms they recognize.
| |
| |
|