feat(tools): L10 ludic-fmt enforces a project's style
lint lines in package.ludic - one_statement, max_file_lines, max_function_lines, max_comment_lines, max_header_lines, paths, baseline - checked by ludic-fmt --check <files> and ludic-fmt --lint (the project), at the line; a baseline ratchet lets a rule arrive in a codebase that breaks it (--init-baseline), lowered as it is fixed. check-impl reads the alias declarations too (it had been blind to every namespace L6 moved out of the compiler), and eight methods get their pages; a test holds the formatter to keeping type arguments together (L5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e543525eb7
commit
334469ef61
16 changed files with 635 additions and 2 deletions
26
docs/language/fs/fs-read_bytes.md
Normal file
26
docs/language/fs/fs-read_bytes.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
id: fs-read_bytes
|
||||
name: Fs.read_bytes
|
||||
category: fs
|
||||
kind: namespace-method
|
||||
tokens: Fs.read_bytes
|
||||
sig: Fs.read_bytes(path) -> []byte
|
||||
tip: A whole file as bytes, or null.
|
||||
order: 11
|
||||
ns: Fs
|
||||
member: read_bytes
|
||||
---
|
||||
|
||||
Reads a whole file into a `[]byte` - bounds-checked, so no raw memory - or returns <code>null</code> when it cannot be read. It reads through the asset pack like every other load, so it finds a shipped game's files. Pair it with <code>text_of(b, n)</code> for text.
|
||||
|
||||
Parameters:
|
||||
- `path` — the file to read
|
||||
|
||||
```ludic
|
||||
program Header {
|
||||
entry {
|
||||
let b = Fs.read_bytes("sound.wav")
|
||||
if b != null { print(b[24]) }
|
||||
}
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue