| 340 | } |
| 341 | |
| 342 | func (p *Parser) isMethodStart() bool { |
| 343 | // Look ahead for ( ... ) { |
| 344 | // Simple check: within next 50 tokens do we see '(' |
| 345 | limit := 50 |
| 346 | for i := 0; i < limit && p.pos+i < len(p.tokens); i++ { |
| 347 | t := p.tokens[p.pos+i] |
| 348 | if t.Value == "(" { |
| 349 | // Check if previous token was identifier (Method Name) |
| 350 | if i > 0 && p.tokens[p.pos+i-1].Type == TOKEN_IDENTIFIER { |
| 351 | // Check if token before that was Type (Identifier or Primitive) |
| 352 | // Or if it's constructor (ClassName) |
| 353 | return true |
| 354 | } |
| 355 | } |
| 356 | if t.Value == ";" || t.Value == "{" || t.Value == "}" { |
| 357 | return false |
| 358 | } |
| 359 | } |
| 360 | return false |
| 361 | } |
| 362 | |
| 363 | func (p *Parser) parseMethod() *MethodNode { |
| 364 | // Skip annotations |