diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-11 18:34:48 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-11 18:34:48 +0200 |
commit | d1b87ade120f8d01d86ed6e5c9661f36f78751b7 (patch) | |
tree | a84e69b087a7d823270aeba02f5cae74041b2ddf /module/c/lex2.scm | |
parent | Rewrite handel-preprocessing-tokens. (diff) | |
download | calp-d1b87ade120f8d01d86ed6e5c9661f36f78751b7.tar.gz calp-d1b87ade120f8d01d86ed6e5c9661f36f78751b7.tar.xz |
Fix most of expand##.
Diffstat (limited to '')
-rw-r--r-- | module/c/lex2.scm | 11 |
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) |