aboutsummaryrefslogtreecommitdiff
path: root/module/c/cpp-environment/object-like-macro.scm
blob: 90a3ad231c0341333e14828d694ea6bf7b51fb80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(define-module (c cpp-environment object-like-macro)
  :use-module (hnh util object)
  :use-module (hnh util type)
  :use-module ((c lex2) :select (lexeme?))
  :use-module ((c unlex) :select (unlex))
  :export (object-like-macro
           object-like-macro?
           identifier
           body))


(define-type (object-like-macro
              printer: (lambda (r p)
                         (format p "#<#define ~a ~a>"
                                 (identifier r)
                                 (unlex (body r)))))
  (identifier type: string?)
  (body type: (list-of lexeme?)))