Add string as struct, Fix void pointer indexing

compound for String is not working but maybe that's fine
This commit is contained in:
Krzosa Karol
2023-02-09 20:17:48 +01:00
parent 5e8b3739af
commit d41da94c80
6 changed files with 32 additions and 45 deletions

View File

@@ -23,12 +23,7 @@
Fix backlog
- [ ] Fix invalid error message: AlmostLinearToSRGB :: (a: Color);; return {sqrtf(a.r), sqrtf(a.g), sqrtf(a.b), a.a}
- [ ] Fix untyped literal going to codegen stage, example in arms_race
- [ ] Fix and decide what to do when initializing global variable using not constants C:/AProgramming/cparse/compiler/modules/Language.core:180:28: error: initializer element is not a compile-time constant
- [ ] Fix adressing void is possible, mayp make it possible to address void
using bytes
* a.void + 10
* a.void[10]
- [ ] Test and bulletproof any, slices
- [ ] Need tests that make sure stuff errors out
- [ ] String declaration in Language.core this way we can compound create it and access fields and stuff
@@ -36,14 +31,7 @@ Fix backlog
result := String{data, filesize}
- [ ] Fix tuple being able to colapse into a single variable
- [ ] Fix Found multiple definitions of not showing multiple definitions in the error message
- [ ] Fix being able to cast -1 to *void
- [ ] How to cast from U64 to pointer?
- [ ] Fix returning literlas using multiple arguments ```
C:/AProgramming/cparse/compiler/examples/arms_race/arms_race.core:141:35: error: cannot take the address of an rvalue of type 'int'
MemoryCopy(&S10_S11_S44_139.m0, &(0x0), sizeof(S10_S11_S44_139.m0));
^ ~~~
C:/AProgramming/cparse/compiler/examples/arms_race/arms_race.core:142:35: error: cannot take the address of an rvalue of type 'unsigned long long'
MemoryCopy(&S10_S11_S44_139.m1, &(32ULL), sizeof(S10_S11_S44_139.m1));
```
Future features
@@ -59,17 +47,11 @@ Future features
###
- [ ] Maybe wait to implement WASM / bytecode emitter before doing this?
Probably need some UInt Int types and those should be default, target
decides the size of these
- [ ] Way to import and force evaluate #import_lazy #import ?
Redesign:
- [ ] Redesign Type map to use List and reduce wasting space
- [ ] Redesign lexing to minimize memory usage, we got rid of heap but in a naive way!
- [ ] Probably need to move all the global data into the context if we want to use this as library or not?
- [ ] Casting
- [ ] Casting syntax
In the future