aboutsummaryrefslogtreecommitdiff
path: root/module/c/lex2.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/c/lex2.scm')
-rw-r--r--module/c/lex2.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/module/c/lex2.scm b/module/c/lex2.scm
index e1784541..c00a029c 100644
--- a/module/c/lex2.scm
+++ b/module/c/lex2.scm
@@ -6,6 +6,7 @@
:use-module (srfi srfi-88)
:export (lex
lexeme lexeme?
+ placemaker
(type . lexeme-type)
(body . lexeme-body)
(noexpand . lexeme-noexpand)))
@@ -268,8 +269,9 @@
"/" "%" "<<" ">>" "<" ">" "<=" ">=" "==" "!=" "^" "|" "&&" "||"
"?" ":" ";"
"=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" "&=" "^=" "|="
- "," "#" "##"
- "<:" ":>" "<%" "%>" "%:" "%:%:"))
+ "," "##" "#" ; # and ## flipped
+ "<:" ":>" "<%" "%>" "%:%:" "%:" ; %: and %:%: flipped
+ ))
;;; A.1.8 Header names
@@ -330,11 +332,14 @@
(define-type (lexeme)
- (type type: (memv '(whitespace comment preprocessing-token)))
+ (type type: (memv '(whitespace comment preprocessing-token placemaker)))
(body type: (or string? list?))
(noexpand type: (list-of string?)
default: '()))
+(define (placemaker)
+ (lexeme type: 'placemaker body: '()))
+
(define (lex-output->lexeme-object x)
(match x
(`(whitespace ,body)