Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69196 - in trunk/libs/wave: . test/testwave/testfiles
From: hartmut.kaiser_at_[hidden]
Date: 2011-02-22 20:31:16


Author: hkaiser
Date: 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
New Revision: 69196
URL: http://svn.boost.org/trac/boost/changeset/69196

Log:
Wave: Fixed whitespace handling, added a corresponding set of test cases
Added:
   trunk/libs/wave/test/testwave/testfiles/t_9_020.cpp (contents, props changed)
Text files modified:
   trunk/libs/wave/ChangeLog | 2 ++
   trunk/libs/wave/test/testwave/testfiles/t_1_001.cpp | 28 +++++++++++++++++++---------
   trunk/libs/wave/test/testwave/testfiles/t_1_006.cpp | 7 +++----
   trunk/libs/wave/test/testwave/testfiles/t_1_007.cpp | 6 +++---
   trunk/libs/wave/test/testwave/testfiles/t_1_008.cpp | 12 ++++++------
   trunk/libs/wave/test/testwave/testfiles/t_1_013.cpp | 2 +-
   trunk/libs/wave/test/testwave/testfiles/t_1_030.cpp | 2 +-
   trunk/libs/wave/test/testwave/testfiles/t_1_034.cpp | 8 ++++----
   trunk/libs/wave/test/testwave/testfiles/t_1_038.cpp | 4 ++--
   trunk/libs/wave/test/testwave/testfiles/t_5_030.cpp | 4 ++--
   trunk/libs/wave/test/testwave/testfiles/t_9_010.cpp | 4 ++--
   trunk/libs/wave/test/testwave/testfiles/t_9_012.cpp | 6 +++---
   trunk/libs/wave/test/testwave/testfiles/test.cfg | 1 +
   13 files changed, 49 insertions(+), 37 deletions(-)

Modified: trunk/libs/wave/ChangeLog
==============================================================================
--- trunk/libs/wave/ChangeLog (original)
+++ trunk/libs/wave/ChangeLog 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -24,6 +24,8 @@
 - V2.3.0
 - After preprocessing the body of any #pragma wave option() the wave tool now
   concatenates all adjacent string literals into a single string literal.
+- Fixed whitespace handling, added a corresponding set of test cases
+ (t_9_020.cpp)
 
 Boost V1.46.0
 - V2.2.0

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_001.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_001.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_001.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -8,25 +8,35 @@
 =============================================================================*/
 
 // Test macro expansion order
-#define A(x, y) x, y
+#define A(x, y) x,y
 #define B(x, y) [x][y]
 #define C(x) B(x)
 
 //R #line 16 "t_1_001.cpp"
-C( A(2, 3) ) //R [2][3]
+C(A(2,3)) //R [2][3]
+C( A(2 , 3) ) //R [ 2 ][ 3 ]
 
 //H 10: t_1_001.cpp(11): #define
-//H 08: t_1_001.cpp(11): A(x, y)=x, y
+//H 08: t_1_001.cpp(11): A(x, y)=x,y
 //H 10: t_1_001.cpp(12): #define
 //H 08: t_1_001.cpp(12): B(x, y)=[x][y]
 //H 10: t_1_001.cpp(13): #define
 //H 08: t_1_001.cpp(13): C(x)=B(x)
-//H 00: t_1_001.cpp(16): C( A(2, 3) ), [t_1_001.cpp(13): C(x)=B(x)]
-//H 00: t_1_001.cpp(16): A(2, 3), [t_1_001.cpp(11): A(x, y)=x, y]
-//H 02: 2, 3
-//H 03: 2, 3
-//H 02: B(2, 3)
-//H 00: t_1_001.cpp(13): B(2, 3), [t_1_001.cpp(12): B(x, y)=[x][y]]
+//H 00: t_1_001.cpp(16): C(A(2,3)), [t_1_001.cpp(13): C(x)=B(x)]
+//H 00: t_1_001.cpp(16): A(2,3), [t_1_001.cpp(11): A(x, y)=x,y]
+//H 02: 2,3
+//H 03: 2,3
+//H 02: B(2,3)
+//H 00: t_1_001.cpp(13): B(2,3), [t_1_001.cpp(12): B(x, y)=[x][y]]
 //H 02: [2][3]
 //H 03: [2][3]
 //H 03: [2][3]
+//H 00: t_1_001.cpp(17): C( A(2 , 3) ), [t_1_001.cpp(13): C(x)=B(x)]
+//H 00: t_1_001.cpp(17): A(2 , 3), [t_1_001.cpp(11): A(x, y)=x,y]
+//H 02: 2 , 3
+//H 03: 2 , 3
+//H 02: B( 2 , 3 )
+//H 00: t_1_001.cpp(13): B( 2 , 3 ), [t_1_001.cpp(12): B(x, y)=[x][y]]
+//H 02: [ 2 ][ 3 ]
+//H 03: [ 2 ][ 3 ]
+//H 03: [ 2 ][ 3 ]

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_006.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_006.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_006.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -32,19 +32,19 @@
 //H 00: t_1_006.cpp(18): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 23
 //H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 123
 //H 03: 123
 //H 03: 123
 //H 00: t_1_006.cpp(21): CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
 //H 00: t_1_006.cpp(21): CONCAT(2, 3), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
-//H 02: PRIMITIVE_CONCAT(2, 3)
+//H 02: PRIMITIVE_CONCAT(2, 3)
 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 23
 //H 03: 23
 //H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
 //H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 123
 //H 03: 123
@@ -52,4 +52,3 @@
 //H 00: t_1_006.cpp(25): PRIMITIVE_CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 1CONCAT(2, 3)
 //H 03: 1CONCAT(2, 3)
-

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_007.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_007.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_007.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -33,19 +33,19 @@
 //H 00: t_1_007.cpp(20): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 23
 //H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
 //H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 123
 //H 03: 123
 //H 03: 123
 //H 00: t_1_007.cpp(23): CONCAT(1, CONCAT(2, 3)), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
 //H 00: t_1_007.cpp(23): CONCAT(2, 3), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)]
-//H 02: PRIMITIVE_CONCAT(2, 3)
+//H 02: PRIMITIVE_CONCAT(2, 3)
 //H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 23
 //H 03: 23
 //H 03: 23
-//H 02: PRIMITIVE_CONCAT(1, 23)
+//H 02: PRIMITIVE_CONCAT(1, 23)
 //H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b]
 //H 02: 123
 //H 03: 123

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_008.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_008.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_008.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -78,8 +78,8 @@
 //H 01: t_1_008.cpp(23): PARTIAL
 //H 02:
 //H 03: _
-//H 02: CAT(Token1, Token2)
-//H 00: t_1_008.cpp(18): CAT(Token1, Token2), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT( Token1, Token2 )
+//H 00: t_1_008.cpp(18): CAT( Token1, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b]
 //H 02: Token1Token2
 //H 03: Token1Token2
 //H 03: Token1Token2
@@ -96,8 +96,8 @@
 //H 01: t_1_008.cpp(23): PARTIAL
 //H 02:
 //H 03: _
-//H 02: CAT(PARTIALPARTIAL X, Token2)
-//H 00: t_1_008.cpp(19): CAT(PARTIALPARTIAL X, Token2), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT(PARTIALPARTIAL X, Token2 )
+//H 00: t_1_008.cpp(19): CAT(PARTIALPARTIAL X, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b]
 //H 02: PARTIALPARTIAL XToken2
 //H 01: t_1_008.cpp(24): PARTIALPARTIAL
 //H 02:
@@ -117,8 +117,8 @@
 //H 01: t_1_008.cpp(26): X
 //H 02: Token1
 //H 03: Token1
-//H 02: CAT(Token1, Y PARTIALPARTIAL)
-//H 00: t_1_008.cpp(20): CAT(Token1, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b]
+//H 02: CAT( Token1, Y PARTIALPARTIAL)
+//H 00: t_1_008.cpp(20): CAT( Token1, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b]
 //H 02: Token1Y PARTIALPARTIAL
 //H 01: t_1_008.cpp(24): PARTIALPARTIAL
 //H 02:

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_013.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_013.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_013.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -79,7 +79,7 @@
 //H 01: t_1_013.cpp(21): LOW
 //H 02: LOW ", world"
 //H 03: LOW ", world"
-//H 02: glue(HIGH, LOW ", world")
+//H 02: glue(HIGH, LOW ", world")
 //H 00: t_1_013.cpp(19): glue(HIGH, LOW ", world"), [t_1_013.cpp(18): glue(a, b)=a ## b]
 //H 02: HIGHLOW ", world"
 //H 01: t_1_013.cpp(20): HIGHLOW

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_030.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_030.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_030.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -26,7 +26,7 @@
 //H 00: t_1_030.cpp(17): EMPTY(), [t_1_030.cpp(12): EMPTY()=]
 //H 02:
 //H 03: _
-//H 02: MACRO
+//H 02: MACRO
 //H 03: MACRO
 //H 00: t_1_030.cpp(17): MACRO(1), [t_1_030.cpp(14): MACRO(x)=(x)]
 //H 02: (1)

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_034.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_034.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_034.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -17,7 +17,7 @@
 
 //R #line 19 "t_1_034.cpp"
 MACRO1(1,) //R 1 ->
-MACRO2(1, 2) //R 1,2
+MACRO2(1, 2) //R 1, 2
 STR() //R ""
 
 //H 10: t_1_034.cpp(14): #define
@@ -27,11 +27,11 @@
 //H 10: t_1_034.cpp(16): #define
 //H 08: t_1_034.cpp(16): STR(...)=#__VA_ARGS__
 //H 00: t_1_034.cpp(19): MACRO1(1,§), [t_1_034.cpp(14): MACRO1(x, ...)=x -> __VA_ARGS__]
-//H 02: 1 -> §
+//H 02: 1 ->
 //H 03: 1 ->
 //H 00: t_1_034.cpp(20): MACRO2(1, 2), [t_1_034.cpp(15): MACRO2(...)=__VA_ARGS__]
-//H 02: 1,2
-//H 03: 1,2
+//H 02: 1, 2
+//H 03: 1, 2
 //H 00: t_1_034.cpp(21): STR(§), [t_1_034.cpp(16): STR(...)=#__VA_ARGS__]
 //H 02: ""
 //H 03: ""

Modified: trunk/libs/wave/test/testwave/testfiles/t_1_038.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_1_038.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_1_038.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -33,5 +33,5 @@
 //H 10: t_1_038.cpp(12): #define
 //H 08: t_1_038.cpp(12): BAZ(T, E)=T E
 //H 00: t_1_038.cpp(16): BAZ(bool, value = true ), [t_1_038.cpp(12): BAZ(T, E)=T E]
-//H 02: bool value = true
-//H 03: bool value = true
+//H 02: bool value = true
+//H 03: bool value = true

Modified: trunk/libs/wave/test/testwave/testfiles/t_5_030.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_5_030.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_5_030.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -39,7 +39,7 @@
 #define FUNC3(a, b) FUNC2(a, b) + NEST3
 #define FUNC2(a, b) FUNC1(a, b) + NEST2
 #define FUNC1(a, b) (a) + (b)
-FUNC4(NEST1, NEST2) //R (1) + (1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4
+FUNC4(NEST1, NEST2) //R (1) + ( 1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4
 
 // 27.3: An identifier generated by ## operator is subject to expansion.
 //R #line 48 "t_5_030.cpp"
@@ -52,7 +52,7 @@
 //R #line 55 "t_5_030.cpp"
 #define SUB(x, y) (x - y)
 #define MATH(op, a, b) op( (a), (b))
-MATH(SUB, a, b) //R ((a) - (b))
+MATH(SUB, a, b) //R ( ( a) - ( b))
 
 // 27.5: Queer thing.
 // R #line 28 "t_5_030.cpp"

Modified: trunk/libs/wave/test/testwave/testfiles/t_9_010.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_9_010.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_9_010.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -54,7 +54,7 @@
 //H 00: t_9_010.cpp(28): X(), [t_9_010.cpp(24): X()=B]
 //H 02: B
 //H 03: B
-//H 02: PRIMITIVE_CAT(A, B C)
+//H 02: PRIMITIVE_CAT(A, B C)
 //H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, B C), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b]
 //H 02: AB C
 //H 03: AB C
@@ -63,7 +63,7 @@
 //H 00: t_9_010.cpp(29): X(), [t_9_010.cpp(24): X()=B]
 //H 02: B
 //H 03: B
-//H 02: PRIMITIVE_CAT(A, BC)
+//H 02: PRIMITIVE_CAT(A, BC)
 //H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, BC), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b]
 //H 02: ABC
 //H 03: ABC

Modified: trunk/libs/wave/test/testwave/testfiles/t_9_012.cpp
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/t_9_012.cpp (original)
+++ trunk/libs/wave/test/testwave/testfiles/t_9_012.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -16,10 +16,10 @@
 nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
 
 //R #line 19 "t_9_012.cpp"
-CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) //R CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
+CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) //R CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
 
 //H 10: t_9_012.cpp(13): #define
 //H 08: t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
 //H 00: t_9_012.cpp(19): CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), [t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)]
-//H 02: CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
-//H 03: CreateWindowExA(0L, 1, 2, 3, 4, 5,6, 7, 8, 9, 10, 11)
+//H 02: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
+//H 03: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)

Added: trunk/libs/wave/test/testwave/testfiles/t_9_020.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/wave/test/testwave/testfiles/t_9_020.cpp 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -0,0 +1,48 @@
+/*=============================================================================
+ Boost.Wave: A Standard compliant C++ preprocessor library
+ http://www.boost.org/
+
+ Copyright (c) 2001-2011 Hartmut Kaiser. Distributed under the Boost
+ Software License, Version 1.0. (See accompanying file
+ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+// tests whether whitespace is correctly handled in macro arguments
+
+//O --variadics
+
+#define STRINGIZE1(x) #x
+#define STRINGIZE(x) STRINGIZE1(x)
+
+#define MACRO(...) (__VA_ARGS__) - STRINGIZE((__VA_ARGS__))
+
+//R #line 20 "t_9_020.cpp"
+MACRO() //R () - "()"
+MACRO( ) //R () - "()"
+MACRO(a) //R (a) - "(a)"
+MACRO( a ) //R ( a ) - "( a )"
+MACRO( a ) //R ( a ) - "( a )"
+MACRO(a,b) //R (a,b) - "(a,b)"
+MACRO(a, b) //R (a, b) - "(a, b)"
+MACRO(a ,b) //R (a ,b) - "(a ,b)"
+MACRO( a ,b, c ) //R ( a ,b, c ) - "( a ,b, c )"
+MACRO( a ,b, c ) //R ( a ,b, c ) - "( a ,b, c )"
+
+#undef MACRO
+#define MACRO(x) [x]
+
+//R #line 35 "t_9_020.cpp"
+MACRO() //R []
+MACRO( ) //R []
+MACRO(123) //R [123]
+MACRO( 123 ) //R [ 123 ]
+MACRO( 123 ) //R [ 123 ]
+
+#define A(x) 1 x 3
+#define B(x) (1)x(3)
+
+//R #line 45 "t_9_020.cpp"
+A(2) //R 1 2 3
+STRINGIZE(A(2)) //R "1 2 3"
+STRINGIZE(B(2)) //R "(1)2(3)"
+STRINGIZE(B( 2 )) //R "(1) 2 (3)"

Modified: trunk/libs/wave/test/testwave/testfiles/test.cfg
==============================================================================
--- trunk/libs/wave/test/testwave/testfiles/test.cfg (original)
+++ trunk/libs/wave/test/testwave/testfiles/test.cfg 2011-02-22 20:31:14 EST (Tue, 22 Feb 2011)
@@ -234,3 +234,4 @@
 t_9_017.cpp
 t_9_018.cpp
 t_9_019.cpp
+t_9_020.cpp


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk