(allow_calls)
| 990 | }; |
| 991 | |
| 992 | function expr_atom(allow_calls) { |
| 993 | if (is("operator", "new")) { |
| 994 | next(); |
| 995 | return new_(); |
| 996 | } |
| 997 | if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { |
| 998 | return make_unary("unary-prefix", |
| 999 | prog1(S.token.value, next), |
| 1000 | expr_atom(allow_calls)); |
| 1001 | } |
| 1002 | if (is("punc")) { |
| 1003 | switch (S.token.value) { |
| 1004 | case "(": |
| 1005 | next(); |
| 1006 | return subscripts(prog1(expression, curry(expect, ")")), allow_calls); |
| 1007 | case "[": |
| 1008 | next(); |
| 1009 | return subscripts(array_(), allow_calls); |
| 1010 | case "{": |
| 1011 | next(); |
| 1012 | return subscripts(object_(), allow_calls); |
| 1013 | } |
| 1014 | unexpected(); |
| 1015 | } |
| 1016 | if (is("keyword", "function")) { |
| 1017 | next(); |
| 1018 | return subscripts(function_(false), allow_calls); |
| 1019 | } |
| 1020 | if (HOP(ATOMIC_START_TOKEN, S.token.type)) { |
| 1021 | var atom = S.token.type == "regexp" |
| 1022 | ? as("regexp", S.token.value[0], S.token.value[1]) |
| 1023 | : as(S.token.type, S.token.value); |
| 1024 | return subscripts(prog1(atom, next), allow_calls); |
| 1025 | } |
| 1026 | unexpected(); |
| 1027 | }; |
| 1028 | |
| 1029 | function expr_list(closing, allow_trailing_comma, allow_empty) { |
| 1030 | var first = true, a = []; |
no test coverage detected
searching dependent graphs…