From 7b78cf68200118fac395592da3d78b22b4be0cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 13 Jul 2022 11:35:39 +0200 Subject: Add support for "other" in preprocessing-tokens. --- module/c/unlex.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/c/unlex.scm') diff --git a/module/c/unlex.scm b/module/c/unlex.scm index e3d36f86..e714816d 100644 --- a/module/c/unlex.scm +++ b/module/c/unlex.scm @@ -13,7 +13,8 @@ (typecheck tokens (list-of lexeme?)) (string-concatenate (map (lambda (x) (cond (x preprocessing-token? => stringify-token) - ((whitespace-token? x) (lexeme-body x)))) + ((whitespace-token? x) (lexeme-body x)) + ((other-token? x) (lexeme-body x)))) tokens))) ;; takes a list of preprocessing-token's, and return a "source" string @@ -22,7 +23,8 @@ (string-concatenate (map (lambda (x) (cond ((preprocessing-token? x) (stringify-token x)) - ((whitespace-token? x) " "))) + ((whitespace-token? x) " ") + ((other-token? x) (lexeme-body x)))) (squeeze-whitespace tokens)))) (define (stringify-escape-sequence sub-token) -- cgit v1.2.3