Mercurial > vim
comparison src/vim9compile.c @ 21504:e87a97868bbc v8.2.1302
patch 8.2.1302: Vim9: varargs arg after optional arg does not work
Commit: https://github.com/vim/vim/commit/01865ade85d2508639e24aaca5948b09fb284a82
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 26 18:33:09 2020 +0200
patch 8.2.1302: Vim9: varargs arg after optional arg does not work
Problem: Vim9: varargs arg after optional arg does not work
Solution: Check for the "..." first. (issue https://github.com/vim/vim/issues/6507)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Jul 2020 18:45:06 +0200 |
parents | 179697662a5a |
children | 81c47a694479 |
comparison
equal
deleted
inserted
replaced
21503:e10b92dd259f | 21504:e87a97868bbc |
---|---|
2104 { | 2104 { |
2105 if (first_optional == -1) | 2105 if (first_optional == -1) |
2106 first_optional = argcount; | 2106 first_optional = argcount; |
2107 ++p; | 2107 ++p; |
2108 } | 2108 } |
2109 else if (STRNCMP(p, "...", 3) == 0) | |
2110 { | |
2111 flags |= TTFLAG_VARARGS; | |
2112 p += 3; | |
2113 } | |
2109 else if (first_optional != -1) | 2114 else if (first_optional != -1) |
2110 { | 2115 { |
2111 emsg(_("E1007: mandatory argument after optional argument")); | 2116 emsg(_("E1007: mandatory argument after optional argument")); |
2112 return &t_any; | 2117 return &t_any; |
2113 } | |
2114 else if (STRNCMP(p, "...", 3) == 0) | |
2115 { | |
2116 flags |= TTFLAG_VARARGS; | |
2117 p += 3; | |
2118 } | 2118 } |
2119 | 2119 |
2120 arg_type[argcount++] = parse_type(&p, type_gap); | 2120 arg_type[argcount++] = parse_type(&p, type_gap); |
2121 | 2121 |
2122 // Nothing comes after "...{type}". | 2122 // Nothing comes after "...{type}". |