feat: add pexpect and yaml modules with jinja from-import support

Add new pexpect module for process spawning and interaction, including Spawn class with expect, sendline, and timeout handling. Introduce yaml module for YAML parsing with support for nested structures, lists, and data types. Extend jinja template engine with brace tokenization and FromImportNode for macro imports across templates. Register all new foreign functions in modules.c and include generated demo scripts.
This commit is contained in:
2026-01-25 21:09:29 +00:00
parent 5c2269f6a7
commit 79ff93c9a2
27 changed files with 3435 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
// retoor <retoor@molodetz.nl>
import "yaml" for Yaml
var yaml = "items:\n - first\n - second\n - third"
var data = Yaml.parse(yaml)
System.print(data["items"][0]) // expect: first
System.print(data["items"][1]) // expect: second
System.print(data["items"][2]) // expect: third
System.print(data["items"].count) // expect: 3
var simple = "- one\n- two\n- three"
var list = Yaml.parse(simple)
System.print(list[0]) // expect: one
System.print(list[1]) // expect: two
System.print(list.count) // expect: 3
var numbers = "- 1\n- 2\n- 3"
var numList = Yaml.parse(numbers)
System.print(numList[0]) // expect: 1
System.print(numList[1]) // expect: 2