Vexu
7b68385d7d
self-hosted: astGenIntegerLiteral support other bases
2020-06-22 23:19:12 -04:00
Vexu
d98aed6eff
self-hosted: generalize astGenBuiltinCall
2020-06-22 23:19:12 -04:00
Andrew Kelley
78c6d39cd4
Merge pull request #5667 from cartr/windows-arguments-unclosed-quote
...
In std.process.ArgIteratorWindows, don't treat unclosed quotes like they're escaped
2020-06-22 20:07:43 -04:00
Jakub Konka
923c0feda1
Add std.fs.File.readAllAlloc tests
...
This commit adds some unit tests for `std.fs.File.readAllAlloc`
function. It also updates the docs of `Reader.readNoEof`
which were outdated, and swaps `inStream()` for `reader()` in
`File.readAllAlloc` with the former being deprecated.
2020-06-22 20:03:21 -04:00
Andrew Kelley
6ff6ac866d
Merge pull request #5666 from kubkon/symlinkat-readlinkat
...
[libstd]: enhance std.os.{symlinkat, readlinkat} coverage
2020-06-22 20:02:27 -04:00
Andrew Kelley
44bd0a2670
Merge pull request #5662 from shtanton/meta-cast
...
Adds std.meta.cast and uses it to simplify translate-c
2020-06-22 19:54:30 -04:00
prime31
65ef74e2cd
try allocation of pointer type when parsing (#5665 )
...
* `try` allocation of pointer type when parsing
* fixes pointer destroy compile error
2020-06-22 17:30:02 +03:00
Carter Sande
7cb41a415a
ArgIteratorWindows: simplify quote state tracking
2020-06-22 03:03:30 -07:00
Carter Sande
8faa85ac19
ArgIteratorWindows: don't treat unclosed quotes like they're escaped
2020-06-22 03:03:20 -07:00
Jakub Konka
c950f0c6c3
Enhance std.os.readlinkat coverage
...
Adds Windows stub (still needs to be implemented on Windows),
adds WASI implementation, adds unit test testing basic chain of
ops: create file -> symlink -> readlink.
2020-06-22 09:40:06 +02:00
Jakub Konka
64078ca924
Enhance std.os.symlinkat coverage
...
Fixes `std.os.symlinkat` compile errors, adds Windows stub (still
needs to be implemented), adds WASI implementation.
2020-06-22 09:14:51 +02:00
Charlie Stanton
8c15cfe3da
Compacts switch statements and string literal
2020-06-21 21:48:12 +01:00
xackus
d907f574e0
stage1: fix concat of sliced str literals
2020-06-21 14:57:12 -04:00
Robin Voetter
8696e52a3d
Make unary minus for unsigned types a compile error ( #5654 )
...
* Make unary minus for unsigned types a compile error
* Add unreachable when generating unsigned negate
2020-06-21 14:55:44 -04:00
Andrew Kelley
126f5702df
Merge pull request #5655 from squeek502/zig-fmt-cli-test
...
Add zig fmt to cli tests
2020-06-21 14:54:58 -04:00
Charlie Stanton
6f47513009
Adds std.meta.cast and uses it to simplify translate-c
2020-06-21 18:24:59 +01:00
Alexandros Naskos
b70c38c33c
Close source file after reading it in zig fmt
2020-06-21 12:22:16 -04:00
Ryan Liptak
399f6b77c4
Add 'no changes' test to zig fmt cli test
2020-06-20 22:21:23 -07:00
Ryan Liptak
b216d8de88
Simplify unformatted code in zig fmt cli test
2020-06-20 22:20:23 -07:00
Ryan Liptak
b5f90244a4
temporary: Add test-cli step for only running cli tests
2020-06-20 22:02:56 -07:00
Ryan Liptak
ca9d8a1337
Add zig fmt test to cli tests for both files and directories
...
Should catch basic `zig fmt` regressions that were previously going uncaught and breaking things
2020-06-20 22:02:55 -07:00
Nameless
56220449ab
Add errors to windows.WSAStartup and WSACleanup
2020-06-21 00:13:06 -04:00
Andrew Kelley
edea7a46e5
Merge branch 'DrDeano-master'
...
closes #5648
2020-06-20 23:06:04 -04:00
Andrew Kelley
faf783e595
implement new stat functionality for WASI
2020-06-20 22:09:47 -04:00
Andrew Kelley
225f196842
std.fs: fix shadowing stat with a local variable
2020-06-20 20:43:56 -04:00
Andrew Kelley
64dfd1883e
zig fmt: avoid unnecessary file system access
...
zig fmt previously would write a temp file, and then either rename it
into place if necessary, or unlink it if nothing was changed. Now zig
fmt renders into a memory buffer, and only writes the temp file and
renames it into place if anything changed.
Based on the performance testing I did this actually did not have much
of an impact, however it's likely that on other operating systems and
other hard drives this could make a big difference.
2020-06-20 20:14:33 -04:00
Andrew Kelley
0a9672fb86
rework zig fmt to avoid unnecessary realpath() calls
...
* add `std.fs.Dir.stat`
* zig fmt checks for sym link loops using inodes instead of using
realpath
2020-06-20 19:46:14 -04:00
Andrew Kelley
da549a72e1
zig fmt
2020-06-20 18:39:15 -04:00
Andrew Kelley
d87cd06296
rework zig fmt to use less syscalls and open fds
...
* `std.fs.Dir.Entry.Kind` is moved to `std.fs.File.Kind`
* `std.fs.File.Stat` gains the `kind` field, so performing a stat() on
a File now tells what kind of file it is. On Windows this only will
distinguish between directories and files.
* rework zig fmt logic so that in the case of opening a file and
discovering it to be a directory, it closes the file descriptor
before re-opening it with O_DIRECTORY, using fewer simultaneous open
file descriptors when walking a directory tree.
* rework zig fmt logic so that it pays attention to the kind of
directory entries, and when it sees a sub-directory it attempts to
open it as a directory rather than a file, reducing the number of
open() syscalls when walking a directory tree.
2020-06-20 18:27:37 -04:00
DrDeano
bc0ca73887
Moved the check for formatting a directory
...
The original check for a directory was for the `readAllAlloc` so move the check from open to read. This in turn fixes the fmt step in the build script for directories.
2020-06-20 17:25:12 -04:00
data-man
5229f6ec68
Use writer in std.fmt
2020-06-20 18:23:57 +00:00
Veikka Tuominen
aa894cea2c
Merge pull request #5645 from Sobeston/patch-7
...
langref - document that This works on enums too
2020-06-20 11:34:07 +00:00
Sebastian
8527718350
langref - document that This works on enums too
2020-06-20 12:16:57 +01:00
Eleanor NB
605769ec25
Replaced all occurrences of std.debug.warn in the docs with std.debug.print
2020-06-19 19:03:37 -04:00
Haze Booth
237c5429b0
Don't attempt to use io from thin air
2020-06-19 02:06:27 -04:00
Andrew Kelley
c9a0ec25e0
self-hosted: add Tracy integration
...
This tool helps give an intuitive picture of performance. This will help
us understand where to improve the code.
2020-06-18 21:55:37 -04:00
Andrew Kelley
0d18eda1d6
Merge pull request #5348 from ifreund/std-log
...
Introduce std.log
2020-06-18 21:40:06 -04:00
Andrew Kelley
c70633eacd
Merge pull request #5203 from tadeokondrak/@type-for-even-more-types
...
implement @typeInfo for Frame and implement @Type for Frame, EnumLiteral, and ErrorSet
2020-06-18 21:25:03 -04:00
Andrew Kelley
b9e3df92db
Merge branch 'deingithub-fmt-mode-thingybob'
...
closes #5617
closes #5616
2020-06-18 21:09:32 -04:00
Andrew Kelley
f7bcc8e040
rework zig fmt to only make one allocation
...
taking advantage of the fstat size
2020-06-18 21:08:30 -04:00
Cassidy Dingenskirchen
8b49487c33
Fix fs.File.mode() not returning mode_t on windows
2020-06-18 20:41:40 -04:00
Cassidy Dingenskirchen
b30642a86a
Fix zig fmt clobbering a file's mode
2020-06-18 20:41:40 -04:00
Michael Rees
bd17a373cc
Add std.unicode.Utf8Iterator.peek
2020-06-18 20:35:03 -04:00
Andrew Kelley
5ea0f589c9
Merge pull request #5625 from antlilja/master
...
Improve support for f128 and comptime_float operations
2020-06-18 20:32:43 -04:00
Vexu
caaa26c9f0
reference emit_raw in std lib tests
2020-06-18 20:17:53 -04:00
Andrew Kelley
355319fb67
zig cc: add missing cxxabi include path
2020-06-18 18:17:26 -04:00
Andrew Kelley
7e44302260
stage2: explicit hash and equality function for the DeclTable
2020-06-18 17:12:56 -04:00
Andrew Kelley
81f766eecd
self-hosted parser: make a function pointer comptime
2020-06-18 17:12:56 -04:00
Andrew Kelley
46b57748a5
stage1: stop emitting memset to undefined when safety is off
2020-06-18 17:12:56 -04:00
Andrew Kelley
02f688d710
remove std.debug.warn debugging logs
2020-06-18 17:12:56 -04:00