Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
line.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2025 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
10/**
11 * @file line.c
12 * @brief Implements the OP_LINE pseudo-opcode to update the current source line.
13 *
14 * This snippet is included into the VM dispatch loop and handles the OP_LINE
15 * instruction. It records the source line number carried in the instruction's
16 * operand so that runtime errors and debugger output can reference the correct
17 * line in the original program.
18 *
19 * Stack contract: none (does not read or write the VM value stack).
20 */
21
22case OP_LINE: {
23 /* operand holds the source line number */
24 vm->current_line = inst.operand;
25 break;
26}
@ OP_LINE
Definition bytecode.h:67