diff options
Diffstat (limited to 'module/c/unlex.scm')
-rw-r--r-- | module/c/unlex.scm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/module/c/unlex.scm b/module/c/unlex.scm index 1f8ba0a1..e467a50f 100644 --- a/module/c/unlex.scm +++ b/module/c/unlex.scm @@ -59,21 +59,26 @@ ;; Returns the "source" of the token, as a preprocessing string literal token (define (stringify-token preprocessing-token) (match (lexeme-body preprocessing-token) - (('string-literal `(encoding-prefix ,prefix) parts ...) - (stringify-string-tokens parts)) - (('string-literal parts ...) + (('string-literal `(encoding-prefix . ,prefix) parts ...) (stringify-string-tokens parts)) + (`(header-name (q-string ,s)) (format #f "~s" s)) + (`(header-name (h-string ,s)) (format #f "<~a>" s)) + (`(identifier ,id) id) + (`(pp-number ,n) n) - (`(character-constant ,c) + + ;; TODO remaining parts + (('character-constant `(character-encoding . ,x) c parts ...) (format #f "'~a'" c)) + (`(punctuator ,p) p))) ;; takes a token list, and return a single string literal token (define (stringify-tokens tokens) (lexeme type: 'preprocessing-token - body: `(string-literal ,(unlex-aggressive tokens)))) + body: `(string-literal (encoding-prefix) ,(unlex-aggressive tokens)))) |