1954 Commits

Author SHA1 Message Date
Andrew Kelley
81a01bd481 fix codegen of sentinel-terminated arrays and .got alignment
we now have an exit(0) program working
2020-05-14 16:34:04 -04:00
Andrew Kelley
0986dcf1cf self-hosted: fix codegen and resolve some analysis bugs 2020-05-14 13:20:27 -04:00
Vexu
c77fee0344
fix infinite loop
findToken wasn't as generic as I thought it was
2020-05-14 19:56:55 +03:00
Vexu
c4552ee8ed
store rparen in ReturnType.Invalid
This is useful for getting a partial function signature
2020-05-14 17:18:14 +03:00
Vexu
a32e240540
improve recovery from invalid container members
Instead of trying to find the end of the block or the next comma/semicolon
we no try to find the next token that can start a container member.
2020-05-14 12:09:40 +03:00
Vexu
89f2923a8a
recover from missing semicolon 2020-05-14 11:19:50 +03:00
Vexu
ac319b2734
remove useless nosuspend parsing
nosuspend cannot be used in a type expression and
all other use casesare covered by PrimaryExpr
2020-05-14 11:19:14 +03:00
Andrew Kelley
6a2425c38c self-hosted: fix the rest of the compile errors 2020-05-13 22:12:38 -04:00
Andrew Kelley
080022f6c6 self-hosted: fix compile errors, except for codegen.zig 2020-05-13 20:06:01 -04:00
Vexu
c3b76d0913
recover from invalid builtin/async call 2020-05-14 00:16:56 +03:00
Vexu
1f81887a78
recover after invalid inline/extern 2020-05-13 23:35:58 +03:00
Vexu
ad71d959d7
correctly recover from invalid top level declarations 2020-05-13 23:28:04 +03:00
Vexu
2296906e2a
modernize std.zig.tokenizer 2020-05-13 23:08:42 +03:00
Vexu
23c5ff94e9
improve recovery on top level declarations 2020-05-13 20:42:18 +03:00
Vexu
118db892be
Merge pull request #5321 from gpanders/ascii-case-sensitive
Add helper functions and docstrings to ascii.zig
2020-05-13 19:04:53 +03:00
Vexu
76681e6b96
Make PriorityQueue.Iterator public
The `iterator` function was already public but these seem to have been forgotten.
2020-05-13 18:38:03 +03:00
DrDeano
2589f7207b
Make StackIterator next public 2020-05-13 16:21:15 +01:00
Vexu
cefc04348e
continue parsing on invalid and token 2020-05-13 17:36:06 +03:00
Vexu
be392777b7
continue parsing after missing commas and invalid statements 2020-05-13 17:21:27 +03:00
Vexu
91358f3092
continue parsing on extra qualifier errors 2020-05-13 16:51:23 +03:00
Jason Merrill
706311cad9
Fix comment typo RFC8529 -> RFC8259
Ref: https://tools.ietf.org/html/rfc8259
2020-05-12 19:11:05 -07:00
Vexu
df22c7dfef
std.zig attempt to continue parsing on error 2020-05-12 22:37:39 +03:00
Vexu
fa57463bb9
make parser testError take a list of expected errors 2020-05-12 21:44:08 +03:00
Vexu
80d0c2f166
Merge pull request #5118 from xackus/fix-json-writestream
fix json.WriteStream.emitJson
2020-05-12 17:44:06 +03:00
Greg Anders
c6420820b0 Remove redundant ASCII functions
The `matchCase` variants are simply duplicates of the `eql` and
`indexOf` functions found in std.mem.
2020-05-12 08:38:15 -06:00
Vexu
08e2e690d7
Merge pull request #5275 from strangebug/docs-markdown-links
Add support for external links and URL to markdown parser.
2020-05-12 15:35:50 +03:00
Vexu
b1ebaba408
std.json properly handle comptime int/float 2020-05-12 15:15:21 +03:00
Andrew Kelley
619159cf48 self-hosted: rework the memory layout of ir.Module and related types
* add TypedValue.Managed which represents a Type, a Value, and some
   kind of memory management strategy.
 * introduce an analysis queue
 * flesh out how incremental compilation works with respect to exports
 * ir.text.Module is only capable of one error message during parsing
 * link.zig no longer has a decl table map and instead has structs that
   exist directly on ir.Module.Decl and ir.Module.Export
 * implement primitive .text block allocation
 * implement linker code for updating Decls and Exports
 * implement null Type

Some supporting std lib changes:
 * add std.ArrayList.appendSliceAssumeCapacity
 * add std.fs.File.copyRange and copyRangeAll
 * fix std.HashMap having modification safety on in ReleaseSmall builds
 * add std.HashMap.putAssumeCapacityNoClobber
2020-05-12 01:02:48 -04:00
Greg Anders
9f496c0777 Add helper functions and docstrings to ascii.zig
* Add an upper case variant of `allocLowerString`
  * Add case-sensitive variants of `eqlIgnoreCase`, `indexOfIgnoreCase`,
    and `indexOfIgnoreCasePos`
  * Add and update docstrings on functions
2020-05-11 19:36:41 -06:00
Jonathan Marler
832f6c1228 make Address.getOsSockLen pub 2020-05-11 09:11:05 -06:00
Andrew Kelley
a32d3a85d2 rework self-hosted compiler for incremental builds
* introduce std.ArrayListUnmanaged for when you have the allocator
   stored elsewhere
 * move std.heap.ArenaAllocator implementation to its own file. extract
   the main state into std.heap.ArenaAllocator.State, which can be
   stored as an alternative to storing the entire ArenaAllocator, saving
   24 bytes per ArenaAllocator on 64 bit targets.
 * std.LinkedList.Node pointer field now defaults to being null
   initialized.
 * Rework self-hosted compiler Package API
 * Delete almost all the bitrotted self-hosted compiler code. The only bit
   rotted code left is in main.zig and compilation.zig
 * Add call instruction to ZIR
 * self-hosted compiler ir API and link API are reworked to support
   a long-running compiler that incrementally updates declarations
 * Introduce the concept of scopes to ZIR semantic analysis
 * ZIR text format supports referencing named decls that are declared
   later in the file
 * Figure out how memory management works for the long-running compiler
   and incremental compilation. The main roots are top level
   declarations. There is a table of decls. The key is a cryptographic
   hash of the fully qualified decl name. Each decl has an arena
   allocator where all of the memory related to that decl is stored.
   Each code block has its own arena allocator for the lifetime of
   the block. Values that want to survive when going out of scope in
   a block must get copied into the outer block. Finally, values must
   get copied into the Decl arena to be long-lived.
 * Delete the unused MemoryCell struct. Instead, comptime pointers are
   based on references to Decl structs.
 * Figure out how caching works. Each Decl will store a set of other
   Decls which must be recompiled when it changes.

This branch is still work-in-progress; this commit breaks the build.
2020-05-10 02:05:54 -04:00
Haze Booth
e79d7e0ded Remove fs.File artifact from connectUnixSocket 2020-05-09 12:29:27 -04:00
Vexu
d4d509090b
make std.build.getInstallPath public
Closes  #5299
2020-05-09 00:31:11 +03:00
Vexu
453df1cc1e
Merge pull request #4892 from Sobeston/patch-4
mem.zeroes - add sentinel terminated array support
2020-05-08 22:37:27 +03:00
Vexu
336ddb5b76
std: add test for mem.zeroes on sentinel terminated arrays 2020-05-08 19:03:27 +03:00
Vexu
f2d3266075
Merge pull request #4932 from Qix-/fix-private-access
Fix private access
2020-05-08 18:21:15 +03:00
daurnimator
45f7c78bfc
std: fix RTLD_ constants on OSX 2020-05-08 22:34:18 +10:00
Vexu
10abffcd98
fix more private member access 2020-05-08 15:10:38 +03:00
Josh Junon
b6dc7fc9ff
publicize member functions affected by #4909 2020-05-08 14:26:28 +03:00
Loris Cro
35a59b5b0f remove readable check when opening a socket connection 2020-05-07 13:41:17 -04:00
Loris Cro
7e8b859095 fix oneshot flag erroneusly set as filter_flag 2020-05-07 13:41:17 -04:00
Loris Cro
a78ac96134 fix crash in single-threaded builds 2020-05-07 13:41:02 -04:00
Andrew Kelley
ba43492c0e
Merge pull request #5268 from tadeokondrak/remove-callconv-redundant-syntax
Remove syntax redundant with callconv
2020-05-07 12:42:26 -04:00
Jens Goldberg
20c1696865 Removed GetModuleHandleA from user32
GetModuleHandleA is an kernel32 function and already defined there, it doesn't belong in user32.
2020-05-07 12:38:46 -04:00
Jens Goldberg
25810bc1e6 Removed duplicate WM_ACTIVATE 2020-05-07 12:38:46 -04:00
Jonathan Marler
0a76e11617 add failAllocator to enable some regression tests 2020-05-06 23:56:48 -06:00
Jonathan Marler
0c7397b49f fix copy/paste error in AllocWithOptionaPayload 2020-05-06 23:08:08 -06:00
Timon Kruiper
b336dda076 Standard library: Fix a regression in loop.waitUntilFdWritableOrReadable
This broke async io on linux.
Regressed in 8ebcca6734e07aea29098ca4c63c0216b3099d0e
2020-05-06 13:14:06 -04:00
data-man
3c4abacba6 Optimization of vectors hashing 2020-05-06 17:08:49 +05:00
Vexu
0e30edd8d0
std: handle ConnectionTimedOut in switch
regression from #5266
closes #5270
2020-05-06 12:52:26 +03:00