Issue warning for empty units during semantic analysis
Empty unit name declaration is valid according to the original implementation in NEURON:
i.e.
UNITS
{
() = (millivolt)
}
is accepted now. Note the empty bracket on the left where there should be a name. Similarly, function declarations like the below are now also accepted:
FUNCTION ssCB(kdf(), kds()) (mM)
{
}
Above behaviour was implemented in #3 in order to pass the fail existing ModelDB files.
When we will have semantic analysis pass for error checking, we can add a check to see if there is an empty unit definition like above and then error / throw exception. This way, parsing will be successful but the semantic analysis will be a "proper" place to do such checking.
Can you give an example here of such files
On top of that it would be useful to have a more detailed description about what empty units are what they are used for
If by empty, you mean no units specified, then that is equivalent to dimensionless, i.e. units syntax of (1).
About empty units in nrn.
The truely empty units () is forbidden because:
Redefinition of units () to: 0.001 m2-kg/sec2-coul
is ignored.
They remain: 1
Error: Units redefinition at line 3 in file a.mod
() = (millivolt)
^
The onespace unit ( ) is accepted once.
Inside function arguments both are accepted.