| 1087 | }; |
| 1088 | |
| 1089 | function subscripts(expr, allow_calls) { |
| 1090 | if (is("punc", ".")) { |
| 1091 | next(); |
| 1092 | return subscripts(as("dot", expr, as_name()), allow_calls); |
| 1093 | } |
| 1094 | if (is("punc", "[")) { |
| 1095 | next(); |
| 1096 | return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); |
| 1097 | } |
| 1098 | if (allow_calls && is("punc", "(")) { |
| 1099 | next(); |
| 1100 | return subscripts(as("call", expr, expr_list(")")), true); |
| 1101 | } |
| 1102 | if (allow_calls && is("operator") && HOP(UNARY_POSTFIX, S.token.value)) { |
| 1103 | return prog1(curry(make_unary, "unary-postfix", S.token.value, expr), |
| 1104 | next); |
| 1105 | } |
| 1106 | return expr; |
| 1107 | }; |
| 1108 | |
| 1109 | function make_unary(tag, op, expr) { |
| 1110 | if ((op == "++" || op == "--") && !is_assignable(expr)) |