()
| 353 | } |
| 354 | |
| 355 | protected PropertyGet propertyGet() { |
| 356 | try { |
| 357 | pushContext(ContextType.FUNCTION); |
| 358 | Token get = consume(IDENTIFIER); |
| 359 | if (!get.getText().equals("get")) { |
| 360 | throw new SyntaxError("expected 'get', was: " + get); |
| 361 | } |
| 362 | |
| 363 | Token token = laToken(); |
| 364 | if (!isPropertyName(token)) { |
| 365 | throw new SyntaxError(token, "expected property identifier"); |
| 366 | } |
| 367 | String name = consume().getText(); |
| 368 | consume(LEFT_PAREN); |
| 369 | consume(RIGHT_PAREN); |
| 370 | Token position = consume(LEFT_BRACE); |
| 371 | BlockStatement body = functionBody(); |
| 372 | consume(RIGHT_BRACE); |
| 373 | |
| 374 | return new PropertyGet(position, name, body); |
| 375 | } finally { |
| 376 | popContext(); |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | protected NamedValue namedValue() { |
| 381 | Token token = laToken(); |
no test coverage detected