doc clarification, add makefile

master
Ondřej Hruška 2 weeks ago
parent 23a55e5258
commit cd213e525b
  1. 4
      Makefile
  2. 3
      docs/require.md
  3. 3
      src/stdlib/require.rs

@ -0,0 +1,4 @@
.PHONY: make
make:
cargo build --release

@ -17,8 +17,7 @@ A name is one or more dot-separated segments; each segment may contain
`A–Z a–z 0–9 _ -`. Dots map to directory separators, so `require "db.migrations"`
looks for `db/migrations.lua`. Paths (`/`, `..`), absolute names, and empty
segments are rejected — a module can only ever be loaded from inside the
search roots, which keeps `require` compatible with the sandbox: it is the
only file access scripts have.
search roots.
## Search roots

@ -5,8 +5,7 @@
//! directory (the CWD in the REPL) followed by the entries of
//! `$A_INCLUDE_PATHS` — through the standard `?.lua` / `?/init.lua` templates.
//! Because a name may only contain identifier-like segments, a module can
//! never name a file outside the roots; `require` is the sandbox's only file
//! access.
//! never name a file outside the roots.
//!
//! Each file is executed once and its return value cached by canonical path,
//! so repeated requires — even under different names or through symlinks —

Loading…
Cancel
Save