pub enum RefContext {
Body,
TypeAttribute,
OtherAttribute,
AttributeString,
}Expand description
Where in the source a reference was extracted from. The same
textual mod:ident(...) shape means a function call in body
context and a type reference in type-attribute context, so the
extractor must carry the surrounding context with each symbol it
emits.
Variants§
Body
Inside a function body or top-level expression.
TypeAttribute
Inside a -spec, -callback, -type, or -opaque attribute,
where mod:ident(...) is a type reference, not a function call.
OtherAttribute
Inside any other attribute form (-export, -define,
-record, …), where an identifier is never a local call.
AttributeString
Inside a multi-line string in an attribute, such as the
documentation prose of -moduledoc """ ... """. Every byte is
string content, so nothing here is a reference of any kind.
Implementations§
Source§impl RefContext
impl RefContext
Sourcepub fn is_attribute(self) -> bool
pub fn is_attribute(self) -> bool
True in any attribute region; a local name( there is a
type name, an export entry, a macro parameter, or string
content, never a call or a clause head.
Sourcepub fn holds_calls(self) -> bool
pub fn holds_calls(self) -> bool
True where mod:fun(...) may be a real call. False in type
attributes, where it names a type, and in attribute strings,
where a documentation example is not a call the patch adds.