Roger Browne wrote:

Wow, it really does work. Thanks! Although it misses the case where the
called sub has zero .params:

   .sub 'main' :main
      errorson 0x0C
      foo(5)
   .end
   .sub foo
      print "Not OK\n"
   .end

Yep. There is currently just one reason for that and it's in your code too :-)

  .sub main :main
     .param pmc argv  # implicitely very :optional

That is, if no '.param' is present, currently no get_params is emitted alas no error checking and no exception.

This could be fixed by special-casing the initial call to ':main', and then turn on param count checks if wanted. I'll have a look at it tomorrow, if no one beats me.

Regards,
Roger Browne

leo

Reply via email to