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. --- tests/test/cpp/lex2.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/test/cpp') diff --git a/tests/test/cpp/lex2.scm b/tests/test/cpp/lex2.scm index b80bcf37..47bb4a16 100644 --- a/tests/test/cpp/lex2.scm +++ b/tests/test/cpp/lex2.scm @@ -80,3 +80,15 @@ (lexeme type: 'whitespace body: "\n") (lexeme type: 'whitespace body: " ")) (lex " \n ")) + + +;; Refer to 6.4 p.1 for the syntax requirement +;; 6.10.9 p. 2 for the sample string +(test-equal "each non-white-space character that cannot be one of the above" + (list (lexeme type: 'preprocessing-token body: '(punctuator ".")) + (lexeme type: 'preprocessing-token body: '(punctuator ".")) + (lexeme type: 'other body: "\\") ; <- Interesting part + (lexeme type: 'preprocessing-token body: '(identifier "listing")) + (lexeme type: 'preprocessing-token body: '(punctuator ".")) + (lexeme type: 'preprocessing-token body: '(identifier "dir"))) + (lex "..\\listing.dir")) -- cgit v1.2.3