Skip to content

Commit

Permalink
bugfix #64: Compare size of custom action params and collected arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Jun 8, 2024
1 parent b411957 commit 6085812
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions custom_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,19 @@ func handleCustomActionRef(identifier *string) action {
var customAction = customActions[*identifier]

var arguments []actionArgument
advance()
if char != ')' {
var paramsSize = len(customAction.definition.parameters)
if paramsSize > 0 {
advance()
setCurrentAction(*identifier, &customAction.definition)
arguments = collectArguments()

if len(arguments) != paramsSize {
parserError(
fmt.Sprintf("Too few arguments\n\n%s",
generateActionDefinition(parameterDefinition{}, false, false),
),
)
}
}

var customActionCall = makeCustomActionCall(identifier, &arguments)
Expand Down

0 comments on commit 6085812

Please # to comment.