papagaio 0.38.2 → 0.39.2

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.
package/README.md CHANGED
@@ -178,6 +178,14 @@ The **`$from`** operator allows you to capture processed content and assign it t
178
178
  2. **Immediate Registration**: The variable is registered as an exact-match rule as soon as it is parsed. This allows for **chained assignments**.
179
179
  3. **Output Suppression**: The entire `$from` directive is removed from the output text.
180
180
 
181
+ ### Lexical Scopes and Sandboxing
182
+
183
+ Every block operator or preprocessing field evaluated dynamically (such as inside `$from`, `$then`, `$else`, `$while`, `$repeat`, and `$until`) is executed in its own **local nested scope**.
184
+
185
+ - **Sandboxing**: Any variable declared inside a local scope (e.g. `$B$from{local_val}` inside `$A$from{...}`) that does *not* exist in a parent scope is treated as a local variable. It will be completely destroyed and freed when the block finishes evaluating (sandboxed).
186
+ - **Shadowing & Upward Updates**: If a variable updated inside a local scope already exists in a parent/ancestor scope, Papagaio avoids shadowing it. Instead, it propagates the update upwards, modifying the existing variable in the parent scope.
187
+ - **Recursive Nesting**: Local scopes can be nested arbitrarily. Each child scope has full read/write access to variables in parent scopes, but parent or sibling scopes do not have access to variables declared exclusively in child scopes.
188
+
181
189
  ### Examples
182
190
 
183
191
  #### Chained Assignments
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "papagaio",
3
- "version": "0.38.2",
3
+ "version": "0.39.2",
4
4
  "description": "easy yet powerful preprocessor",
5
5
  "main": "dist/wasm/papagaio.js",
6
6
  "bin": {
@@ -26,7 +26,6 @@
26
26
  "eval",
27
27
  "parser",
28
28
  "codegen",
29
- "regex",
30
29
  "syntax",
31
30
  "easy"
32
31
  ],