Commit Graph

1563 Commits

Author SHA1 Message Date
Daniel Gavin 44ee0f2cdc Merge branch 'master' into prototype-fmt 2021-05-20 12:15:14 +02:00
Daniel Gavin 50035f257e don't factor in the rhs length for lines that don't have Equal tokens. 2021-05-20 12:13:23 +02:00
gingerBill 26ce40c188 Remove @(static) for global variables 2021-05-19 11:51:48 +01:00
gingerBill a580cdbe7b Delete core:sync/sync2/channel* stuff (for the time being) 2021-05-19 10:50:27 +01:00
gingerBill e82e4398b6 Add intrinsics.mem_copy and intrinsics.mem_copy_non_overlapping 2021-05-19 10:50:02 +01:00
gingerBill e0225c3579 Add intrinsics.sqrt for floating-point values 2021-05-19 10:32:41 +01:00
gingerBill 9ccdc40f65 Make .Optional_Semicolons a flag for the parser 2021-05-16 12:43:35 +01:00
gingerBill df3512b112 Make core:odin use a string for the source rather than []byte 2021-05-16 12:38:27 +01:00
gingerBill ce08e832f7 Allow ..= alongside .. as a "full range" operator; Update core:odin/parser etc 2021-05-16 12:34:35 +01:00
gingerBill 24c89b3eee Minor change 2021-05-16 00:29:22 +01:00
gingerBill 85e5be03d1 Redesign os2.Error to work with the new extended union behaviour 2021-05-16 00:25:47 +01:00
gingerBill 465b6139d5 Temporarily fix syscall in Linux and Freebsd (eventually to be replaced with a proper implementation) 2021-05-13 12:05:23 +01:00
gingerBill b37d344eb2 Add intrinsics.type_is_variant_of 2021-05-13 12:04:51 +01:00
gingerBill 5420cc083d Implement #807 2021-05-12 23:26:21 +01:00
gingerBill 42138d1ad5 Merge pull request #947 from Kelimion/deprecated
Mark mem.slice_ptr_to_bytes as deprecated.
2021-05-07 10:59:08 +01:00
gingerBill 502ad0c10b sync2.Auto_Reset_Event; Make atomic operations names clearer 2021-05-06 14:00:01 +01:00
Jeroen van Rijn 03862d1f48 Mark mem.slice_ptr_to_bytes as deprecated.
Use byte_slice instead.

We can't make it an alias *and* mark it as deprecated, regrettably:

```odin
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byte {
    return transmute([]u8)Raw_Slice{data=data, len=max(len, 0)};
}
@(deprecated="use byte_slice")
slice_ptr_to_bytes :: byte_slice;

"mem.odin(145:1) Constant alias declarations cannot have attributes"
```
2021-05-06 13:23:17 +02:00
Jeroen van Rijn 4f51d74fc2 Fix typo in core:mem alloc() comment. 2021-05-06 11:25:41 +02:00
gingerBill 278de3a92f Unify AstTernaryExpr with AstTernaryIfExpr
Allow for both syntaxes `x if cond else y` and `cond ? x : y`
Removes the confusing semantics behind `?:` which could be `if` or `when` depending on the context.
2021-05-05 15:22:54 +01:00
Jeroen van Rijn afb6ebd21e Fix gray+alpha alpha extract. 2021-05-04 17:48:43 +02:00
Jeroen van Rijn 9a39ce6b75 Change General_Error.OK to nil 2021-05-03 15:38:43 +02:00
Jeroen van Rijn 59b3c472ca Convert core:compress and core:image error checks to new union comparison.
No more need for `is_kind(err, Error_Value)`, just test err == Error_Value.
2021-05-03 15:08:34 +02:00
gingerBill 518ecaf9c9 Allow unions to be comparable if all their variants are comparable 2021-05-03 13:17:16 +01:00
Jeroen van Rijn 448f834b28 Remove debug print in image helper. 2021-05-03 01:23:03 +02:00
Jeroen van Rijn 3160a6a12c Don't need other path for grayscale output. 2021-05-02 21:11:06 +02:00
Jeroen van Rijn 7d534769d6 Add new PNG post processing options. 2021-05-02 20:38:30 +02:00
Jeroen van Rijn 2451014b6e datetime_to_time's ok should default to true. 2021-05-02 13:23:57 +02:00
gingerBill 9854dbe889 Remove unused import 2021-05-01 23:14:14 +01:00
gingerBill cf0bf1a7cb Add testing.fail_now 2021-05-01 23:06:14 +01:00
gingerBill 364e6c9573 Move comment 2021-05-01 22:58:13 +01:00
gingerBill 52d38ae42b Make the core:testing runner on windows run in a separate thread to handle crashes in more safe manner 2021-05-01 22:54:27 +01:00
Jeroen van Rijn 2ad8f99790 ZLIB level 0: LEN/NLEN = i16. 2021-05-01 21:56:45 +02:00
Daniel Gavin 87a1833862 fix weird behavior of nesting proc types in structs 2021-05-01 21:26:40 +02:00
Jeroen van Rijn 433d742183 Fix Paeth for bit depth < 8. 2021-05-01 20:39:00 +02:00
gingerBill b845db1618 Add prototypes for intrinsics.fixed_point_* 2021-05-01 18:26:51 +01:00
Jeroen van Rijn 0659a11a1a PNG: Fix tRNS handling. 2021-05-01 18:24:31 +02:00
gingerBill 97b537f800 Update intrinsics.odin for documentation 2021-05-01 16:23:50 +01:00
Jeroen van Rijn db1ef078ff Fix a few more cases in which bKGD wasn't properly applied. 2021-05-01 16:05:13 +02:00
Jeroen van Rijn a02bcd3bfd PNG: Fix test for when premultiplication is needed. 2021-05-01 13:16:47 +02:00
gingerBill 5f617c56e1 Minor stylistic code changes to compress and image packages 2021-04-30 10:58:29 +01:00
Jeroen van Rijn 06f1eaa153 Use regular allocator from png+gzip's load_from_file.
I would've used `os.stream_from_handle`, but:
- Parts of it seem to be implemented for Windows only at the moment.
- PNG's `peek_data` using that stream didn't manage to rewind and thus tried to parse the data after the header as the header.

Two things must happen:
- The `os.stream_from_handle` implementation needs to be fixed.
- PNG and GZIP's parsers need to be able to handle streams that can't rewind or seek (backward).

Those fixes are on my TODO list but are exceed the scope of this patch.
2021-04-30 09:35:43 +02:00
Jeroen van Rijn 58e023e0cf Add compress and image to core. 2021-04-30 00:21:52 +02:00
Daniel Gavin 9c6ab05981 fix tokenizer for ~= and better struct aligning 2021-04-29 00:51:24 +02:00
Daniel Gavin 088f4b5039 fix out of bounds with empty struct 2021-04-28 12:53:04 +02:00
gingerBill 24fce21d90 Add "naked" calling convention (removes prologue and epilogue) 2021-04-28 10:49:30 +01:00
gingerBill ffffb04d85 Remove unused import 2021-04-27 17:21:52 +01:00
gingerBill 17390cd317 Implement sync2.Recursive_Mutex using WaitOnAddress and friends on Windows 2021-04-27 17:19:12 +01:00
gingerBill 7ac80544a1 Max sync2.Sema on windows be i32 for the counter internally. 2021-04-27 16:59:25 +01:00
gingerBill 96b60d8779 Reimplement sync2.Sema on windows with WaitOnAddress primitives 2021-04-27 16:56:11 +01:00
gingerBill e7e1866e50 Fix #893 2021-04-27 13:09:37 +01:00