diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-29 22:27:52 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-29 22:41:01 +0100 |
| commit | 0be550520fdd9da1cc996f6d71ab2790a1b2fcb8 (patch) | |
| tree | 4c6435d61ea12a548257673f74ef77694aab3452 /test | |
| parent | 690fa2807e10f10edd20ce971b900457d7504ff3 (diff) | |
feat: if statement and custom comparaison syntax for nectar.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_samples/test_printf.nc | 8 | ||||
| -rw-r--r-- | test/test_samples/test_struct.nc | 21 |
2 files changed, 10 insertions, 19 deletions
diff --git a/test/test_samples/test_printf.nc b/test/test_samples/test_printf.nc index d18c818..c29bb05 100644 --- a/test/test_samples/test_printf.nc +++ b/test/test_samples/test_printf.nc @@ -1,9 +1,11 @@ +export main; + let main() { - if (0x01 <= 0x100) + if (0x01 =: 0x01): { - return 0x80; + return 0; } - return 0x0; + return 1; }
\ No newline at end of file diff --git a/test/test_samples/test_struct.nc b/test/test_samples/test_struct.nc index c725b64..71a9492 100644 --- a/test/test_samples/test_struct.nc +++ b/test/test_samples/test_struct.nc @@ -1,20 +1,10 @@ -impl foo -{ - let init() - { - return; - } - - let noop() - { - return 0x0; - } -}; +extern exit; +extern malloc; let construct_foo() { - let io := new; - io := foo{}; + let io := 0; + io := malloc(4); return io; } @@ -24,8 +14,7 @@ let main() let io := 0x0; io := construct_foo(); - let first_number := io->noop(); - let status := delete(io); + _ := exit(io); return first_number; }
\ No newline at end of file |
