diff options
| author | 2026-10-14 16:25:05 +0330 | |
|---|---|---|
| committer | 2026-10-14 16:25:05 +0330 | |
| commit | 8a7092df7b7fc8a5eb4f02ef14588246bd111daf (patch) | |
| tree | 0d9d28ca93ccbddb1f99cb02b88ed466e0ade481 /src/lsp/server.zc | |
| parent | history: 43-stdlib notes point forward to zc0 no longer reserving u, m and d (diff) | |
| parent | merge bounds checking (diff) | |
Merge branch 'main' into work/xref
Diffstat (limited to 'src/lsp/server.zc')
| -rw-r--r-- | src/lsp/server.zc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lsp/server.zc b/src/lsp/server.zc index c3f9f4f..52e5e9a 100644 --- a/src/lsp/server.zc +++ b/src/lsp/server.zc @@ -1,6 +1,9 @@ namespace lsp; include rt, run; +// the server pokes at headers and raw memory on purpose and runs at full speed: no index bounds checks +unbounded; + // ============================================================================ // server.zc: the language server. it is appended to the genome after the // compiler (the files of src/compiler/parts in order, then this one, read as one stream), so it does not @@ -388,7 +391,7 @@ int isopc(int c) { // is the name n one of the words the highlighter shows as keywords even when the // compiler has no record for it. int iskeyword(int n) { - return n == run.s_fn || n == run.s_var || n == run.s_const || n == run.s_else || n == run.s_as || n == run.s_unchecked || n == run.s_immediate + return n == run.s_fn || n == run.s_var || n == run.s_const || n == run.s_else || n == run.s_as || n == run.s_unchecked || n == run.s_unbounded || n == run.s_immediate || n == run.s_case || n == run.s_default || n == run.s_do || n == run.s_while || n == run.s_enum || n == run.s_include || n == run.s_memdebug || n == run.s_enhance || n == run.s_micro || n == run.s_vm || n == run.s_struct || n == run.s_type || n == run.s_typedef || n == run.s_typecheck || n == run.s_static; } @@ -1680,6 +1683,7 @@ char* kwtext() { if (hname_is("const")) return "const [type] NAME = e / const fixed T[N] name~declares a compile-time constant or read-only storage. fixed and const may appear in either order; read-only storage cannot be modified or converted to a mutable reference."; if (hname_is("else")) return "else~the other branch of an if. after an enhance's body, else names the fallback function that runs where the enhancement can't."; if (hname_is("as")) return "e as T~changes the type of an expression without changing its bits."; + if (hname_is("unbounded")) return "unbounded fn f() { } / unbounded { } / unbounded;~turns index bounds checks off for a function, a block, a statement, or the rest of the unit. o3 code is unbounded too."; if (hname_is("unchecked")) return "unchecked fn f() { } / unchecked { } / unchecked;~turns the lifetime analyzer off for a function, a block, or the rest of the unit. the code is not checked, so the analyzer's rules don't apply to it."; if (hname_is("immediate")) return "immediate fn name() { }~a parse word. it runs during compilation whenever its name shows up as a statement, inside an expression or at the top level."; if (hname_is("case")) return "case v:~a label in a switch. each case ends where the next one begins, so cases don't fall through."; |
