diff options
Diffstat (limited to '')
-rw-r--r-- | module/c/to-token.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/c/to-token.scm b/module/c/to-token.scm index c1efcc02..53db7e59 100644 --- a/module/c/to-token.scm +++ b/module/c/to-token.scm @@ -19,9 +19,16 @@ "_Generic" "_Imaginary" "_Noreturn" "_Static_assert" "_Thread_local")) +;; 6.4 paragraph 2 +;; Each preprocessing toket thas is converted to a token shall have the +;; lexcal form of a keyword, an identifier, a constant, a string literal, +;; or a puncturtor (define (preprocessing-token->token cpp-token) + ;; Guile's cond handles multiple from expr, if written on the form + ;; (cond (expr check => proc) ...) (cond ((string-token? cpp-token) - => (lambda (content) + (lambda (a . _) a) + => (lambda content (make-lexical-token 'string-literal #f content))) ((identifier-token? cpp-token) @@ -36,7 +43,8 @@ (make-lexical-token 'constant #f content))) ((character-constant? cpp-token) - => (lambda (x) (make-lexical-token 'constant #f x))) + (lambda (a . _) a) + => (lambda content (make-lexical-token 'constant #f content))) ((punctuator-token? cpp-token) => (lambda (s) |