- Add kernel init bundle helper + verify:init-bundle; tighten release-checklist gates
- Implement cooperative F_GETLK/F_SETLK/F_SETLKW; optional BARE_OS_POSIX_SOCKET_FD_BRIDGE - Add ctx.bareOsGetconfSysconf; extend getconf for _SC_*; awk delete stmt; POSIX heredoc cap - disk.os: replication_snapshot + replication_operator_sketch; blind-relay swarm schema 2 - Protomux operatorMetrics.backpressureEmitCount; warm-cache invalidate on boot/init puts - Bump POSIX profile 1.0.6 and syscalls.json schema 6; sync schemas, handbook, env appendix - Tests + seeder/kernel parity (rsync after coreutils/bare-libs builds)
This commit is contained in:
+19
-2
@@ -90,7 +90,7 @@ function bareOsEmitRaw(ctx, chunk) {
|
||||
/**
|
||||
* POSIX-oriented awk interpreter for Bare OS (no import; concatenated before src/awk.js).
|
||||
* Supports: BEGIN/END, /re/, line patterns, {}, print/printf, if/else, while, for(;;), for(x in a),
|
||||
* next, exit, break, continue, ++/--, arrays, strings, regex ~ !~, builtins (length, substr, index,
|
||||
* delete arr[idx], next, exit, break, continue, ++/--, arrays, strings, regex ~ !~, builtins (length, substr, index,
|
||||
* split, sprintf, sub, gsub, match, int, tolower, toupper, rand, srand), getline from stdin/files,
|
||||
* optional fixed-width fields via FIELDWIDTHS when BARE_OS_AWK_FIELDWIDTHS is enabled,
|
||||
* -F FS, NF, NR, FNR, $0..$n, OFS, ORS, RS, ARGC, ARGV, FILENAME, ENVIRON (read-only mirror).
|
||||
@@ -246,7 +246,8 @@ function bareAwkLex(src, st) {
|
||||
id === 'printf' ||
|
||||
id === 'return' ||
|
||||
id === 'function' ||
|
||||
id === 'getline'
|
||||
id === 'getline' ||
|
||||
id === 'delete'
|
||||
) {
|
||||
return { kind: 'KW', value: id, line }
|
||||
}
|
||||
@@ -462,6 +463,15 @@ class BareAwkParser {
|
||||
this.optSemi()
|
||||
return { t: t.value }
|
||||
}
|
||||
if (t.kind === 'KW' && t.value === 'delete') {
|
||||
this.p++
|
||||
const arrTok = this.eat('ID')
|
||||
this.eat('OP', '[')
|
||||
const key = this.parseExpr()
|
||||
this.eat('OP', ']')
|
||||
this.optSemi()
|
||||
return { t: 'delete', arr: arrTok.value, key }
|
||||
}
|
||||
if (t.kind === 'KW' && t.value === 'exit') {
|
||||
this.p++
|
||||
let code = null
|
||||
@@ -1278,6 +1288,13 @@ class BareAwkRuntime {
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'delete': {
|
||||
const tbl =
|
||||
this.arrays[st.arr] || (this.arrays[st.arr] = Object.create(null))
|
||||
const ky = String(this.evalExpr(st.key))
|
||||
delete tbl[ky]
|
||||
break
|
||||
}
|
||||
case 'next':
|
||||
return { t: 'next' }
|
||||
case 'break':
|
||||
|
||||
Reference in New Issue
Block a user