1The Syntax Warnings Referenceπ i
This module defines the programmatic API for adding syntax
warnings to syntax objects. Warnings added via this library can be
detected and manipulated by the tools outlined in The Syntax Warning Command Line Interface.
Constructs a
syntax warning of kind
kind that identifies
stx as the syntax to blame and
fix as a suggested replacement
to use in place of
stx. If
kind is not provided, the warning
doesn’t declare itself as having a particular kind. If
fix is not
provided, the warning makes no suggestions about how to resolve it.
Predicate recognizing warning kinds.
Binds id as a warning kind, a value that
can be used to classify similar warnings. The warning kind has a name,
which is the quoted form of id. The raco warn tool uses
warning kind names in its output.
Returns the name of kind.
Returns a syntax object equivalent to
stx, but with
warning
attached as a
syntax warning. The syntax warning need not blame
stx as the source of the problem, this procedure merely provides the
ability to attach warnings to syntax objects via syntax properties.
Examples:
#:stx#'foo
#:kindidentifier-capitalization-warning))
#<syntax:eval:2:0 (foo Bar)>
Returns a list of all syntax warnings present in stx. This includes
syntax warnings in any syntax objects nested within stx.
( read-syntax-warnings [ #:input-portin #:source-namesource
#:namespacenamespace])
Constructs a syntax object from
in using
read-syntax , fully
expands it using
expand-syntax in
namespace, and returns a
list of all syntax warnings found in the fully expanded module.
( read-syntax-warnings/file filepath [ #:namespacenamespace])
Like
read-syntax-warnings, but reads
filepath as a module.
Sets the
current-directory to the directory part of
filepath
and uses
filepath as the source name.
Predicate that recognizes
warning configurations,
values used to control the behavior of tools that analyze syntax warnings.
Configurations from different souces may be merged with
warning-config-merge . Currently, warning configurations contain
information about what kinds of warnings should be suppressed or unsuppressed
(in the case of warnings that aren’t on by default). See
suppress
and
unsuppress for details on how to construct these configurations.
Merges the given
config values into a single
warning
configuration. In the case of more than one
config attempting to
suppress or unsuppress a warning kind, the rightmost configuration takes
precedence. Merging any config with the
empty-warning-config is
equivalent to leaving the config unchanged. If no configurations are provided,
returns
empty-warning-config .
The empty warning config. Represents no changes from default behavior.
Constructs a
warning configuration where warnings of each of the
given
kinds is either suppressed or unsuppressed, depending on the
function called. Warnings may be suppressed using an explicit warning kind
value or suppressed by a symbol representing the name of the warning kind to
suppress. Symbols allow configuration sources to construct warning kind configs
without access to the warning kind bindings. To suppress some warnings and
unsuppress others, see
warning-config-merge .
Returns all the
syntax warnings in
warnings that are
not suppressed according to
config.