Analyzer::Python::Quart
Inherits Analyzer::Python::PythonEngine < Analyzer < FileHelper < Reference < Object
Quart is an ASGI re-implementation of Flask's API. Decorator, Blueprint, and request-object shapes mirror Flask 1:1, so this analyzer leans on the same tree-sitter helpers as the Flask one and adds two Quart-specific pieces:
@app.websocket("/ws")— surfaced asGET+protocol = "ws"so the existing endpoint pipeline carries it through unchangedawait request.get_json()/request.jsonbody extraction — the same patterns Flask uses; nothing extra is needed because parameter extraction reads the function body line-by-line and theawaitprefix doesn't change the access shape.
Constants
Per-line route-discovery patterns. These interpolate only the
PYTHON_VAR_NAME_REGEX/DOT_NATION constants, so an inline literal
inside the per-line analyze loop recompiled an identical PCRE2
pattern on every source line of every file. Compile once here; the
.to_s expansion of the interpolated constants is byte-identical
to the previous inline form, so matching behaviour is unchanged.
Precompiled per-field access patterns. extract_request_params
runs once per route; rebuilding these interpolated regexes on
every call recompiled PCRE2 patterns (8 fields × 2) per endpoint.
Compile once here and reuse. {noir_param_type, bracket_re, get_re}
Reference: https://quart.palletsprojects.com/en/latest/reference/source/quart.wrappers.request.html
QUERY (RFC 10008) is safe/idempotent like GET but, per the method's
whole purpose, carries its filter criteria in a request body like
POST — so it joins the body-bearing methods for "form"/"json", not
the read-only "query" (query-string) type. Quart mirrors Flask's API
1:1 (including this table), so it gets the same treatment.
Constant-only interpolation (DOT_NATION) — hoisted so the per-call sites don't recompile them.
@app.websocket("/ws") is the only attribute outside the
standard HTTP-method set that the tree-sitter extractor needs
to surface here. The synthesised method stays GET so the
downstream filter logic (which keys off HTTP methods) keeps
working; the analyzer rewrites protocol to "ws" later.
Class methods
Instance methods
Build endpoints from a single route decoration. Mirrors the Flask
adapter's behaviour: split on declared methods=[...], default to
GET, run parameter extraction over the handler body once and
filter the params per method.
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.