This change addresses a critical issue where common variable names in library functions (like 'i', 'n', 'src') were being treated as globals by default, leading to state collisions and unexpected side effects across different files. Changes: - Modified `src/parser.c` to automatically treat new variables assigned within a function body as locals unless they were already declared as globals. - Introduced `sym_find` in the parser to distinguish between finding an existing global and creating a new one. - Reverted `lib/net/cgi.fun` to use standard, short variable names, confirming that they no longer interfere with the caller's scope. - Verified that explicit global updates still work if the variable was already defined at the top-level scope. |
||
|---|---|---|
| .. | ||
| async | ||
| crypt | ||
| encoding | ||
| io | ||
| net | ||
| regex | ||
| test | ||
| utils | ||
| arrays.fun | ||
| cli.fun | ||
| hello.fun | ||
| hex.fun | ||
| math.fun | ||
| README.md | ||
| regex.fun | ||
| strings.fun | ||
README
The Fun standard library.