|
Packit Service |
8bf002 |
/* n_22.c: Tokenization of preprocessing number. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#include "defs.h"
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#define str( a) # a
|
|
Packit Service |
8bf002 |
#define xstr( a) str( a)
|
|
Packit Service |
8bf002 |
#define EXP 1
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
main( void)
|
|
Packit Service |
8bf002 |
{
|
|
Packit Service |
8bf002 |
fputs( "started\n", stderr);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. */
|
|
Packit Service |
8bf002 |
assert( strcmp( xstr( 12E+EXP), "12E+EXP") == 0);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 22.2: .2e-EXP is also a preprocessing number. */
|
|
Packit Service |
8bf002 |
assert( strcmp( xstr( .2e-EXP), ".2e-EXP") == 0);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 22.3: + or - is allowed only following E or e, 12+EXP is not a
|
|
Packit Service |
8bf002 |
preprocessing number. */
|
|
Packit Service |
8bf002 |
assert( strcmp( xstr( 12+EXP), "12+1") == 0);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
fputs( "success\n", stderr);
|
|
Packit Service |
8bf002 |
return 0;
|
|
Packit Service |
8bf002 |
}
|
|
Packit Service |
8bf002 |
|