diff options
Diffstat (limited to 'module/c/cpp-types.scm')
-rw-r--r-- | module/c/cpp-types.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/module/c/cpp-types.scm b/module/c/cpp-types.scm index 82ebb922..b08e9810 100644 --- a/module/c/cpp-types.scm +++ b/module/c/cpp-types.scm @@ -10,10 +10,11 @@ newline-token? identifier-token? punctuator-token? - number-token? + pp-number? string-token? h-string-token? q-string-token? + character-constant? )) (define (whitespace-token? x) @@ -52,19 +53,26 @@ (`(punctuator ,x) x) (_ #f)))) -(define (number-token? token) +(define (pp-number? token) (and (preprocessing-token? token) (match (lexeme-body token) (`(pp-number ,x) x) (_ #f)))) ;; TODO this fails if there are multiple components in the string token +;; TODO rename to string-literal-token? (define (string-token? token) (and (preprocessing-token? token) (match (lexeme-body token) (`(string-literal ,x) x) (_ #f)))) +(define (character-constant? token) + (and (preprocessing-token? token) + (match (lexeme-body token) + (`(character-constant ,x) x) + (_ #f)))) + (define (h-string-token? token) (and (preprocessing-token? token) |