zxul767 / lox

An interpreter for the Lox language
1 stars 0 forks source link

add arity checking to native function calls in `clox` #10

Open zxul767 opened 1 year ago

zxul767 commented 1 year ago

clock(1) should raise a runtime error saying that "expected 0 arguments but got 1"

zxul767 commented 1 year ago

this is already implemented in jlox, but not in clox

zxul767 commented 1 year ago

marked as p1 and not p0 because nothing catastrophic happens if you pass more arguments than expected (although we haven't stressed tested to see if we can overflow the value stack)