aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/decl.zc
Commit message (Collapse)AuthorAgeFilesLines
* merge work/demo-fixes: analyzer ownership fixes (back links, loop-built ↵Gravatar zinc 12 days1-1/+42
|\ | | | | | | lists, .u inference), Io.print any args, block-end borrow messages
| * prescan: guess an owned return only from a local declared from new/heap, not ↵Gravatar zinc 12 days1-2/+6
| | | | | | | | a global assigned one (fixes lsp self-check); xref baseline for the new writers
| * analyzer: a .u (declared or inferred) function can't return a borrowed ↵Gravatar zinc 12 days1-1/+1
| | | | | | | | parameter or a value derived from one; fixtures
| * analyzer: infer .u from returns of fresh objects in the body (prescan guess, ↵Gravatar zinc 12 days1-0/+37
| | | | | | | | then checked as .u)
* | hold: copy hold.h with micro.c everywhere; xref baseline for hold globals; ↵Gravatar zinc 12 days1-1/+1
| | | | | | | | lsp keyword completion yields to a same-named symbol; compiler message avoids the word actor
* | hold blocks: top-level hold { shared let ...; fn ... } monitors; shared ↵Gravatar zinc 12 days1-1/+55
|/ | | | values kept by the host and copied in/out at the outermost call, reentrant per-block locks in declaration order (core, micro)
* analyzer: check borrow returns of forward-called functions at the unit's ↵Gravatar zinc 13 days1-0/+17
| | | | end; borrows clause for prototypes, definitions, externs and function types, checked against the body
* fndef: b.2.13 unnamed prototype parameters in fewer ops (402197 -> 402112 ↵Gravatar zinc 13 days1-9/+8
| | | | words, same behaviour)
* bounds: body scan, loop-entry hoisting, pointer proofs from requested size, ↵Gravatar zinc 13 days1-1/+2
| | | | --explain-checks v1 (non-o3 code)
* prototypes: parameters may be unnamed, int f(int, int*); (appendix b.2.13)Gravatar zinc 13 days1-2/+11
|
* globals: an integer constant initializing a float or f32 global converts to ↵Gravatar zinc 13 days1-1/+2
| | | | float (float g = 2; is 2.0)
* Merge branch 'main' into work/specGravatar zinc 13 days1-13/+21
|\
| * merge bounds checkingGravatar zinc 13 days1-13/+21
| |\
| | * bounds checking: port agent/bounds-checking onto main 0879d0a; unbounded ↵Gravatar zinc 13 days1-13/+21
| | | | | | | | | | | | main in o3call, o3 tests expect no check, boundsrules, bounds_fixed, bounds_heap and zc0unbounded tests
* | | globals: a float or f32 global takes a float literal initializer (appendix ↵Gravatar zinc 13 days1-0/+3
| | | | | | | | | | | | b.2.7)
* | | fndef: a prototype after a definition in the same module keeps the ↵Gravatar zinc 13 days1-4/+5
| | | | | | | | | | | | definition (appendix b.2.4)
* | | fndef: a second definition of a function in the same module is 'is defined ↵Gravatar zinc 13 days1-0/+4
|/ / | | | | | | twice' (appendix b.2.3)
* | merge: seven self-hosted compiler fixes from conformanceGravatar zinc 13 days1-1/+1
|\ \ | |/ |/|
| * fndef: allow 24 parameters; the limit check ran after the 24th was countedGravatar zinc 13 days1-1/+1
| |
* | line tables and backtraces: port agent/line-tables onto main, op 56 on the ↵Gravatar zinc 13 days1-3/+10
|/ | | | x86-64 jit, docs, measurements, tests; default genome reservation 0x68000
* zc: add the defer statementGravatar zinc 13 days1-2/+6
| | | | | | | | | | | | defer expr; and defer { ... } register code that runs when the enclosing block ends: at the end of the block, and at return, break and continue that leave it. the tokens are kept at the defer and compiled again at each exit (block_close, body, kw_return, kw_break, kw_continue), newest first, before the block's variables are released, so the analyzer sees a deferred rt.free(p) as the transfer of p where it runs. names mean what they meant at the defer; values are read when it runs. return, break and continue inside a deferred statement are errors, reported once. works in unchecked code and closures (own base per function context).
* split compiler.zc into files by phaseGravatar zinc 13 days1-0/+1413
src/compiler/compiler.zc is now twelve files under src/compiler/, listed in order in src/compiler/parts. cat of the parts in order is byte-identical to the old file, so every compiler and image except the language server's is unchanged. no function was edited. consumers read the list: the makefile, bootstrap-check, genmap (which still writes one compiler.zc into a generated map directory), tinyvm.bat, test.sh, test_win.ps1 and the lsp drivers. the language server embeds each part and serves them joined as the one document tinyvm:/compiler.zc.