aboutsummaryrefslogtreecommitdiff
path: root/module/c/lex2.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-07-12 03:16:34 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-07-12 03:16:34 +0200
commit65ecaf18aa34d3e76abbfd757797fa4dda9bb195 (patch)
tree1e7294a4a6fce2bc5a121162b6e0101e70ce1c3f /module/c/lex2.scm
parents/macro?/cpp-macro?/g (diff)
downloadcalp-65ecaf18aa34d3e76abbfd757797fa4dda9bb195.tar.gz
calp-65ecaf18aa34d3e76abbfd757797fa4dda9bb195.tar.xz
Resolve # ## #
Diffstat (limited to '')
-rw-r--r--module/c/lex2.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/module/c/lex2.scm b/module/c/lex2.scm
index 50cf56e3..652aa6c1 100644
--- a/module/c/lex2.scm
+++ b/module/c/lex2.scm
@@ -330,6 +330,7 @@
comment
preprocessing-token)))
+
(define-type (lexeme)
(type type: (memv '(whitespace comment preprocessing-token placemaker)))
@@ -356,6 +357,12 @@
;; "unflatten"
('comment (lexeme body: "" type: 'comment))))
+
+
+;; At a number of places I chose token depending on the order of the rule. The
+;; standard however says that the longest possible choice should be used.
+;; 6.4 p. 4
+
;; returns a list of lexemes
(define (lex string)
(if (string-null? string)