class

Analyzer::Python::Strawberry

Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object

Constants

ARGUMENT_NAME = /\bargument\([^)]*\bname\s*=\s*["'](\w+)["']/
FIELD_CALL = /\A(?:[\w.]+\.)?(?:field|mutation|subscription)\z/
FIELD_DECORATOR = /\A(?:[\w.]+\.)?(?:field|mutation|subscription)(?:\(|\z)/
GENERIC = /\A(?:[\w.]+\.)?(\w+)\[(.*)\]\z/m
LISTS = ["list", "List", "Sequence", "Iterable", "tuple", "Tuple", "set", "Set", "frozenset"] of ::String
NOT_A_FIELD = /\b(?:ClassVar|Private|InitVar)\b/
RESERVED_PARAMS = ["self", "cls", "root", "info"] of ::String

self/cls/root/info by name, Info and Parent by annotation.

RESERVED_TYPE = /\b(?:Info|Parent)\b/
SCALARS = {"str" => "String", "int" => "Int", "float" => "Float", "bool" => "Boolean", "datetime" => "DateTime", "date" => "Date", "time" => "Time"}
STREAMS = ["AsyncGenerator", "AsyncIterator", "AsyncIterable", "Generator", "Iterator"] of ::String
TAGGER = "strawberry_analyzer"
TYPE_DECORATOR = /\A(?:[\w.]+\.)?type(?:\(|\z)/

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source

Nested types