#lang racket/base
;;; SPDX-License-Identifier: LGPL-3.0-or-later
;;; SPDX-FileCopyrightText: Copyright © 2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>

(provide (for-syntax <when>
                     <name>
                     <daemon?>))

(require (for-syntax racket/base))
(require (for-syntax syntax/parse))

(begin-for-syntax
  (define-splicing-syntax-class <when>
    (pattern (~seq #:when E))
    (pattern (~seq) #:attr E #'#t))

  (define-splicing-syntax-class <name>
    (pattern (~seq #:name N))
    (pattern (~seq) #:attr N #''?))

  (define-splicing-syntax-class <daemon?>
    (pattern (~seq #:daemon? D))
    (pattern (~seq) #:attr D #'#f)))
