ruby: slicc: use default argument value
Review Request #2956 - Created July 10, 2015 and submitted
| Information | |
|---|---|
| Nilay Vaish | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10932:0347c75836a0 --------------------------- ruby: slicc: use default argument value Before this patch, while one could declare / define a function with default argument values, but the actual function call would require one to specify all the arguments. This patch changes the check for function arguments. Now a function call needs to specify arguments that are at least as much as those with default values and at most the total number of arguments taken as input by the function.
Nice! I've run into at least a couple cases where this would have been really useful.
-
src/mem/slicc/symbols/Func.py (Diff revision 1) -
Non-issue: If you don't expect this property to be used outside of the Func class, you could just replace its uses with self.default_count in checkArguments.
