Skip to content

Commit

Permalink
fix: remove opening bracket for the second arguments prefix in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tauslim committed Mar 8, 2024
1 parent 4aea0e5 commit 0381d2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,13 @@ func parseFuncArgs(tb []TokenString) (args []interface{}, err error) {
argTokens = append(argTokens, tb)
} else {
lastIndex := 0
for _, i := range commaIdxs {
subTs := tb[lastIndex:i]
if len(subTs) > 0 && subTs[0].t == OpeningSquareBracket {
for i, commaIdx := range commaIdxs {
subTs := tb[lastIndex:commaIdx]
if i == 1 && len(subTs) > 0 && subTs[0].t == OpeningSquareBracket {
subTs = subTs[1:]
}
argTokens = append(argTokens, subTs)
lastIndex = i + 1
lastIndex = commaIdx + 1
}
subTs := tb[lastIndex:]
if len(subTs) > 0 && subTs[len(subTs)-1].t == ClosingSquareBracket {
Expand Down

0 comments on commit 0381d2f

Please sign in to comment.