diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-13 11:35:39 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-13 11:35:39 +0200 |
commit | 7b78cf68200118fac395592da3d78b22b4be0cd7 (patch) | |
tree | 9cd8411147b6732a7288e4ba40ade220658d73c3 /tests/test | |
parent | Ensure #error works. (diff) | |
download | calp-7b78cf68200118fac395592da3d78b22b4be0cd7.tar.gz calp-7b78cf68200118fac395592da3d78b22b4be0cd7.tar.xz |
Add support for "other" in preprocessing-tokens.
Diffstat (limited to 'tests/test')
-rw-r--r-- | tests/test/cpp/lex2.scm | 12 |
1 files changed, 12 insertions, 0 deletions
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")) |