()
| 378 | } |
| 379 | |
| 380 | protected NamedValue namedValue() { |
| 381 | Token token = laToken(); |
| 382 | if (!isPropertyName(token)) { |
| 383 | throw new SyntaxError(token, "expected property identifier"); |
| 384 | } |
| 385 | String name = consume().getText(); |
| 386 | consume(COLON); |
| 387 | Expression expr = assignmentExpression(); |
| 388 | |
| 389 | return new NamedValue(token, name, expr); |
| 390 | } |
| 391 | |
| 392 | protected boolean isPropertyName(Token token) { |
| 393 | switch (token.getType()) { |
no test coverage detected