aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/c-interoperability.md8
1 files changed, 3 insertions, 5 deletions
diff --git a/docs/c-interoperability.md b/docs/c-interoperability.md
index 3c5bbff1..3c0906ee 100644
--- a/docs/c-interoperability.md
+++ b/docs/c-interoperability.md
@@ -16,21 +16,19 @@ from inside a Tomo source file.
## Inline C Code
-As a final escape hatch, you can use `inline C` to add code that will be put,
+As a final escape hatch, you can use `C_code` to add code that will be put,
verbatim in the transpiled C code generated by Tomo. There are two forms: one
that creates an expression value and one that creates a block that is executed
without evaluating to anything:
```tomo
# Inline C block:
-inline C {
+C_code {
printf("This is just a block that is executed without a return value\n");
}
# Inline C expression (you must specify a type)
-val := inline C : Int32 {
- int x = 1; x + 1
-}
+val := C_code : Int32 (int x = 1; x + 1)
```
Inline C expressions must specify a type and they can be [compound statement