Open jrfondren opened 10 months ago
Can you provide a full demo to check it on my side? I have tested the code excerpt you shared and could not reproduce the behavior you shared above.
My bad; I forgot to run the script with 001-example
included.
Indeed it would be handy to create something like first-character-breadcrumb appended to script's parent directory; in my case, /home/stefanos/nelua/various/
could become hsnv
that could get appended to 001-example
.
In other words, it should become hsnv_001_example_f_f(void)
.
Update as of 16-11-2023: Coincidentally, I have discovered by accident that Crystal language creates a caching directory for improving re-building compilation speeds inside $HOME/.cache/
, much like Nelua does, but with the following format: home-stefanos-code-crystal-hello_world.cr/
; this is my $HOME/stefanos/code/crystal/
directory with filename hello_world.cr
.
This type of format could also be used to avoid the aforementioned buggy behavior while maintaining readability for developers that want to investigate the generate C code and know which file came from where exactly.
Code example
When compiled in a directory named '001-example', an invalid unitname is generated:
Expected behavior
I expected a unitname like XXX_example, as is done with non-Latin characters.
Workaround
Files can set an explicit unitname with
Environment
x86_64 linux Nelua 0.2.0-dev Build number: 1605 Git date: 2023-11-05 16:12:59 -0300 Git hash: decf713ca4bfd99b7bb9ae3c5f66b87761fd8621 Semantic version: 0.2.0-dev.1605+decf713c Copyright (C) 2019-2023 Eduardo Bart (https://nelua.io/)