29 lines
806 B
Racket
29 lines
806 B
Racket
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
|
;;; SPDX-FileCopyrightText: Copyright © 2010-2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
#lang racket/base
|
|
;; Common syntax classes.
|
|
|
|
(provide (for-syntax assertions
|
|
name
|
|
snapshot))
|
|
|
|
(require racket/set)
|
|
|
|
(require (for-syntax racket/base))
|
|
(require (for-syntax syntax/parse))
|
|
(require (for-syntax syntax/srcloc))
|
|
|
|
(begin-for-syntax
|
|
(define-splicing-syntax-class assertions
|
|
(pattern (~seq #:assertions [exprs ...]))
|
|
(pattern (~seq) #:attr (exprs 1) '()))
|
|
|
|
(define-splicing-syntax-class name
|
|
(pattern (~seq #:name N))
|
|
(pattern (~seq) #:attr N #'#f))
|
|
|
|
(define-splicing-syntax-class snapshot
|
|
(pattern (~seq #:snapshot) #:attr dynamic? #'#f)
|
|
(pattern (~seq) #:attr dynamic? #'#t)))
|