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:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "pexpect" for Spawn, Pexpect
|
||||
|
||||
var child = Spawn.new("echo test")
|
||||
System.print(child.pid > 0) // expect: true
|
||||
System.print(child.timeout) // expect: 30
|
||||
child.timeout = 5
|
||||
System.print(child.timeout) // expect: 5
|
||||
System.print(child.maxread) // expect: 2000
|
||||
System.print(child.searchwindowsize) // expect: 0
|
||||
|
||||
child.expect(["test"])
|
||||
child.wait()
|
||||
System.print(child.exitstatus == 0) // expect: true
|
||||
child.close()
|
||||
Reference in New Issue
Block a user