summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-01-14 10:58:53 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-01-14 10:58:53 +0100
commit9cf3a4835418d4de6470dbfa6bf51b4d8b262602 (patch)
tree9caf9c5dd9cb9da9628bfeaa8d14b63448dace1b
parent4f2dc0a06675f1ac076a4418704dd500f788505b (diff)
chore: Examples improvements of Nectar.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--include/CompilerKit/Detail/PreConfig.h4
-rw-r--r--include/GenericsLibrary/ostream.nhh9
-rw-r--r--src/CompilerKit/src/Compilers/NectarCompiler+AMD64.cc1
-rw-r--r--test/test_samples/test_ostream.ncpp5
-rw-r--r--test/test_samples/test_struct.ncpp23
5 files changed, 30 insertions, 12 deletions
diff --git a/include/CompilerKit/Detail/PreConfig.h b/include/CompilerKit/Detail/PreConfig.h
index 9162d96..5127a11 100644
--- a/include/CompilerKit/Detail/PreConfig.h
+++ b/include/CompilerKit/Detail/PreConfig.h
@@ -55,8 +55,6 @@
#define kDistRelease ToString(kDistReleaseBranch)
-#ifndef kDistRelease
-
#define kDistVersion "v0.1.3-compilerkit"
#define kDistVersionBCD 0x0103
@@ -65,8 +63,6 @@
#define kDistRelease ToString(kDistReleaseBranch)
-#endif // !kDistRelease
-
#define MUST_PASS(E) assert(E)
#ifndef __FORCE_STRLEN
diff --git a/include/GenericsLibrary/ostream.nhh b/include/GenericsLibrary/ostream.nhh
index 6561f80..665e3b8 100644
--- a/include/GenericsLibrary/ostream.nhh
+++ b/include/GenericsLibrary/ostream.nhh
@@ -10,6 +10,15 @@
impl ostream
{
+ ostream()
+ {
+ return;
+ }
+
+ ~ostream()
+ {
+ return;
+ }
let write(let data, let size)
{
diff --git a/src/CompilerKit/src/Compilers/NectarCompiler+AMD64.cc b/src/CompilerKit/src/Compilers/NectarCompiler+AMD64.cc
index 64403fe..0e21e58 100644
--- a/src/CompilerKit/src/Compilers/NectarCompiler+AMD64.cc
+++ b/src/CompilerKit/src/Compilers/NectarCompiler+AMD64.cc
@@ -26,7 +26,6 @@
#include <cstdlib>
#include <filesystem>
#include <ios>
-#include "CompilerKit/Detail/Config.h"
/* NeKernel NECTAR Compiler Driver. */
/* This is part of the CompilerKit. */
diff --git a/test/test_samples/test_ostream.ncpp b/test/test_samples/test_ostream.ncpp
index a89618b..afed25d 100644
--- a/test/test_samples/test_ostream.ncpp
+++ b/test/test_samples/test_ostream.ncpp
@@ -1,8 +1,9 @@
-#include <GenericsLibrary/iostream.nhh>
+#include <GenericsLibrary/ostream.nhh>
let main()
{
- let io := ostream{};
+ let io := {};
+ io := ostream();
let arr := io.read(0, 0);
return arr[0];
} \ No newline at end of file
diff --git a/test/test_samples/test_struct.ncpp b/test/test_samples/test_struct.ncpp
index 372171e..24fb79c 100644
--- a/test/test_samples/test_struct.ncpp
+++ b/test/test_samples/test_struct.ncpp
@@ -1,17 +1,30 @@
-impl ostream
+impl foo
{
- let print_fd_()
+ foo()
+ {
+ return;
+ }
+
+ let noop()
{
return 0;
}
};
-let main()
+let construct_foo()
{
let io := new;
- let first_number := io->print_fd_();
- first_number -= io.print_fd_();
+ io := foo();
+ return io;
+}
+
+let main()
+{
+ let io := new;
+ io := construct_foo();
+
+ let first_number := io->noop();
io := delete;
return first_number;