1 The Syntax Warnings Reference
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
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
provided, the warning makes no suggestions about how to resolve it.
Predicate recognizing warning kinds.
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
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
as the source of the problem, this procedure merely provides the
ability to attach warnings to syntax objects via syntax properties.
|> (define-warning-kind identifier-capitalization-warning)|
|> (syntax-warn #'(foo Bar)|
| (syntax-warning #:message "Don't capitalize the \"Bar\" identifier"|
| #:stx #'foo|
| #:kind identifier-capitalization-warning))|
#<syntax: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.
Constructs a syntax object from in
expands it using expand-syntax
, and returns a
list of all syntax warnings found in the fully expanded module.
, 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
. 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
for details on how to construct these configurations.
Merges the given config
values into a single warning
. In the case of more than one config
suppress or unsuppress a warning kind, the rightmost configuration takes
precedence. Merging any config with the empty-warning-config
equivalent to leaving the config unchanged. If no configurations are provided,
The empty warning config. Represents no changes from default behavior.
Constructs a warning configuration
where warnings of each of the
s 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
not suppressed according to config