Summary
Grayscale supports C interop (STANDARD.md §8.6) — importing C headers and calling C functions. The LSP has no awareness of this feature.
Example
import c"stdio.h"
import c"stdlib.h", c"string.h"
do main() {
c.puts("hello from C")
c.printf("value: %d\n", 42)
mut home string = c_string(c.getenv("HOME"))
}
Key Details
import c"header.h" — system header (angle-bracket include)
import c"./mylib.h" — local header (quoted include)
- All C functions accessed via
c. prefix
- Module name
c is reserved for C interop
Scope
- Recognize
import c"..." syntax (no false diagnostics)
- Recognize
c. prefix as valid module access
- Add hover docs explaining C interop basics
Summary
Grayscale supports C interop (STANDARD.md §8.6) — importing C headers and calling C functions. The LSP has no awareness of this feature.
Example
Key Details
import c"header.h"— system header (angle-bracket include)import c"./mylib.h"— local header (quoted include)c.prefixcis reserved for C interopScope
import c"..."syntax (no false diagnostics)c.prefix as valid module access