Fixing bugs with strings

This commit is contained in:
Krzosa Karol
2022-09-27 10:12:36 +02:00
parent 5c61e159c7
commit 4f51749787
5 changed files with 136 additions and 78 deletions

View File

@@ -98,6 +98,82 @@ For modules it's a bit different cause they should be distributed as valid.
[ ] - Conditional compilation #if
[ ] - Polymorphism - create declaration of a polymorphic thing, when it's called just copy it, replace types and typecheck normally, when someone calls again you just search for the instantiation again
## Done
- [x] Type as a parameter to a function, alloc :: (size: U64, type: Type)
- [x] Add token information to instructions
- [-] Mixing loads and imports leads to code duplication, is that what we want???
- [x] print those token lines nicely
- [x] Improve the python metaprogram
- [x] Implementing type Any
- [x] Runtime TypeInfo
- [x] Proper type Type support
- [x] Switch
- [x] Type aliases :: should probably be strictly typed, but assigning constant values should work
- [x] Array of inferred size
- [x] Casting pointers to and from void should be implicit
- [x] Multiple return values
- [x] Add c string
- [-] Should compound resolution use an algorithm to reorder compounds to initialize all fields in order
- [x] slices should be properly displayed in debugger
- [x] Imports inside of import shouldn't spill outside
- [x] Scope
- [x] #assert that handles constants at compile time and vars at runtime
- [x] Hex 0x42
- [x] Rewrite where # happen,
- [x] elif
- [x] cast ->
- [x] Remodel compound from call to {}
- [x] Fix codegen renames
- [x] Field access rewrite
- [-] Constants embeded in structs should be able to refer to other constants in that namespace without prefix
- [-] Order independent constants in structs
- [-] Fix recursive lambdas in structs
- [x] Error message when file not found
- [x] Better error messages when type difference
- [-] Fixing access to functions/structs, in C we cant have functons inside of structs / functions so we need to rewrite the tree
- [x] Emitting #line
- [x] Making sure debugger works
- [x] We need ++ -- operators
- [x] Arrays with size passed
- [x] Values inited to 0 by default
- [x] Some way to call foreign functions
- [x] We are parsing wrong here: (t.str=(&string_to_lex.str)[i]);
- [x] Test new operators, add constant eval for them
- [x] lvalue, rvalue concept so we cant assign value to some arbitrary weird expression
- [x] Passing down program to compile through command line
- [x] More basic types
- [x] Implementing required operations int128
- [x] Fix casting
- [x] More for loop variations
- [x] Add basic support for floats
- [x] Converting from U64 token to S64 Atom introduces unnanounced error (negates) - probably need big int
- [x] Add basic setup for new type system
- [x] Access through struct names to constants Arena.CONSTANT
- [x] Enums
- [x] Make sure pointer arithmetic works
- [x] Initial for loop
- [x] Enum . access to values
- [x] Character literal
- [x] Compiling and running a program
- [x] Infinite for loop
- [x] in new typesystem: Fix calls, fix all example programs
- [x] Fix arithmetic operations in new type system
- [x] Init statements, different kinds [+=] [-=] etc.
- [x] Struct calls
- [x] Operators: Bit negation, Not
- [x] Default values in calls
- [x] Resolving calls with default values
- [x] Pass statement
- [x] Lexer: Need to insert scope endings when hitting End of file
- [x] Resolving calls with named args, with indexed args
- [x] Structs
- [x] Struct field access
- [x] Struct field access with dots while compiling to arrows in c
- [x] Typespecs should probably be expressions so stuff like would be possible :: \*[32]int
- [x] Initial order independence algorithm
- [x] Think about compound expressions, unify with calls - maybe Thing(a=1) instead of Thing{a=1}
*/
#include "base.cpp"