diff options
| author | Mel <einebeere@gmail.com> | 2022-08-11 01:25:47 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-08-11 01:25:47 +0000 |
| commit | 86f31acf6789be116dcc54ed85b069a37c0f7aa8 (patch) | |
| tree | bc7afd6a8c340825996d29c6cfd392ae42b4fbd5 /pkg/lang/modules/core/core.lang | |
| parent | c46b2bc7ce6df1f2c6c9494ef08015ec29992da5 (diff) | |
| download | jinx-86f31acf6789be116dcc54ed85b069a37c0f7aa8.tar.zst jinx-86f31acf6789be116dcc54ed85b069a37c0f7aa8.zip | |
Actual modules and core
Diffstat (limited to 'pkg/lang/modules/core/core.lang')
| -rw-r--r-- | pkg/lang/modules/core/core.lang | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/pkg/lang/modules/core/core.lang b/pkg/lang/modules/core/core.lang new file mode 100644 index 0000000..e6be2d5 --- /dev/null +++ b/pkg/lang/modules/core/core.lang @@ -0,0 +1,78 @@ +type Type { +} + +native(":core:setup_type", Type) +global Type + +type Null { + () { + native(":core:Null:$init") + } +} + +type Int { + () { + native(":core:Int:$init") + } +} + +type Float { + () { + native(":core:Float:$init") + } +} + +type String { + () { + native(":core:String:$init") + } +} + +type Bool { + () { + native(":core:Bool:$init") + } +} + +type Array { + () { + native(":core:Array:$init") + } + + fn push(this, element) { + native(":core:Array:push", this, element) + } + + fn pop(this) { + return native(":core:Array:pop", this) + } + + fn length(this) { + return native(":core:Array:length", this) + } +} + +type Function { + () { + native(":core:Function:$init") + } +} + +fn say(message) { + native(":core:say", message) +} + +fn ping() { + return "Pong!" +} + +global Null +global Int +global Float +global String +global Bool +global Array +global Function + +global say +global ping \ No newline at end of file |
