From 012c8a0e16d1efa7b4ee5ec3ff3b5457e60bfd2d Mon Sep 17 00:00:00 2001 From: allexanderbergmns Date: Tue, 25 Aug 2026 14:47:59 +0200 Subject: [PATCH] Executable vrmm --- README.MD | 25 +++++++++++++++++++++++++ compiler/lexer.v | 10 +++++++++- examples/build.vrmm | 2 ++ main.v | 17 +++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) mode change 100644 => 100755 examples/build.vrmm diff --git a/README.MD b/README.MD index abd0430..6146072 100644 --- a/README.MD +++ b/README.MD @@ -106,6 +106,31 @@ A target that returns a nonzero integer, calls `exit(n)` with `n > 0`, or `throw`s fails the build. Paths are relative to the working directory; `build_root()` returns the module's own directory for absolute paths. +### Running build modules as scripts + +A `.vrmm` (or `.vr`) file may start with a shebang line so it can be executed +directly like any script — the toolchain skips the shebang when compiling, so +error line numbers stay aligned with the file: + +``` +#!/usr/bin/env vr +fn main() { + build_compile("main.vr", "main.vobj") + build_link(["main.vobj"], "main.vbin") +} +``` + +```bash +chmod +x build.vrmm +./build.vrmm # equivalent to: vr make +./build.vrmm clean # run the clean() target +./build.vrmm deploy --prod +``` + +The kernel invokes `vr