@@ -410,8 +410,10 @@ pragma[nomagic]
410410private Element interpretElement0 (
411411 string namespace , string type , boolean subtypes , string name , string signature
412412) {
413+ elementSpec ( namespace , type , subtypes , name , signature , _) and
413414 namespace = "" and // TODO: Fill out when we properly extract modules.
414415 (
416+ // Non-member functions
415417 exists ( AbstractFunctionDecl func |
416418 func .getName ( ) = name and
417419 type = "" and
@@ -421,10 +423,11 @@ private Element interpretElement0(
421423 result = func
422424 )
423425 or
426+ // Member functions
424427 exists ( NominalType nomType , IterableDeclContext decl , MethodDecl method |
425428 method .getName ( ) = name and
426429 method = decl .getAMember ( ) and
427- nomType .getName ( ) = type and
430+ nomType .getFullName ( ) = type and
428431 matchesSignature ( method , signature ) and
429432 result = method
430433 |
@@ -434,6 +437,20 @@ private Element interpretElement0(
434437 subtypes = false and
435438 getDeclType ( decl ) = nomType
436439 )
440+ or
441+ signature = "" and
442+ exists ( NominalType nomType , IterableDeclContext decl , FieldDecl field |
443+ field .getName ( ) = name and
444+ field = decl .getAMember ( ) and
445+ nomType .getFullName ( ) = type and
446+ result = field
447+ |
448+ subtypes = true and
449+ getDeclType ( decl ) = nomType .getADerivedType * ( )
450+ or
451+ subtypes = false and
452+ getDeclType ( decl ) = nomType
453+ )
437454 )
438455}
439456
@@ -447,11 +464,18 @@ Element interpretElement(
447464 )
448465}
449466
450- /**
451- * Holds if `c` has a `generated` summary.
452- */
453- predicate hasSummary ( SummarizedCallable c , boolean generated ) {
454- summaryElement ( c , _, _, _, generated )
467+ private predicate parseField ( AccessPathToken c , Content:: FieldContent f ) {
468+ exists ( string fieldRegex , string name |
469+ c .getName ( ) = "Field" and
470+ fieldRegex = "^([^.]+)$" and
471+ name = c .getAnArgument ( ) .regexpCapture ( fieldRegex , 1 ) and
472+ f .getField ( ) .getName ( ) = name
473+ )
474+ }
475+
476+ /** Holds if the specification component parses as a `Content`. */
477+ predicate parseContent ( AccessPathToken component , Content content ) {
478+ parseField ( component , content )
455479}
456480
457481cached
0 commit comments