Commit Graph

94 Commits

Author SHA1 Message Date
gingerBill 2fe0eaf2ad Fix formatting 2020-03-04 13:10:39 +00:00
gingerBill 8f42958ba3 Fix __dynamic_array_reserve 2020-02-26 12:58:22 +00:00
gingerBill 4d7270cec9 Fix __dynamic_array_reserve to allow for zero sized elements 2020-02-26 12:55:56 +00:00
Mikkel Hjortshoej 9d5692ae68 Enhance logger interface with 'f' and not 'f' variants, also move level detection out 2020-02-10 01:26:04 +01:00
gingerBill 0f399a7294 Add union #maybe 2020-02-01 11:10:28 +00:00
Tetralux abe8789890 Fix make(map[K]V, 0) by ensuring reserve always sets an allocator
Currently, `make(map[K]V, 0)` asserts, because trying `reserve` zero items does not set the allocator; it early-outs.

`__dynamic_map_reserve` assumed that `__dynamic_array_reserve` would always set the allocator - even if given a desired capacity of `0`.

Rather than making `__slice_resize` just _also_ set the default allocator if there isn't one, this makes `__dynamic_array_reserve` always set the allocator, even if it is about to early out.
This is because users are lead to understand that `append` will set the allocator if one is not already set - `reserve` should work the same way.
2020-01-26 01:03:14 +00:00
gingerBill 5c7d6fcfd0 Improve minimum dependency for complex numbers and quaternion numbers. 2020-01-04 18:04:12 +00:00
Tetralux b32ef9e47b Fix make and reserve
- Set the allocator, even if memory allocation fails.
  Right now it doesn't, which means that if allocation fails, it'll use
  the context allocator instead. This memory will be leaked if the user
  doesn't understand that this happened.

- Only set len and cap of the array returned from make iif the memory allocation
  succeeded.
  This means that reserve will return false if you do this:
  ```
  a := make([dynamic]int, failing_allocator);
  if !reserve(&a, 5) do return; // or whatever indicates failure
  ```
2020-01-03 10:40:45 +00:00
gingerBill b8324b0776 Fix behaviour for make to return nil when alloc returns nil 2020-01-03 10:17:30 +00:00
Tetralux f6f10d10e8 Fix append_string 2020-01-02 11:38:25 +00:00
gingerBill 978d7fcb99 Fix typeid information for enumerated arrays 2019-12-31 16:54:50 +00:00
gingerBill ab52f8d795 Move definition of mem.Allocator and log.Logger to package runtime, to reduce import cycle magic 2019-12-31 12:15:19 +00:00
gingerBill 2252d992d7 Add -disable-assert to disable the code generation of the built-in run-time 'assert' procedure 2019-12-29 21:10:27 +00:00
gingerBill a8a4dc1eb1 Make default context.temp_allocator thread safe when using package thread 2019-12-29 18:08:48 +00:00
gingerBill 10f0961184 Enumerated arrays [Enum_Type]Elem_Type 2019-12-27 12:51:02 +00:00
gingerBill d1c9fd4e01 Implement #complete switch by default, replace with #partial switch #511 2019-12-22 12:03:48 +00:00
gingerBill 42def957d5 Fix append_elem_string, again 2019-12-03 09:35:24 +00:00
gingerBill 6433a0d31e Fix append_elem_string 2019-12-03 09:16:11 +00:00
gingerBill 359e5d9e15 Fix append_elem_string 2019-12-03 09:07:15 +00:00
gingerBill 9db81498d8 Make the string type elements "immutable", akin to char const * in C
Allows for extra security and optimization benefits
2019-12-01 14:10:59 +00:00
gingerBill 9b58781122 #soa[dynamic]Type (Experimental) 2019-11-21 19:36:07 +00:00
gingerBill 44e0e96612 Prepare SOA Struct code for slices and dynamic arrays *to be implemented* 2019-11-19 23:54:36 +00:00
gingerBill ebf7926fa4 SOA support of Structures and Arrays; Runtime information for SOA structs; fmt printing support for SOA structs 2019-11-03 00:32:22 +00:00
gingerBill 7140f42915 Modify runtime to reduce dependencies on other packages 2019-10-23 21:43:13 +01:00
gingerBill 2a6d9e8927 #panic; Minor change to demo.odin; Fix #assert bug at file scope 2019-10-13 12:38:23 +01:00
gingerBill 939459b635 Change implicit semicolon rules for record types within procedure bodies; Update package odin/* 2019-10-06 19:16:55 +01:00
gingerBill 4e8a801b35 strings.split; strings.index; eprint* over print*_err; 2019-10-06 18:13:15 +01:00
gingerBill 7bc146e6fd Built-in Quaternions (Not just an April Fool's Joke any more) 2019-08-26 11:33:05 +01:00
gingerBill 04036aba9c package reflect; fix substring type bug; fix scoping rules for using on procedure parameter 2019-08-11 23:58:49 +01:00
gingerBill 9c63212824 Struct field tags 2019-08-09 21:59:58 +01:00
gingerBill 2c5c8192f8 Fix parsing for procedure literals expression statements; improve assert performance; other minor fixes 2019-07-28 22:58:56 +01:00
gingerBill c7a70be824 Fix __get_map_key 2019-07-15 22:38:51 +01:00
gingerBill f25818e923 Make procedure parameters just named values rather than copied variables 2019-07-15 21:18:37 +01:00
gingerBill 4ab9edeb53 union #no_nil 2019-07-09 10:28:13 +01:00
gingerBill fb3d73cb20 Make core library use a..<b rather than doing a..b-1 2019-05-28 12:52:20 +01:00
gingerBill 1354f53d02 Remove derived from context; Fix parsing issue for typeid specializations in record parameters; Fix runtime printing of types 2019-03-31 11:58:54 +01:00
gingerBill ef04d13337 Use context for assert-based things. 2019-03-30 15:10:40 +00:00
gingerBill 68d4bde82f Overrideable stdin, stdout, stderr at the context level 2019-03-30 14:51:42 +00:00
gingerBill 1fd677b42e Remove *_remove from demo and use built-in versions 2019-03-25 21:29:21 +00:00
gingerBill bdab5e00da Minor code clean up 2019-03-11 19:52:40 +00:00
gingerBill 4c51384ad6 intrinsics.vector type (Experimental) 2019-02-23 16:44:16 +00:00
gingerBill dee28d998f Allow for @indent for attributes that don't require any parameters; Add -ignore-unknown-attributes 2019-01-30 14:24:14 +00:00
gingerBill 5acea1bceb Source_Code_Location.hash; %#v printing for Source_Code_Location; allow typeid for map keys 2019-01-05 15:56:47 +00:00
gingerBill 66a9fde12c Remove #[...] attribute syntax.
(Not really worth the change)
2018-12-26 16:23:25 +00:00
gingerBill b4e83a430a Add card procedure to measure cardinality of a bit_set 2018-12-21 10:31:10 +00:00
gingerBill 47e31c3de8 Remove return value from append 2018-12-14 14:40:27 +00:00
gingerBill 28583bfff8 Change procedure group syntax from proc[] to proc{}; deprecate proc[] (raises warning currently) 2018-12-02 18:01:03 +00:00
gingerBill 00161023cd Endian specific integers: e.g. i32 i32le i32be 2018-12-02 15:53:52 +00:00
gingerBill b55b1ffe14 opaque keyword and type 2018-11-11 17:08:30 +00:00
gingerBill 6659ceb551 Allow comparisons of cstring; Add resize 2018-10-31 10:04:30 +00:00