aboutsummaryrefslogtreecommitdiff
path: root/std/cstr.zig
AgeCommit message (Collapse)Author
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221
2019-05-26tests passing on linuxAndrew Kelley
2019-05-26clean up references to osAndrew Kelley
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
2018-08-21fix windowsAndrew Kelley
2018-06-18standard library fixesAndrew Kelley
2018-06-04disallow single-item pointer indexingAndrew Kelley
add pointer arithmetic for unknown length pointer
2018-06-02introduce [*] for unknown length pointersAndrew Kelley
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-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-26run zig fmt on some of the codebaseAndrew Kelley
See #1003
2018-02-10std.os and std.io API updateAndrew Kelley
* move std.io.File to std.os.File * add `zig fmt` to self hosted compiler * introduce std.io.BufferedAtomicFile API * introduce std.os.AtomicFile API * add `std.os.default_file_mode` * change FileMode on posix from being a usize to a u32 * add std.os.File.mode to return mode of an open file * std.os.copyFile copies the mode from the source file instead of using the default file mode for the dest file * move `std.os.line_sep` to `std.cstr.line_sep`
2018-02-09std lib: modify allocator idiomAndrew Kelley
Before we accepted a nullable allocator for some stuff like opening files. Now we require an allocator. Use the mem.FixedBufferAllocator pattern if a bound on the amount to allocate is known. This also establishes the pattern that usually an allocator is the first argument to a function (possibly after "self"). fix docs for std.cstr.addNullByte self hosted compiler: * only build docs when explicitly asked to * clean up main * stub out zig fmt
2018-01-31*WIP* error sets converting std libAndrew Kelley
2018-01-25syntax: functions require return type. remove `->`Andrew Kelley
The purpose of this is: * Only one way to do things * Changing a function with void return type to return a possible error becomes a 1 character change, subtly encouraging people to use errors. See #632 Here are some imperfect sed commands for performing this update: remove arrow: ``` sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig") ``` add void: ``` sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig") ``` Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-23replace %defer with errdeferAndrew Kelley
See #632 now we have 1 less sigil
2018-01-07replace `%return` with `try`Andrew Kelley
See #632 better fits the convention of using keywords for control flow
2017-12-26self-hosted: build against zig_llvm and embedded LLDAndrew Kelley
Now the self-hosted compiler re-uses the same C++ code for interfacing with LLVM as the C++ code. It also links against the same LLD library files.
2017-12-23move std/debug.zig to a subdirectoryAndrew Kelley
self hosted compiler parser tests do some fuzz testing
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-10-14implement std.os.symLink for windowsAndrew Kelley
2017-10-14implement std.os.ChildProcess for windowsAndrew Kelley
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-03change while syntaxAndrew Kelley
Old: ``` while (condition; expression) {} ``` New: ``` while (condition) : (expression) {} ``` This is in preparation to allow nullable and error union types as the condition. See #357
2017-04-21zig build system supports building a libraryAndrew Kelley
See #329 Supporting work: * move std.cstr.Buffer0 to std.buffer.Buffer * add build.zig to example/shared_library/ and add an automated test for it * add std.list.List.resizeDown * improve std.os.makePath - no longer recursive - takes into account . and .. * add std.os.path.isAbsolute * add std.os.path.resolve * reimplement std.os.path.dirname - no longer requires an allocator - handles edge cases correctly
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-28rename CBuf to Buffer0 and some minor std API changesAndrew Kelley
2017-01-05pass cannot assign to constant testAndrew Kelley
2016-12-31IR: std makes it to codegenAndrew Kelley
2016-12-31IR: progress toward compiling standard libraryAndrew Kelley
* comptime fn call * is_comptime doesn't count as an instruction dependency * update more std code to latest zig
2016-12-18hello.zig working with all structs anonymousAndrew Kelley
2016-09-28remove compiler directivesAndrew Kelley
* add `setFnTest`, `setFnVisible`, `setFnStaticEval`, `setFnNoInline` builtin functions to replace previous directive functionality * add `coldcc` and `nakedcc` as keywords which can be used as part of a function prototype. * `setDebugSafety` builtin can be used to set debug safety features at a per block scope level. * closes #169
2016-09-26cstr.len and cstr.cmp can run at compile timeAndrew Kelley
closes #140
2016-09-23stack trace is able to figure out compilation unitAndrew Kelley
each address is contained within also fix a bug having to do with codegen for enum value initialization expressions
2016-08-16std: conform to style guidelinesAndrew Kelley
2016-08-11add CBuf to standard libraryAndrew Kelley
and fix ability to take address of variables from other namespaces
2016-07-26unsigned integers for sizes of thingsAndrew Kelley
Closes #62.
2016-05-07std: separate str and cstrAndrew Kelley