[Feature] Make declarations of function to be POSIX compliant
Is your feature request related to a problem? Please describe. Currently functions generated by Amber are only bash compliant. Let's use the POSIX syntax for declaring functions.
Describe the solution you'd like Change from:
function foo() {
# ...
}
to:
foo() {
# ...
}
Describe alternatives you've considered N/A
Additional context
This problem is related to the milestone to support sh
If we implement this we need to add also a flag to Amber to define the bash version to support
@Mte90 the POSIX version is supported by Bash and SH. Migrating to the POSIX version will not affect the existing bash compatibility
I was trying to understand where in the code write function to remove it but I don't find it https://github.com/amber-lang/amber/blob/042ca2aa6851e0439eb737eeadfd5d48d3f34751/src/modules/function/invocation.rs#L37
@Mte90 it's right here: https://github.com/amber-lang/amber/blob/2e34e15da2654f57ef17ecef4342b01f1e3ea0b6/src/modules/function/declaration.rs#L257