MCPcopy Create free account
hub / github.com/Yuy0ung/YuC0de / isMethodStart

Method isMethodStart

backend/engine/java_parser.go:342–361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340}
341
342func (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
363func (p *Parser) parseMethod() *MethodNode {
364 // Skip annotations

Callers 1

parseClassBodyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected