|
@@ -47,7 +47,7 @@ Compiler `dopp` for `doppelganger`
|
|
|
Language `DEF-lang` for
|
|
|
`[based on] Dlang [and influenced by / inspiration from] Erlang [new] Fine language`.
|
|
|
|
|
|
-File extension - `*.de` (because `de` is more short than `def`).
|
|
|
+File extension - `*.de` (because `de` shorter than `def`).
|
|
|
|
|
|
|
|
|
|
|
@@ -234,9 +234,13 @@ todo more examples -- with switch case dlang
|
|
|
|
|
|
## 2.5 aliases for imports, externs etc
|
|
|
```
|
|
|
-use std [ stdio array string algorithm ] as use_std // definition at the beginning of the file
|
|
|
+// definition at the beginning of the file
|
|
|
+use as use_std
|
|
|
+ std [ stdio array string algorithm ]
|
|
|
|
|
|
-use use_std // allows use elsewhere in the file -- generate next code in this position in the target .d file
|
|
|
+
|
|
|
+// allows use elsewhere in the file -- generate next code in this position in the target .d file
|
|
|
+use use_std
|
|
|
|
|
|
->
|
|
|
|
|
@@ -251,17 +255,18 @@ use core.stdc.stdio [ printf scanf ]
|
|
|
std.conv [ to ]
|
|
|
|
|
|
->
|
|
|
+
|
|
|
import core.stdc.stdio : printf, scanf;
|
|
|
import std.conv : to;
|
|
|
```
|
|
|
|
|
|
```
|
|
|
-use as use_std1
|
|
|
+use as use1
|
|
|
core.stdc.stdio [ printf scanf ]
|
|
|
std.conv [ to ]
|
|
|
|
|
|
|
|
|
-use_std1 // use elsewhere in the file
|
|
|
+use1 // use elsewhere in the file
|
|
|
|
|
|
->
|
|
|
import core.stdc.stdio : printf, scanf;
|
|
@@ -302,7 +307,7 @@ void _start(){ }
|
|
|
|
|
|
```
|
|
|
// wasm import from js
|
|
|
-wuse print int a
|
|
|
+void print int a
|
|
|
|
|
|
->
|
|
|
|
|
@@ -310,7 +315,44 @@ void print(int a);
|
|
|
```
|
|
|
|
|
|
|
|
|
-## 2.7 code between ```dlang``` reserved words translates into target .d file without changes
|
|
|
+## 2.7 data types aliases
|
|
|
+```
|
|
|
+// signed
|
|
|
+i8 -> byte // -128 — 127
|
|
|
+i16 -> short // -32768 — 32767
|
|
|
+i32 -> int // -2147483648 — 2147483647
|
|
|
+i64 -> long // -9223372036854775808 — 9223372036854775807
|
|
|
+
|
|
|
+// unsigned
|
|
|
+u8 -> ubyte // 0 — 255
|
|
|
+u16 -> ushort // 0 — 65535
|
|
|
+u32 -> uint // 0 — 4294967295
|
|
|
+u64 -> ulong // 0 — 18446744073709551615
|
|
|
+
|
|
|
+// 128 not exists // 0 — 340282366920938463463374607431768211455
|
|
|
+
|
|
|
+f32 -> float
|
|
|
+f64 -> double
|
|
|
+f128 -> real // up to 128 bit
|
|
|
+```
|
|
|
+
|
|
|
+```
|
|
|
+// todo mv to code
|
|
|
+alias i8 = char;
|
|
|
+alias i16 = short;
|
|
|
+alias i32 = int;
|
|
|
+alias i64 = long;
|
|
|
+alias u8 = uchar;
|
|
|
+alias u16 = ushort;
|
|
|
+alias u32 = uint;
|
|
|
+alias u64 = ulong;
|
|
|
+alias f32 = float;
|
|
|
+alias f64 = double;
|
|
|
+alias f128 = real;
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+## 2.8 code between ```dlang``` reserved words translates into target .d file without changes
|
|
|
```
|
|
|
...
|
|
|
|
|
@@ -324,7 +366,7 @@ dlang
|
|
|
```
|
|
|
|
|
|
|
|
|
-## 2.8 reserved words (keywords) list
|
|
|
+## 2.9 reserved words (keywords) list
|
|
|
including https://dlang.org/spec/lex.html#keywords
|
|
|
```
|
|
|
abstract alias align asm assert auto
|
|
@@ -374,6 +416,8 @@ __VERSION__
|
|
|
dlang
|
|
|
use
|
|
|
as
|
|
|
+case
|
|
|
+sw case
|
|
|
```
|
|
|
todo
|
|
|
|