@zackad/prettier-plugin-twig 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/package.json +1 -1
  2. package/src/melody/melody-parser/Lexer.js +3 -0
  3. package/src/print/AliasExpression.js +2 -2
  4. package/src/print/ArrayExpression.js +2 -2
  5. package/src/print/ArrowFunction.js +2 -2
  6. package/src/print/Attribute.js +2 -2
  7. package/src/print/AutoescapeBlock.js +2 -2
  8. package/src/print/BinaryExpression.js +4 -4
  9. package/src/print/BlockStatement.js +2 -2
  10. package/src/print/CallExpression.js +2 -2
  11. package/src/print/ConditionalExpression.js +2 -2
  12. package/src/print/Declaration.js +2 -2
  13. package/src/print/DoStatement.js +2 -2
  14. package/src/print/Element.js +2 -2
  15. package/src/print/EmbedStatement.js +2 -2
  16. package/src/print/ExpressionStatement.js +2 -2
  17. package/src/print/ExtendsStatement.js +2 -2
  18. package/src/print/FilterBlockStatement.js +2 -2
  19. package/src/print/FilterExpression.js +2 -2
  20. package/src/print/FlushStatement.js +2 -2
  21. package/src/print/ForStatement.js +2 -2
  22. package/src/print/FromStatement.js +2 -2
  23. package/src/print/GenericToken.js +2 -2
  24. package/src/print/GenericTwigTag.js +2 -2
  25. package/src/print/HtmlComment.js +2 -2
  26. package/src/print/Identifier.js +2 -2
  27. package/src/print/IfStatement.js +2 -2
  28. package/src/print/ImportDeclaration.js +2 -2
  29. package/src/print/IncludeStatement.js +2 -2
  30. package/src/print/MacroDeclarationStatement.js +2 -2
  31. package/src/print/MemberExpression.js +2 -2
  32. package/src/print/MountStatement.js +2 -2
  33. package/src/print/NamedArgumentExpression.js +2 -2
  34. package/src/print/ObjectExpression.js +2 -2
  35. package/src/print/ObjectProperty.js +2 -2
  36. package/src/print/SequenceExpression.js +2 -2
  37. package/src/print/SetStatement.js +2 -2
  38. package/src/print/SliceExpression.js +2 -2
  39. package/src/print/SpacelessBlock.js +2 -2
  40. package/src/print/StringLiteral.js +2 -2
  41. package/src/print/SwitchTag.js +2 -2
  42. package/src/print/TestExpression.js +2 -2
  43. package/src/print/TextStatement.js +2 -2
  44. package/src/print/TwigComment.js +2 -2
  45. package/src/print/UnaryExpression.js +2 -2
  46. package/src/print/UnarySubclass.js +2 -2
  47. package/src/print/UseStatement.js +2 -2
  48. package/src/print/VariableDeclarationStatement.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackad/prettier-plugin-twig",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Prettier Plugin for Twig",
5
5
  "repository": {
6
6
  "type": "git",
@@ -578,6 +578,9 @@ export default class Lexer {
578
578
  if (c === "\\" && input.la(1) === start) {
579
579
  input.next();
580
580
  input.next();
581
+ } else if (c === "{" && input.la(1) === "{") {
582
+ // interpolation start
583
+ break;
581
584
  } else if (c === start) {
582
585
  break;
583
586
  } else {
@@ -1,5 +1,5 @@
1
- const p = (node, path, print) => {
1
+ const printAliasExpression = (node, path, print) => {
2
2
  return [path.call(print, "name"), " as ", path.call(print, "alias")];
3
3
  };
4
4
 
5
- export { p as printAliasExpression };
5
+ export { printAliasExpression };
@@ -3,7 +3,7 @@ import { STRING_NEEDS_QUOTES } from "../util/index.js";
3
3
 
4
4
  const { group, softline, line, indent, join } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printArrayExpression = (node, path, print) => {
7
7
  node[STRING_NEEDS_QUOTES] = true;
8
8
  const mappedElements = path.map(print, "elements");
9
9
  const indentedContent = [softline, join([",", line], mappedElements)];
@@ -11,4 +11,4 @@ const p = (node, path, print) => {
11
11
  return group(["[", indent(indentedContent), softline, "]"]);
12
12
  };
13
13
 
14
- export { p as printArrayExpression };
14
+ export { printArrayExpression };
@@ -1,7 +1,7 @@
1
1
  import { doc } from "prettier";
2
2
  const { group, indent, join, line, softline } = doc.builders;
3
3
 
4
- const p = (node, path, print) => {
4
+ const printArrowFunction = (node, path, print) => {
5
5
  const args = node.args;
6
6
  const body = path.call(print, "body");
7
7
 
@@ -34,4 +34,4 @@ const p = (node, path, print) => {
34
34
  return group(parts);
35
35
  };
36
36
 
37
- export { p as printArrowFunction };
37
+ export { printArrowFunction };
@@ -19,7 +19,7 @@ const printConcatenatedString = (valueNode, path, print, ...initialPath) => {
19
19
  return printedFragments;
20
20
  };
21
21
 
22
- const p = (node, path, print = print) => {
22
+ const printAttribute = (node, path, print = print) => {
23
23
  node[EXPRESSION_NEEDED] = false;
24
24
  const docs = [path.call(print, "name")];
25
25
  node[EXPRESSION_NEEDED] = true;
@@ -47,4 +47,4 @@ const p = (node, path, print = print) => {
47
47
  return docs;
48
48
  };
49
49
 
50
- export { p as printAttribute };
50
+ export { printAttribute };
@@ -25,7 +25,7 @@ const createOpener = (node, options) => {
25
25
  ];
26
26
  };
27
27
 
28
- const p = (node, path, print, options) => {
28
+ const printAutoescapeBlock = (node, path, print, options) => {
29
29
  const parts = [createOpener(node, options)];
30
30
  parts.push(printChildBlock(node, path, print, "expressions"));
31
31
  parts.push(
@@ -38,4 +38,4 @@ const p = (node, path, print, options) => {
38
38
  return parts;
39
39
  };
40
40
 
41
- export { p as printAutoescapeBlock };
41
+ export { printAutoescapeBlock };
@@ -65,7 +65,7 @@ const otherNeedsParentheses = (node, otherProp) => {
65
65
  );
66
66
  };
67
67
 
68
- const printBinaryExpression = (node, path, print) => {
68
+ const internalPrintBinaryExpression = (node, path, print) => {
69
69
  node[EXPRESSION_NEEDED] = false;
70
70
  node[STRING_NEEDS_QUOTES] = true;
71
71
 
@@ -145,11 +145,11 @@ const printBinaryExpression = (node, path, print) => {
145
145
  return shouldGroupResult ? group(result) : result;
146
146
  };
147
147
 
148
- const p = (node, path, print, options) => {
148
+ const printBinaryExpression = (node, path, print, options) => {
149
149
  if (Node.isBinaryConcatExpression(node) && node.wasImplicitConcatenation) {
150
150
  return printInterpolatedString(node, path, print, options);
151
151
  }
152
- return printBinaryExpression(node, path, print);
152
+ return internalPrintBinaryExpression(node, path, print);
153
153
  };
154
154
 
155
- export { p as printBinaryExpression };
155
+ export { printBinaryExpression };
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  const { hardline, group } = doc.builders;
10
10
 
11
- const p = (node, path, print, options) => {
11
+ const printBlockStatement = (node, path, print, options) => {
12
12
  node[EXPRESSION_NEEDED] = false;
13
13
  const hasChildren = Array.isArray(node.body);
14
14
  const printEndblockName = options.twigOutputEndblockName === true;
@@ -55,4 +55,4 @@ const p = (node, path, print, options) => {
55
55
  }
56
56
  };
57
57
 
58
- export { p as printBlockStatement };
58
+ export { printBlockStatement };
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  const { group, softline, line, indent, join } = doc.builders;
10
10
 
11
- const p = (node, path, print) => {
11
+ const printCallExpression = (node, path, print) => {
12
12
  node[EXPRESSION_NEEDED] = false;
13
13
  node[STRING_NEEDS_QUOTES] = true;
14
14
  const mappedArguments = path.map(print, "arguments");
@@ -35,4 +35,4 @@ const p = (node, path, print) => {
35
35
  return group(parts);
36
36
  };
37
37
 
38
- export { p as printCallExpression };
38
+ export { printCallExpression };
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
  const { line, indent, group } = doc.builders;
9
9
 
10
- const p = (node, path, print) => {
10
+ const printConditionalExpression = (node, path, print) => {
11
11
  node[EXPRESSION_NEEDED] = false;
12
12
  node[STRING_NEEDS_QUOTES] = true;
13
13
 
@@ -24,4 +24,4 @@ const p = (node, path, print) => {
24
24
  return group(parts);
25
25
  };
26
26
 
27
- export { p as printConditionalExpression };
27
+ export { printConditionalExpression };
@@ -3,7 +3,7 @@ import { STRING_NEEDS_QUOTES, OVERRIDE_QUOTE_CHAR } from "../util/index.js";
3
3
 
4
4
  const { fill, join } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printDeclaration = (node, path, print) => {
7
7
  node[STRING_NEEDS_QUOTES] = true;
8
8
  node[OVERRIDE_QUOTE_CHAR] = '"';
9
9
  const start = "<!" + (node.declarationType || "").toUpperCase();
@@ -12,4 +12,4 @@ const p = (node, path, print) => {
12
12
  return fill([start, " ", join(" ", printedParts), ">"]);
13
13
  };
14
14
 
15
- export { p as printDeclaration };
15
+ export { printDeclaration };
@@ -1,4 +1,4 @@
1
- const p = (node, path, print) => {
1
+ const printDoStatement = (node, path, print) => {
2
2
  return [
3
3
  node.trimLeft ? "{%-" : "{%",
4
4
  " do ",
@@ -7,4 +7,4 @@ const p = (node, path, print) => {
7
7
  ];
8
8
  };
9
9
 
10
- export { p as printDoStatement };
10
+ export { printDoStatement };
@@ -46,7 +46,7 @@ const printSeparatedList = (path, print, separator, attrName) => {
46
46
  return join([separator, line], path.map(print, attrName));
47
47
  };
48
48
 
49
- const p = (node, path, print, options) => {
49
+ const printElement = (node, path, print, options) => {
50
50
  // Set a flag in case attributes contain, e.g., a FilterExpression
51
51
  node[EXPRESSION_NEEDED] = true;
52
52
  const openingGroup = group(printOpeningTag(node, path, print, options));
@@ -83,4 +83,4 @@ const p = (node, path, print, options) => {
83
83
  return group(result, { id: groupElement });
84
84
  };
85
85
 
86
- export { p as printElement };
86
+ export { printElement };
@@ -22,7 +22,7 @@ const printOpener = (node, path, print) => {
22
22
  return group(parts);
23
23
  };
24
24
 
25
- const p = (node, path, print) => {
25
+ const printEmbedStatement = (node, path, print) => {
26
26
  const children = printChildBlock(node, path, print, "blocks");
27
27
  const printedOpener = printOpener(node, path, print);
28
28
  const closing = [
@@ -35,4 +35,4 @@ const p = (node, path, print) => {
35
35
  return [printedOpener, children, closing];
36
36
  };
37
37
 
38
- export { p as printEmbedStatement };
38
+ export { printEmbedStatement };
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  const { group, indent, line } = doc.builders;
10
10
 
11
- const p = (node, path, print) => {
11
+ const printExpressionStatement = (node, path, print) => {
12
12
  node[EXPRESSION_NEEDED] = false;
13
13
  node[STRING_NEEDS_QUOTES] = true;
14
14
  const opener = node.trimLeft ? "{{-" : "{{";
@@ -22,4 +22,4 @@ const p = (node, path, print) => {
22
22
  return group([opener, value, padding, closing]);
23
23
  };
24
24
 
25
- export { p as printExpressionStatement };
25
+ export { printExpressionStatement };
@@ -1,6 +1,6 @@
1
1
  import { STRING_NEEDS_QUOTES } from "../util/index.js";
2
2
 
3
- const p = (node, path, print) => {
3
+ const printExtendsStatement = (node, path, print) => {
4
4
  node[STRING_NEEDS_QUOTES] = true;
5
5
  return [
6
6
  node.trimLeft ? "{%-" : "{%",
@@ -10,4 +10,4 @@ const p = (node, path, print) => {
10
10
  ];
11
11
  };
12
12
 
13
- export { p as printExtendsStatement };
13
+ export { printExtendsStatement };
@@ -10,7 +10,7 @@ const printOpeningGroup = (node, path, print) => {
10
10
  return group(parts);
11
11
  };
12
12
 
13
- const p = (node, path, print) => {
13
+ const printFilterBlockStatement = (node, path, print) => {
14
14
  node[FILTER_BLOCK] = true;
15
15
  const openingGroup = printOpeningGroup(node, path, print);
16
16
  const body = printChildBlock(node, path, print, "body");
@@ -24,4 +24,4 @@ const p = (node, path, print) => {
24
24
  return [openingGroup, body, closingStatement];
25
25
  };
26
26
 
27
- export { p as printFilterBlockStatement };
27
+ export { printFilterBlockStatement };
@@ -53,7 +53,7 @@ const joinFilters = (filterExpressions, space = "") => {
53
53
  );
54
54
  };
55
55
 
56
- const p = (node, path, print, options) => {
56
+ const printFilterExpression = (node, path, print, options) => {
57
57
  let currentNode = node;
58
58
  node[EXPRESSION_NEEDED] = false;
59
59
  node[STRING_NEEDS_QUOTES] = true;
@@ -128,4 +128,4 @@ const p = (node, path, print, options) => {
128
128
  return group(parts);
129
129
  };
130
130
 
131
- export { p as printFilterExpression };
131
+ export { printFilterExpression };
@@ -1,7 +1,7 @@
1
- const p = (node, path, print) => {
1
+ const printFlushStatement = (node, path, print) => {
2
2
  const dashLeft = node.trimLeft ? "-" : "";
3
3
  const dashRight = node.trimRight ? "-" : "";
4
4
  return `{%${dashLeft} flush ${dashRight}%}`;
5
5
  };
6
6
 
7
- export { p as printFlushStatement };
7
+ export { printFlushStatement };
@@ -24,7 +24,7 @@ const printFor = (node, path, print) => {
24
24
  return group(parts);
25
25
  };
26
26
 
27
- const p = (node, path, print) => {
27
+ const printForStatement = (node, path, print) => {
28
28
  node[EXPRESSION_NEEDED] = false;
29
29
  const parts = [printFor(node, path, print)];
30
30
  const isBodyEmpty =
@@ -55,4 +55,4 @@ const p = (node, path, print) => {
55
55
  return parts;
56
56
  };
57
57
 
58
- export { p as printForStatement };
58
+ export { printForStatement };
@@ -11,7 +11,7 @@ const printImportDeclaration = node => {
11
11
  return parts;
12
12
  };
13
13
 
14
- const p = (node, path, print) => {
14
+ const printFromStatement = (node, path, print) => {
15
15
  node[STRING_NEEDS_QUOTES] = true;
16
16
  // Unfortunately, ImportDeclaration has different
17
17
  // formatting needs here compared to when used
@@ -29,4 +29,4 @@ const p = (node, path, print) => {
29
29
  ]);
30
30
  };
31
31
 
32
- export { p as printFromStatement };
32
+ export { printFromStatement };
@@ -1,5 +1,5 @@
1
- const p = (node, path, print) => {
1
+ const printGenericToken = (node, path, print) => {
2
2
  return node.tokenText;
3
3
  };
4
4
 
5
- export { p as printGenericToken };
5
+ export { printGenericToken };
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  const { hardline } = doc.builders;
11
11
 
12
- const p = (node, path, print) => {
12
+ const printGenericTwigTag = (node, path, print) => {
13
13
  node[STRING_NEEDS_QUOTES] = true;
14
14
  const openingTag = printSingleTwigTag(node, path, print);
15
15
  const parts = [openingTag];
@@ -27,4 +27,4 @@ const p = (node, path, print) => {
27
27
  return parts;
28
28
  };
29
29
 
30
- export { p as printGenericTwigTag };
30
+ export { printGenericTwigTag };
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  const { join, indent, hardline } = doc.builders;
10
10
 
11
- const p = (node, path, print) => {
11
+ const printHtmlComment = (node, path, print) => {
12
12
  const commentText = stripHtmlCommentChars(node.value.value || "");
13
13
 
14
14
  const numNewlines = countNewlines(commentText);
@@ -19,4 +19,4 @@ const p = (node, path, print) => {
19
19
  return ["<!-- ", commentText, " -->"];
20
20
  };
21
21
 
22
- export { p as printHtmlComment };
22
+ export { printHtmlComment };
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
  const { group } = doc.builders;
9
9
 
10
- const p = (node, path, print) => {
10
+ const printIdentifier = (node, path, print) => {
11
11
  node[EXPRESSION_NEEDED] = false;
12
12
  node[STRING_NEEDS_QUOTES] = true;
13
13
 
@@ -21,4 +21,4 @@ const p = (node, path, print) => {
21
21
  return parts.length === 1 ? result : group(result);
22
22
  };
23
23
 
24
- export { p as printIdentifier };
24
+ export { printIdentifier };
@@ -12,7 +12,7 @@ const { group, indent, line, hardline } = doc.builders;
12
12
 
13
13
  const IS_ELSEIF = Symbol("IS_ELSEIF");
14
14
 
15
- const p = (node, path, print) => {
15
+ const printIfStatement = (node, path, print) => {
16
16
  node[EXPRESSION_NEEDED] = false;
17
17
  const hasElseBranch =
18
18
  Array.isArray(node.alternate) && node.alternate.length > 0;
@@ -78,4 +78,4 @@ const p = (node, path, print) => {
78
78
  return parts;
79
79
  };
80
80
 
81
- export { p as printIfStatement };
81
+ export { printIfStatement };
@@ -3,7 +3,7 @@ import { STRING_NEEDS_QUOTES } from "../util/index.js";
3
3
 
4
4
  const { group, line, indent } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printImportDeclaration = (node, path, print) => {
7
7
  node[STRING_NEEDS_QUOTES] = true;
8
8
  return group([
9
9
  node.trimLeft ? "{%-" : "{%",
@@ -15,4 +15,4 @@ const p = (node, path, print) => {
15
15
  ]);
16
16
  };
17
17
 
18
- export { p as printImportDeclaration };
18
+ export { printImportDeclaration };
@@ -3,7 +3,7 @@ import { STRING_NEEDS_QUOTES } from "../util/index.js";
3
3
 
4
4
  const { group } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printIncludeStatement = (node, path, print) => {
7
7
  node[STRING_NEEDS_QUOTES] = true;
8
8
  const parts = [
9
9
  node.trimLeft ? "{%-" : "{%",
@@ -23,4 +23,4 @@ const p = (node, path, print) => {
23
23
  return group(parts);
24
24
  };
25
25
 
26
- export { p as printIncludeStatement };
26
+ export { printIncludeStatement };
@@ -16,7 +16,7 @@ const printOpener = (node, path, print) => {
16
16
  return group(parts);
17
17
  };
18
18
 
19
- const p = (node, path, print) => {
19
+ const printMacroDeclarationStatement = (node, path, print) => {
20
20
  const parts = [printOpener(node, path, print)];
21
21
  parts.push(indent([hardline, path.call(print, "body")]));
22
22
  parts.push(
@@ -28,4 +28,4 @@ const p = (node, path, print) => {
28
28
  return parts;
29
29
  };
30
30
 
31
- export { p as printMacroDeclarationStatement };
31
+ export { printMacroDeclarationStatement };
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
  const { group } = doc.builders;
9
9
 
10
- const p = (node, path, print) => {
10
+ const printMemberExpression = (node, path, print) => {
11
11
  node[EXPRESSION_NEEDED] = false;
12
12
  node[STRING_NEEDS_QUOTES] = true;
13
13
  const parts = [path.call(print, "object")];
@@ -20,4 +20,4 @@ const p = (node, path, print) => {
20
20
  return group(parts);
21
21
  };
22
22
 
23
- export { p as printMemberExpression };
23
+ export { printMemberExpression };
@@ -59,7 +59,7 @@ const buildErrorHandling = (node, path, print) => {
59
59
  return parts;
60
60
  };
61
61
 
62
- const p = (node, path, print) => {
62
+ const printMountStatement = (node, path, print) => {
63
63
  node[EXPRESSION_NEEDED] = false;
64
64
  node[STRING_NEEDS_QUOTES] = true;
65
65
  const parts = [buildOpener(node, path, print)];
@@ -81,4 +81,4 @@ const p = (node, path, print) => {
81
81
  return parts;
82
82
  };
83
83
 
84
- export { p as printMountStatement };
84
+ export { printMountStatement };
@@ -1,6 +1,6 @@
1
1
  import { STRING_NEEDS_QUOTES } from "../util/index.js";
2
2
 
3
- const p = (node, path, print, options) => {
3
+ const printNamedArgumentExpression = (node, path, print, options) => {
4
4
  node[STRING_NEEDS_QUOTES] = true;
5
5
  const printedName = path.call(print, "name");
6
6
  const printedValue = path.call(print, "value");
@@ -8,4 +8,4 @@ const p = (node, path, print, options) => {
8
8
  return [printedName, separator, printedValue];
9
9
  };
10
10
 
11
- export { p as printNamedArgumentExpression };
11
+ export { printNamedArgumentExpression };
@@ -3,7 +3,7 @@ import { EXPRESSION_NEEDED, wrapExpressionIfNeeded } from "../util/index.js";
3
3
 
4
4
  const { group, line, hardline, indent, join } = doc.builders;
5
5
 
6
- const p = (node, path, print, options) => {
6
+ const printObjectExpression = (node, path, print, options) => {
7
7
  if (node.properties.length === 0) {
8
8
  return "{}";
9
9
  }
@@ -18,4 +18,4 @@ const p = (node, path, print, options) => {
18
18
  return group(parts);
19
19
  };
20
20
 
21
- export { p as printObjectExpression };
21
+ export { printObjectExpression };
@@ -1,7 +1,7 @@
1
1
  import { Node } from "../melody/melody-types/index.js";
2
2
  import { isValidIdentifierName, STRING_NEEDS_QUOTES } from "../util/index.js";
3
3
 
4
- const p = (node, path, print, options) => {
4
+ const printObjectProperty = (node, path, print, options) => {
5
5
  node[STRING_NEEDS_QUOTES] =
6
6
  !node.computed &&
7
7
  Node.isStringLiteral(node.key) &&
@@ -28,4 +28,4 @@ const p = (node, path, print, options) => {
28
28
  return parts;
29
29
  };
30
30
 
31
- export { p as printObjectProperty };
31
+ export { printObjectProperty };
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  const { hardline } = doc.builders;
10
10
 
11
- const p = (node, path, print) => {
11
+ const printSequenceExpression = (node, path, print) => {
12
12
  node[STRING_NEEDS_QUOTES] = false;
13
13
  node.expressions = removeSurroundingWhitespace(node.expressions);
14
14
  const items = printChildGroups(node, path, print, "expressions");
@@ -18,4 +18,4 @@ const p = (node, path, print) => {
18
18
  return items;
19
19
  };
20
20
 
21
- export { p as printSequenceExpression };
21
+ export { printSequenceExpression };
@@ -80,7 +80,7 @@ const printEmbracingSet = (node, path, print) => {
80
80
  return parts;
81
81
  };
82
82
 
83
- const p = (node, path, print) => {
83
+ const printSetStatement = (node, path, print) => {
84
84
  node[STRING_NEEDS_QUOTES] = true;
85
85
  if (isEmbracingSet(node)) {
86
86
  return printEmbracingSet(node, path, print);
@@ -88,4 +88,4 @@ const p = (node, path, print) => {
88
88
  return printRegularSet(node, path, print);
89
89
  };
90
90
 
91
- export { p as printSetStatement };
91
+ export { printSetStatement };
@@ -1,8 +1,8 @@
1
- const p = (node, path, print) => {
1
+ const printSliceExpression = (node, path, print) => {
2
2
  const printedTarget = path.call(print, "target");
3
3
  const printedStart = node.start ? path.call(print, "start") : "";
4
4
  const printedEnd = node.end ? path.call(print, "end") : "";
5
5
  return [printedTarget, "[", printedStart, ":", printedEnd, "]"];
6
6
  };
7
7
 
8
- export { p as printSliceExpression };
8
+ export { printSliceExpression };
@@ -3,7 +3,7 @@ import { printChildBlock } from "../util/index.js";
3
3
 
4
4
  const { hardline, group } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printSpacelessBlock = (node, path, print) => {
7
7
  const parts = [
8
8
  node.trimLeft ? "{%-" : "{%",
9
9
  " spaceless ",
@@ -20,4 +20,4 @@ const p = (node, path, print) => {
20
20
  return result;
21
21
  };
22
22
 
23
- export { p as printSpacelessBlock };
23
+ export { printSpacelessBlock };
@@ -33,7 +33,7 @@ const getQuoteChar = (s, options) => {
33
33
  return quoteChar(options);
34
34
  };
35
35
 
36
- const p = (node, path, print, options) => {
36
+ const printStringLiteral = (node, path, print, options) => {
37
37
  // The structure this string literal is part of
38
38
  // determines if we need quotes or not
39
39
  const needsQuotes = firstValueInAncestorChain(
@@ -60,4 +60,4 @@ const p = (node, path, print, options) => {
60
60
  return node.value;
61
61
  };
62
62
 
63
- export { p as printStringLiteral };
63
+ export { printStringLiteral };
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  const { indent, hardline } = doc.builders;
11
11
 
12
- const p = (node, path, print) => {
12
+ const printSwitchTag = (node, path, print) => {
13
13
  node[STRING_NEEDS_QUOTES] = true;
14
14
  const openingTag = printSingleTwigTag(node, path, print);
15
15
  const parts = [openingTag];
@@ -32,4 +32,4 @@ const p = (node, path, print) => {
32
32
  return parts;
33
33
  };
34
34
 
35
- export { p as printSwitchTag };
35
+ export { printSwitchTag };
@@ -18,7 +18,7 @@ const textMap = {
18
18
  const isNegator = node =>
19
19
  node.constructor.name === "UnarySubclass" && node.operator === "not";
20
20
 
21
- const p = (node, path, print) => {
21
+ const printTestExpression = (node, path, print) => {
22
22
  node[STRING_NEEDS_QUOTES] = true;
23
23
  const expressionType = node.__proto__.type;
24
24
  const parts = [path.call(print, "expression"), " is "];
@@ -46,4 +46,4 @@ const p = (node, path, print) => {
46
46
  return parts;
47
47
  };
48
48
 
49
- export { p as printTestExpression };
49
+ export { printTestExpression };
@@ -20,7 +20,7 @@ const newlinesOnly = (s, preserveWhitespace = true) => {
20
20
  return [hardline, hardline];
21
21
  };
22
22
 
23
- const p = (node, path, print) => {
23
+ const printTextStatement = (node, path, print) => {
24
24
  // Check for special values that might have been
25
25
  // computed during preprocessing
26
26
  const preserveLeadingWhitespace =
@@ -42,4 +42,4 @@ const p = (node, path, print) => {
42
42
  return join([hardline, hardline], textGroups);
43
43
  };
44
44
 
45
- export { p as printTextStatement };
45
+ export { printTextStatement };
@@ -5,7 +5,7 @@ import {
5
5
  countNewlines
6
6
  } from "../util/index.js";
7
7
 
8
- const p = node => {
8
+ const printTwigComment = node => {
9
9
  const originalText = node.value.value || "";
10
10
  const commentText = stripTwigCommentChars(originalText);
11
11
  const trimLeft = originalText.length >= 3 ? originalText[2] === "-" : false;
@@ -20,4 +20,4 @@ const p = node => {
20
20
  return [trimLeft ? "{#-" : "{#", commentText, trimRight ? "-#}" : "#}"];
21
21
  };
22
22
 
23
- export { p as printTwigComment };
23
+ export { printTwigComment };
@@ -7,7 +7,7 @@ import {
7
7
 
8
8
  const { group } = doc.builders;
9
9
 
10
- const p = (node, path, print) => {
10
+ const printUnaryExpression = (node, path, print) => {
11
11
  node[EXPRESSION_NEEDED] = false;
12
12
  node[STRING_NEEDS_QUOTES] = true;
13
13
  const parts = [node.operator, path.call(print, "argument")];
@@ -15,4 +15,4 @@ const p = (node, path, print) => {
15
15
  return group(parts);
16
16
  };
17
17
 
18
- export { p as printUnaryExpression };
18
+ export { printUnaryExpression };
@@ -42,7 +42,7 @@ const printLogicalExpression = (node, path, print) => {
42
42
  return shouldCreateTopLevelGroup ? group(result) : result;
43
43
  };
44
44
 
45
- const p = (node, path, print) => {
45
+ const printUnarySubclass = (node, path, print) => {
46
46
  // We need this part to prevent argument being wrapped into expression separated from operator
47
47
  // Example:
48
48
  // with node[EXPRESSION_NEEDED] = true; // default value
@@ -71,4 +71,4 @@ const p = (node, path, print) => {
71
71
  return parts;
72
72
  };
73
73
 
74
- export { p as printUnarySubclass };
74
+ export { printUnarySubclass };
@@ -2,7 +2,7 @@ import { doc } from "prettier";
2
2
 
3
3
  const { group, indent, join, line } = doc.builders;
4
4
 
5
- const p = (node, path, print) => {
5
+ const printUseStatement = (node, path, print) => {
6
6
  const docs = [
7
7
  node.trimLeft ? "{%-" : "{%",
8
8
  ' use "',
@@ -22,4 +22,4 @@ const p = (node, path, print) => {
22
22
  return group(docs);
23
23
  };
24
24
 
25
- export { p as printUseStatement };
25
+ export { printUseStatement };
@@ -3,7 +3,7 @@ import { STRING_NEEDS_QUOTES, isContractableNodeType } from "../util/index.js";
3
3
 
4
4
  const { line, indent } = doc.builders;
5
5
 
6
- const p = (node, path, print) => {
6
+ const printVariableDeclarationStatement = (node, path, print) => {
7
7
  const printedName = path.call(print, "name");
8
8
  node[STRING_NEEDS_QUOTES] = true;
9
9
  const printedValue = path.call(print, "value");
@@ -18,4 +18,4 @@ const p = (node, path, print) => {
18
18
  return [printedName, " =", rightHandSide];
19
19
  };
20
20
 
21
- export { p as printVariableDeclarationStatement };
21
+ export { printVariableDeclarationStatement };