nmodl icon indicating copy to clipboard operation
nmodl copied to clipboard

Fix recursive FUNCTION calls

Open JCGoran opened this issue 1 year ago • 2 comments

The following mod file does not compile under both NEURON and coreNEURON codegen:

NEURON {
    SUFFIX recursion
}
FUNCTION f(n) {
    f = f(n)
}

Some more examples are added in recursion.mod, which should cover all of the cases of interest (note that only some of them are tested for correctness since the convoluted ones don't have a terminating condition, but they should all at least compile).

JCGoran avatar May 24 '24 15:05 JCGoran

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.25%. Comparing base (0edbed9) to head (c54a85c). Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1278      +/-   ##
==========================================
- Coverage   86.29%   86.25%   -0.05%     
==========================================
  Files         178      178              
  Lines       13267    13277      +10     
==========================================
+ Hits        11449    11452       +3     
- Misses       1818     1825       +7     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 24 '24 16:05 codecov[bot]

Nice, what's the purpose of testing both fib and factorial? How do they differ and enhance eachother?

1uc avatar May 27 '24 06:05 1uc