1 The Syntax Warnings Reference
(require syntax/warn) | |
packages: syntax-warn, syntax-warn-base |
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.
procedure
(syntax-warning #:message message #:stx stx [ #:kind kind #:fix fix]) → syntax-warning? message : string? stx : syntax? kind : warning-kind? = #f fix : syntax? = #f
procedure
(syntax-warning? v) → boolean?
v : any/c
procedure
(syntax-warning/fix? v) → boolean?
v : any/c
procedure
(syntax-warning-message warning) → string?
warning : syntax-warning?
procedure
(syntax-warning-stx warning) → syntax?
warning : syntax-warning?
procedure
(syntax-warning-kind warning) → (or/c warning-kind? #f)
warning : syntax-warning?
procedure
(syntax-warning-fix warning) → (or/c syntax? #f)
warning : syntax-warning?
value
syntax
(define-warning-kind id)
procedure
(warning-kind-name kind) → symbol?
kind : warning-kind?
procedure
(syntax-warn stx warning) → syntax?
stx : syntax? warning : syntax-warning?
> (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:eval:2:0 (foo Bar)>
procedure
(syntax-warnings stx) → (listof syntax?)
stx : syntax?
procedure
(read-syntax-warnings [ #:input-port in #:source-name source #:namespace namespace]) → (listof syntax-warning?) in : input-port? = (current-input-port) source : any/c = (object-name in) namespace : namespace? = (current-namespace)
procedure
(read-syntax-warnings/file filepath [ #:namespace namespace]) → (listof syntax-warning?) filepath : path-string? namespace : namespace? = (current-namespace)
procedure
(warning-config? v) → boolean?
v : any/c
procedure
(warning-config-merge config ...) → warning-config?
config : warning-config?
procedure
(suppress kind ...) → warning-config?
kind : (or/c warning-kind? symbol?)
procedure
(unsuppress kind ...) → warning-config?
kind : (or/c warning-kind? symbol?)
procedure
(filter-unsuppressed-warnings warnings config) → (listof syntax-warning?) warnings : (listof syntax-warning?) config : warning-config?