aboutsummaryrefslogtreecommitdiff
path: root/module/c/preprocessor2.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/c/preprocessor2.scm')
-rw-r--r--module/c/preprocessor2.scm20
1 files changed, 13 insertions, 7 deletions
diff --git a/module/c/preprocessor2.scm b/module/c/preprocessor2.scm
index c6be3936..3f9552c5 100644
--- a/module/c/preprocessor2.scm
+++ b/module/c/preprocessor2.scm
@@ -397,11 +397,15 @@
body: (lambda (environment arguments)
(typecheck arguments (and (list-of (list-of lexeme?))
(not null?)))
- (aif (string-token? (caar arguments))
- (values (handle-pragma environment (lex it)) '())
- (scm-error 'cpp-pragma-error "_Pragma"
- "Invalid argument to _Pragma: ~s"
- (list (car arguments)) #f)))))
+ (cond ((string-token? (caar arguments))
+ (lambda (a . _) a)
+ ;; TODO handle rest
+ => (lambda (encoding it . rest)
+ (values (handle-pragma environment (lex it))
+ '())))
+ (else (scm-error 'cpp-pragma-error "_Pragma"
+ "Invalid argument to _Pragma: ~s"
+ (list (car arguments)) #f))))))
@@ -591,10 +595,12 @@
(remaining (drop-whitespace (cdr tokens))))
(cond ((null? remaining) (set environment current-line (1- line)))
((string-token? (car remaining))
- => (lambda (file)
+ (lambda (a . _) a)
+ => (lambda (encoding . fragments)
(-> environment
(set current-line (1- line))
- (set current-file file))))
+ ;; TODO properly join string
+ (set current-file (car fragments)))))
;; no newlines in #line
(%first-time (loop #f ((unval resolve-token-stream 1) environment tokens)))
(else (err))))))