Andrew Kelley
8d5c4a67a7
Merge branch 'dimenus-c-field-expr'
2017-11-28 03:00:13 -05:00
Andrew Kelley
e745544dac
translate-c: detect macros referencing field lookup
...
as fn calls which assert the fn ptr is non-null
2017-11-28 02:58:51 -05:00
Andrew Kelley
f537c51f25
Merge branch 'c-field-expr' of https://github.com/dimenus/zig into dimenus-c-field-expr
2017-11-28 00:44:16 -05:00
Andrew Kelley
1ab84a27d3
translate-c: fix sometimes getting (no file) warnings
...
Thanks to Mason Remaley for testing the fix.
2017-11-28 00:32:32 -05:00
Mason Remaley
3e8fd24547
Implements translation for the prefix not operator ( #628 )
2017-11-27 21:00:05 -05:00
Ryan Saunderson
57049b95b3
Resolving merge w/ upstream master
2017-11-27 11:42:48 -06:00
dimenus
04472f57be
Added support for exporting of C field expressions
2017-11-27 11:23:14 -06:00
Andrew Kelley
671183fa9a
translate-c: support pointer casting
...
also avoid some unnecessary casts
2017-11-26 20:05:55 -05:00
Andrew Kelley
93fac5f257
translate-c: support variable name shadowing
2017-11-26 17:30:43 -05:00
Andrew Kelley
9a8545d590
translate-c: fix translation when no default switch case
2017-11-26 16:03:56 -05:00
Andrew Kelley
aa2ca3f02c
translate-c: better way to translate switch
...
previously `continue` would be handled incorrectly
2017-11-26 15:58:49 -05:00
Andrew Kelley
1b0e90f70b
translate-c supports switch statements
2017-11-26 00:58:11 -05:00
Andrew Kelley
687e359291
translate-c: avoid global state and introduce var decl scopes
...
in preparation to implement switch and solve variable name collisions
2017-11-25 22:17:24 -05:00
Andrew Kelley
df0e875856
translate-c: introduce the concept of scopes
...
in preparation to implement switch and solve variable name collisions
2017-11-25 20:34:05 -05:00
Andrew Kelley
a2afcae9ff
fix crash when constant inside comptime function has compile error
...
closes #625
2017-11-25 18:16:33 -05:00
Andrew Kelley
48ebb65cc7
add an assert to catch corrupted memory
2017-11-25 16:34:08 -05:00
Andrew Kelley
b390929826
translate-c supports break and continue
2017-11-25 11:56:17 -05:00
Andrew Kelley
bf20b260ce
translate-c supports for loops
2017-11-25 00:57:48 -05:00
Andrew Kelley
18eb3c5f90
translate-c supports returning void
2017-11-25 00:25:47 -05:00
Andrew Kelley
cd36baf530
fix assertion failed when invalid type encountered
2017-11-24 22:04:24 -05:00
Andrew Kelley
40480c7cdc
translate-c supports string literals
2017-11-24 19:26:05 -05:00
Andrew Kelley
68312afcdf
translate-c: support pre increment and decrement operators
2017-11-24 16:36:39 -05:00
Andrew Kelley
741504862c
update homepage docs
2017-11-24 15:06:12 -05:00
Andrew Kelley
5a25505668
rename "parsec" to "translate-c"
2017-11-24 14:56:05 -05:00
Josh Wolfe
afbbdb2c67
move base64 functions into structs
2017-11-20 23:26:45 -07:00
Josh Wolfe
a44283b0b2
rework std.base64 api
...
* rename decode to decodeExactUnsafe.
* add decodeExact, which checks for invalid chars and padding.
* add decodeWithIgnore, which also allows ignoring chars.
* alphabets are supplied to the decoders with their
char-to-index mapping already built, which enables it to be
done at comptime.
* all decode/encode apis except decodeWithIgnore require dest
to be the exactly correct length. This is calculated by a
calc function corresponding to each api. These apis no longer
return the dest parameter.
* for decodeWithIgnore, an exact size cannot be known a priori.
Instead, a calc function gives an upperbound, and a runtime
error is returned in case of overflow. decodeWithIgnore
returns the number of bytes written to dest.
closes #611
2017-11-20 23:26:45 -07:00
Andrew Kelley
339d48ac15
parse-c: support address of operator
2017-11-17 12:11:03 -05:00
Andrew Kelley
3e835973db
Merge pull request #617 from dimenus/dll-load
...
Added DLL loading capability in windows to the std lib.
2017-11-17 10:24:34 -05:00
Andrew Kelley
b50c676f76
add parse-c support for unions
2017-11-16 23:54:33 -05:00
dimenus
a7d07d412c
Added DLL loading capability in windows to the std lib.
2017-11-16 21:49:05 -06:00
Andrew Kelley
d108689382
Merge branch 'unions'
...
closes #144
2017-11-16 22:14:50 -05:00
Andrew Kelley
1473eb9ae0
add documentation placeholders for unions
2017-11-16 22:13:20 -05:00
Andrew Kelley
5d2ba056c8
fix codegen for union init with runtime value
...
see #144
2017-11-16 22:06:08 -05:00
Andrew Kelley
e26ccd5166
debug safety for unions
2017-11-16 21:15:15 -05:00
Andrew Kelley
f12d36641f
union secret field is the tag index instead of distinct type index
...
See #144
2017-11-16 10:06:58 -05:00
Andrew Kelley
018cbff438
unions have a secret field for the type
...
See #144
2017-11-15 22:52:47 -05:00
Andrew Kelley
f276fd0f37
basic union support
...
See #144
2017-11-15 13:04:18 -05:00
Andrew Kelley
7a74dbadd7
add docs for std.base64
2017-11-14 17:58:58 -05:00
Andrew Kelley
5029322aa1
c-to-zig: handle UO_Deref
2017-11-14 02:10:13 -05:00
Josh Wolfe
6ffaf4c2e2
parsec supports do loop
2017-11-13 22:56:20 -07:00
Josh Wolfe
012ce1481e
parsec supports post increment/decrement with used result
2017-11-13 22:19:51 -07:00
Josh Wolfe
4c2cdf6f4d
parsec supports more compound assign operators
2017-11-13 21:37:30 -07:00
Josh Wolfe
c1fde0e8c4
parsec supports bitshift operators
2017-11-13 20:49:53 -07:00
Andrew Kelley
6356724057
Merge branch 'dimenus-parsec'
2017-11-13 22:33:58 -05:00
Andrew Kelley
03732860be
add test case for previous commit
2017-11-13 22:33:41 -05:00
Andrew Kelley
df07361642
Merge branch 'parsec' of https://github.com/dimenus/zig into dimenus-parsec
2017-11-13 22:26:31 -05:00
Josh Wolfe
57cd074959
parsec supports C comma operator
2017-11-13 19:59:32 -07:00
Josh Wolfe
1f28fcdec5
parsec supports C NULL to pointer implicit cast
2017-11-13 19:39:46 -07:00
dimenus
98e3c7911c
Fixed duplicate decl detection for typedefs/enums
2017-11-13 16:37:46 -06:00
Andrew Kelley
a890380b6a
fix windows trying to run linux-only tests
2017-11-10 18:29:49 -05:00