From 96cf47a308d6003571873b0871749c3cf503e6ab Mon Sep 17 00:00:00 2001 From: DaRubyMiner360 Date: Thu, 28 Apr 2022 13:43:10 -0400 Subject: [PATCH] Fixed timedelta. --- interpreter/interpreter.py | 2 +- std/types/timedelta.para | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interpreter/interpreter.py b/interpreter/interpreter.py index 0b5d8e8..3a6789d 100644 --- a/interpreter/interpreter.py +++ b/interpreter/interpreter.py @@ -449,7 +449,7 @@ def visit_Call(self, node): given_arg_count = len(collected_args) original_given_arg_count = given_arg_count - if isinstance(target.argument_list.arguments[-1], NodeSplatArgument): + if len(target.argument_list.arguments) > 0 and isinstance(target.argument_list.arguments[-1], NodeSplatArgument): if given_arg_count > 0: new_collected_args = [] for i in range(0, given_arg_count): diff --git a/std/types/timedelta.para b/std/types/timedelta.para index 108e583..6bc93ec 100644 --- a/std/types/timedelta.para +++ b/std/types/timedelta.para @@ -15,7 +15,7 @@ let TimeDelta = Type.extend({ max resolution - func __construct__(self, _weeks, _days, _hours, _minutes, _seconds, _milliseconds, _microseconds) { + func __construct__(self, _weeks = 0, _days = 0, _hours = 0, _minutes = 0, _seconds = 0, _milliseconds = 0, _microseconds = 0) { if _weeks != null && _weeks > 0 { self.days += __intern_to_int__(_weeks) * 7; }