diff options
Diffstat (limited to 'lua/clever_f/domain.lua')
| -rw-r--r-- | lua/clever_f/domain.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lua/clever_f/domain.lua b/lua/clever_f/domain.lua index 6a40092..d7ba040 100644 --- a/lua/clever_f/domain.lua +++ b/lua/clever_f/domain.lua @@ -1169,6 +1169,41 @@ function DotPayload:to_table() } end +local ExplicitRepeatRequest = {} +M.ExplicitRepeatRequest = ExplicitRepeatRequest + +register_type("ExplicitRepeatRequest", ExplicitRepeatRequest, function(data) + return "explicit-repeat:" .. data.descriptor.value +end, function(left, right) + return left.descriptor == right.descriptor and left.target == right.target +end) + +function ExplicitRepeatRequest.new(descriptor, target) + if ExplicitRepeatRequest.is(descriptor) and target == nil then + return descriptor + end + descriptor = Descriptor.from_string(descriptor) + target = require_record(target, "TargetValue", "explicit repeat target") + return new_record("ExplicitRepeatRequest", { + descriptor = descriptor, + effective_descriptor = descriptor, + target = target, + neutral = false, + }) +end + +function ExplicitRepeatRequest.is(value) + return is_record(value, "ExplicitRepeatRequest") +end + +function ExplicitRepeatRequest:to_table() + return { + descriptor = self.descriptor.value, + target = self.target:to_table(), + neutral = self.neutral, + } +end + local ActionOutcome = {} M.ActionOutcome = ActionOutcome |
