Open sdx6 opened 3 months ago
The filename is used as a prefix for generated identifiers, so it has to be an identifier itself. "Has to be", but invalid characters are replaced with X. A simple fix ix probably to have that replacement include leading numerals.
There is a workaround:
## pragmas.unitname = 'eightball'
local function f()
print 'from 8ball.nelia'
end
f()
This works as it generates eightball_f
instead of 8ball_f
Bug description
i was trying out using Nelua with an 8ball program, and by the end of it named it accordingly,
8ball.nelua
, and it threw this compiler errorCode example
no code for example, compiler issue
Expected behavior
the compilation finishes successfully and runs the code
Workaround
if you were to rename the file to
eightball.nelua
, or something else without a number the compilation will finish successfullyEnvironment
Nelua 0.2.0-dev Build number: 1615 Git date: 2024-04-20 09:45:08 -0300 Git hash: 9f75e009db190feda0f90ae858b48fd82f51b8b1 Semantic version: 0.2.0-dev.1615+9f75e009 Copyright (C) 2019-2024 Eduardo Bart (https://nelua.io/)
Linux
x86_64
gcc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.