Browse Source

fix: Minor pretty printer changes and addition to the documentation

Matthias Ladkau 3 years ago
parent
commit
cbaba21419
2 changed files with 3 additions and 2 deletions
  1. 2 2
      ecal.md
  2. 1 0
      parser/prettyprinter.go

+ 2 - 2
ecal.md

@@ -423,7 +423,7 @@ len([1,2,3])
 ```
 
 #### `del(listormap, indexorkey) : listormap`
-Del removes an item from a list or map.
+Del removes an item from a list or map. Only the returned value should be used further.
 
 Parameter | Description
 -|-
@@ -437,7 +437,7 @@ del([1,2,3], 1)
 
 
 #### `add(list, value, [index]) : list`
-Add adds an item to a list. The item is added at the optionally given index or at the end if no index is specified.
+Add adds an item to a list. The item is added at the optionally given index or at the end if no index is specified. Only the returned value should be used further.
 
 Parameter | Description
 -|-

+ 1 - 0
parser/prettyprinter.go

@@ -266,6 +266,7 @@ func ppPostProcessing(ast *ASTNode, path []*ASTNode, ppString string) string {
 			// Add initial indent only if we are inside a block statement
 
 			if stringutil.IndexOf(parent.Name, []string{
+				NodeRETURN,
 				NodeIN,
 				NodeASSIGN,
 				NodePRESET,