Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 23a654c

Browse files
committed
🐛 Only allow one spread
1 parent e193c21 commit 23a654c

File tree

1 file changed

+44
-40
lines changed

1 file changed

+44
-40
lines changed

grammars/javascript.cson

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,30 +1948,32 @@
19481948
\\s*
19491949
(?:
19501950
(?:
1951-
\\? | # {function(?string)} nullable type
1952-
! | # {function(!string)} non-nullable type
1953-
)?
1954-
[a-zA-Z_$][\\w$]+
1955-
(?:\\[\\])? # {function(string[])} type application, an array of strings
1956-
(?:
1957-
\\s*,\\s*
19581951
(?:
1952+
\\? | # {function(?string)} nullable type
1953+
! # {function(!string)} non-nullable type
1954+
)?
1955+
[a-zA-Z_$][\\w$]+
1956+
(?:\\[\\])? # {function(string[])} type application, an array of strings
1957+
(?:
1958+
\\s*,\\s*
19591959
(?:
19601960
(?:
1961-
\\? | # {function(string, ?string)} nullable type
1962-
! | # {function(string, !string)} non-nullable type
1963-
)?
1964-
[a-zA-Z_$][\\w$]+
1965-
(?:\\[\\])? # {function(string[])} type application, an array of strings
1961+
(?:
1962+
\\? | # {function(string, ?string)} nullable type
1963+
! # {function(string, !string)} non-nullable type
1964+
)?
1965+
[a-zA-Z_$][\\w$]+
1966+
(?:\\[\\])? # {function(string[])} type application, an array of strings
1967+
)
19661968
)
1967-
|
1968-
(?:
1969-
\\.{3}[a-zA-Z_$][\\w$]+ # {function(string, ...string)} variable number of parameters
1970-
)
1971-
)
1972-
)*
1973-
=? # {function(string=)} optional parameter
1974-
)*
1969+
)*
1970+
=? # {function(string=)} optional parameter
1971+
)+
1972+
(?:
1973+
\\s*,\\s*
1974+
\\.{3}[a-zA-Z_$][\\w$]+ # {function(string, ...string)} variable number of parameters
1975+
)?
1976+
)?
19751977
\\s*
19761978
\\)
19771979
)
@@ -2101,30 +2103,32 @@
21012103
\\s*
21022104
(?:
21032105
(?:
2104-
\\? | # {function(?string)} nullable type
2105-
! | # {function(!string)} non-nullable type
2106-
)?
2107-
[a-zA-Z_$][\\w$]+
2108-
(?:\\[\\])? # {function(string[])} type application, an array of strings
2109-
(?:
2110-
\\s*,\\s*
21112106
(?:
2107+
\\? | # {function(?string)} nullable type
2108+
! # {function(!string)} non-nullable type
2109+
)?
2110+
[a-zA-Z_$][\\w$]+
2111+
(?:\\[\\])? # {function(string[])} type application, an array of strings
2112+
(?:
2113+
\\s*,\\s*
21122114
(?:
21132115
(?:
2114-
\\? | # {function(string, ?string)} nullable type
2115-
! | # {function(string, !string)} non-nullable type
2116-
)?
2117-
[a-zA-Z_$][\\w$]+
2118-
(?:\\[\\])? # {function(string[])} type application, an array of strings
2116+
(?:
2117+
\\? | # {function(string, ?string)} nullable type
2118+
! # {function(string, !string)} non-nullable type
2119+
)?
2120+
[a-zA-Z_$][\\w$]+
2121+
(?:\\[\\])? # {function(string[])} type application, an array of strings
2122+
)
21192123
)
2120-
|
2121-
(?:
2122-
\\.{3}[a-zA-Z_$][\\w$]+ # {function(string, ...string)} variable number of parameters
2123-
)
2124-
)
2125-
)*
2126-
=? # {function(string=)} optional parameter
2127-
)*
2124+
)*
2125+
=? # {function(string=)} optional parameter
2126+
)+
2127+
(?:
2128+
\\s*,\\s*
2129+
\\.{3}[a-zA-Z_$][\\w$]+ # {function(string, ...string)} variable number of parameters
2130+
)?
2131+
)?
21282132
\\s*
21292133
\\)
21302134
)

0 commit comments

Comments
 (0)