ReviewOS

home-lang/home

Parser: support `asm` block syntax (10 kernel files blocked)

#44
Closed glennmichael123 opened this 24 days ago · 0 comments
24 days ago

Context

The 2026-05-07-evening audit shows `Expected '(' after 'asm'` is now the #1 PARSE_FAIL pattern at 10 files. After the recent parser-cluster work (#42 :: support, etc.), the next downstream blocker for the arm64/rpi/power kernel cluster is inline-asm parsing.

Affected files (10)

All under kernel/src/ in home-os:

  • arch/arm64/rpi/boot.home
  • arch/arm64/rpi/devicetree.home
  • arch/arm64/rpi/emmc.home
  • arch/arm64/rpi/gic400.home
  • arch/arm64/rpi/gpio.home
  • arch/arm64/rpi/uart.home
  • power/battery.home
  • power/cpufreq_x86.home
  • power/thermal_x86.home
  • debug/bug_tracker.home

Reproduction

Need to inspect actual asm shapes in the affected files first. Likely candidates:

  • Zig-style: asm volatile ("..." : "..." (out) : "..." (in) : "memory")
  • Rust-style: asm!("...", in("reg") val, out("reg") result)
  • Bare string: asm "mov x0, x1"

The parser previously had @asm(...) support added in #40 (treated as opaque builtin). The asm-as-statement form in these files likely uses different syntax.

Approach

  1. Inspect 3-5 of the affected files to identify the actual asm shape used
  2. Decide: extend the parser to accept that shape, OR have the kernel codemod to a Home-supported form (e.g. wrap in @asm(...) builtin per #40)
  3. If parser fix: add asm-block grammar (probably as a statement, not an expression)
  4. If codemod: file as home-os codemod issue and close this one

Why this matters

10 modules unblocked. Predicted +2.5pp OK, pushing kernel past 80% threshold.

Reference

  • 2026-05-07-evening audit: `~/Desktop/home-os-kernel-audit-2026-05-07-evening.tsv`
  • Related: home #40 added @asm(...) builtin form

Sign in to comment on this issue.