From 9d4fabd69113a8f2a80c1d991a495fe4f51f7df8 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 7 Jun 2017 11:17:04 -0700 Subject: [PATCH] Pretty printer commands.js --- commands.md | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/commands.md b/commands.md index d98e30055..8cd084003 100644 --- a/commands.md +++ b/commands.md @@ -60,12 +60,14 @@ Include this anywhere to force all parent groups to break. See `group` for more info. Example: ```js -group(concat([ - " ", - expr, - " ", - breakParent -])) +group( + concat([ + " ", + expr, + " ", + breakParent + ]) +) ``` ### join @@ -102,17 +104,23 @@ Increase the level of indentation. For an example, here's the implementation of the `ArrayExpression` node type: ```js -return group(concat([ - "[", - indent(options.tabWidth, - concat([ - line, - join(concat([",", line]), - path.map(print, "elements")) - ])), - line, - "]" -])); +group( + concat([ + "[", + indent( + options.tabWidth, + concat([ + line, + join( + concat([",", line]), + path.map(print, "elements") + ) + ]) + ), + line, + "]" + ]) +) ``` This is a group with opening and closing brackets, and possibly