Andrew Kelley
13b5a4bf8c
remove cancel
2019-08-15 14:05:12 -04:00
Andrew Kelley
ee64a22045
add the anyframe
and anyframe->T
types
2019-07-26 19:52:35 -04:00
Andrew Kelley
54e716afdc
remove coroutines implementation and promise type
2019-07-19 18:18:44 -04:00
hryx
cce11a724c
Make anyerror not a keyword
2019-07-06 15:57:32 -07:00
hryx
6bfa8546bb
Unicode escapes: stage1 tokenizer and behavior tests
2019-07-04 22:40:19 -07:00
Andrew Kelley
b735764898
different array literal syntax when inferring the size
...
old syntax: []i32{1, 2, 3}
new syntax: [_]i32{1, 2, 3}
closes #1797
2019-06-09 19:26:32 -04:00
Andrew Kelley
b7a82288ad
change use
to usingnamespace
...
See #2014
`use` syntax is still accepted for now. `zig fmt` automatically
updates code. After a release cycle the old syntax will be removed.
2019-05-29 19:09:58 -04:00
Andrew Kelley
2eba779af5
stage1 tokenizer: add more missing break statements
2019-05-16 16:50:24 -04:00
SamTebbs33
87901baa28
Add break after digit_value check in TokenizeStateCharCode
2019-05-16 16:49:26 -04:00
Andrew Kelley
5eaead6a56
implement allowzero pointer attribute
...
closes #1953
only needed for freestanding targets.
also adds safety for `@intToPtr` when the address is zero.
2019-03-25 12:55:45 -04:00
Andrew Kelley
89953ec83d
character literals: allow unicode escapes
...
also make the documentation for character literals more clear.
closes #2089
see #2097
2019-03-23 17:35:21 -04:00
Andrew Kelley
3e9697bb35
remove octal and hex floats from the language
...
closes #2093
This is technically a breaking change but I would be
surprised if anyone was actually using this feature.
2019-03-23 14:04:52 -04:00
Andrew Kelley
4615ed5ea0
float literals now parse using musl's 128 bit float code
...
fixes float literals not having 128 bit precision
2019-03-22 14:56:03 -04:00
Marc Tiehuis
e3b70fe4ba
Simplify hex-float parsing code
2019-03-22 17:11:57 +13:00
Andrew Kelley
d04a1456df
hex float parsing: solve another case
...
this works now: 0x1.edcb34a235253948765432134674fp-1
2019-03-21 16:35:18 -04:00
Andrew Kelley
af509c68b0
fix parsing of large hex float literals
...
closes #2083
2019-03-21 16:17:29 -04:00
Andrew Kelley
b8cbe3872e
added C pointer type and implicit int-to-ptr for this type
...
See #1059
2019-02-10 00:14:30 -05:00
Andrew Kelley
b1775ca168
thread local storage working for linux x86_64
2019-02-06 13:48:04 -05:00
Matthew McAllister
ad8381e0d2
Move tokenizer error location to offending char
...
Previously, it pointed to the start of the current token, but this made
it difficult to tell where the error occurred when it was, say, in the
middle of a string.
2019-01-30 14:02:01 -05:00
Andrew Kelley
9c328b4291
simpler implementation of &&
and ||
hints
...
This accomplishes the same goal, but with less changes, so that
I can backport copy elision stuff easier.
2019-01-29 22:29:56 -05:00
kristopher tate
5bf9ffdc5b
Hint at use of and/or when &&/|| is improperly used ( #1886 )
2019-01-25 21:10:40 +01:00
Andrew Kelley
704374e512
rename section
keyword to linksection
...
add zig fmt support for this syntax
closes #1152
2018-11-17 01:38:35 -05:00
Jimmi Holst Christensen
8139c5a516
New Zig formal grammar ( #1685 )
...
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00
Wink Saville
631851f8b5
Tweak SYMBOL_CHAR define in tokenizer.cpp
...
Make it a little clearer what a SYMBOL_CHAR is, use ALPHA instead of
ALPHA_EXCEPT_C and case 'c', which is ALPHA's definition.
2018-09-26 11:29:01 -04:00
Andrew Kelley
c06a61e9bf
remove this
. add @This()
.
...
closes #1283
2018-09-13 16:34:33 -04:00
Andrew Kelley
c393a399fb
fix invalid character test on windows
2018-07-18 10:51:42 -04:00
Marc Tiehuis
4a35d7eeeb
Correct hex-float parsing
...
Unblocks #495 .
2018-06-28 20:12:03 +12:00
Andrew Kelley
77678b2cbc
breaking syntax change: orelse keyword instead of ?? ( #1096 )
...
use the `zig-fmt-optional-default` branch to have zig fmt
automatically do the changes.
closes #1023
2018-06-10 01:13:51 -04:00
Andrew Kelley
ec1b6f6673
breaking syntax change: ??x to x.? ( #1095 )
...
See #1023
This also renames Nullable/Maybe to Optional
2018-06-09 23:42:14 -04:00
Andrew Kelley
f06bce5dda
introduce [*] for unknown length pointers
...
See #770
Currently it does not have any different behavior than `*`
but it is now recommended to use `[*]` for unknown length
pointers to be future-proof.
Instead of [ * ] being separate tokens as the proposal
suggested, this commit implements `[*]` as a single token.
2018-06-02 04:04:23 -04:00
Andrew Kelley
897e783763
add promise->T syntax parsing
...
closes #857
2018-03-24 19:25:53 -04:00
Andrew Kelley
af10b0fec2
add async, await, suspend, resume, cancel keywords
...
See #727
2018-02-19 23:19:59 -05:00
Andrew Kelley
ca597e2bfb
std.zig.parser understands try. zig fmt respects a double line break.
2018-02-14 23:00:53 -05:00
Andrew Kelley
b8f59e14cd
*WIP* error sets - correctly resolve inferred error sets
2018-02-02 18:13:32 -05:00
Andrew Kelley
b3a6faf13e
replace %defer with errdefer
...
See #632
now we have 1 less sigil
2018-01-23 23:08:09 -05:00
Andrew Kelley
cf39819478
add new kind of test: generating .h files. and more
...
* docgen supports obj_err code kind for demonstrating
errors without explicit test cases
* add documentation for `extern enum`. See #367
* remove coldcc keyword and add @setIsCold. See #661
* add compile errors for non-extern struct, enum, unions
in function signatures
* add .h file generation for extern struct, enum, unions
2018-01-22 22:24:07 -05:00
Andrew Kelley
3c094116aa
remove %% prefix operator
...
See #632
closes #545
closes #510
this makes #651 higher priority
2018-01-09 00:51:51 -05:00
Andrew Kelley
632d143bff
replace a %% b
with a catch b
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 17:28:20 -05:00
Andrew Kelley
66717db735
replace %return
with try
...
See #632
better fits the convention of using keywords for control flow
2018-01-07 16:53:13 -05:00
Andrew Kelley
c627f9ea18
wip bring back export keyword
2017-12-19 01:19:49 -05:00
Andrew Kelley
1fdebc1dc4
wip export rewrite
2017-12-18 09:59:57 -05:00
Marc Tiehuis
6663638195
Improve invalid character error messages ( #566 )
...
See #544
2017-10-26 10:00:23 -04:00
Andrew Kelley
fb365e3952
fix build on mingw
2017-09-28 09:43:40 -04:00
Marc Tiehuis
9dfe217be3
Allow 128-bit hex float literals
...
Closes #499 .
2017-09-28 23:33:36 +13:00
Andrew Kelley
57ea6e8c9f
fix up msvc stuff to make it work on linux and macos too
2017-09-13 02:40:02 -04:00
Jonathan Marler
7c81cd30de
Add support for MSVC
2017-09-11 09:26:26 -06:00
Andrew Kelley
c5c9d98065
introduce align keyword
...
* remove `@setGlobalAlign`
* add align keyword for setting alignment on functions and
variables.
* loads and stores use alignment from pointer
* memcpy, memset use alignment from pointer
* add syntax for pointer alignment
* slices can have volatile
* add u2, i2 primitives
* ignore preferred align and use abi align everywhere
* back to only having alignOf builtin.
preferredAlignOf is too tricky to be useful.
See #432 . Partial revert of
e726925e802eddab53cbfd9aacbc5eefe95c356f.
See #37
2017-08-29 07:51:34 -04:00
Andrew Kelley
09bd4a9a86
compile-time f32, f64 operations are now correctly lossy
...
previously we used the bigfloat abstraction to do all
compile-time float math. but runtime code and comptime code
are supposed to get the same result. so now if you add a
f32 to a f32 at compile time it does it with f32 math
instead of the bigfloat. float literals still get the
bigfloat math.
closes #424
2017-08-20 01:04:51 -04:00
Andrew Kelley
35d3444e27
more intuitive left shift and right shift operators
...
Before:
* << is left shift, not allowed to shift 1 bits out
* <<% is left shift, allowed to shift 1 bits out
* >> is right shift, allowed to shift 1 bits out
After:
* << is left shift, allowed to shift 1 bits out
* >> is right shift, allowed to shift 1 bits out
* @shlExact is left shift, not allowed to shift 1 bits out
* @shrExact is right shift, not allowed to shift 1 bits out
Closes #413
2017-08-09 10:09:38 -04:00
Marc Tiehuis
0705b711f8
Correct floating-point literal allowed ranges
...
The exponent range for floating-point values is [-1022, 1023].
Fixes #399 .
2017-08-07 18:08:09 +12:00