File: backslash

package info (click to toggle)
sparse 0.4.1-1
  • links: PTS, VCS
  • area: non-free
  • in suites: lenny
  • size: 1,268 kB
  • ctags: 2,691
  • sloc: ansic: 23,892; perl: 204; sh: 181; makefile: 174
file content (62 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 *	'\\' has a special meaning on phase 2 if and only if it is immediately
 * followed by '\n'.  In any other position it's left alone as any other
 * character.
 *
 * [5.1.1.2(1.2)]:
 *   Each instance of a backslash character (\) immediately followed by
 *   a new-line character is deleted, splicing physical source lines to
 *   form logical source lines.  Only the last backslash on any physical
 *   source line shall be eligible for being part of such a splice.
 *   A source file that is not empty shall end in a new-line character,
 *   which shall not be immediately preceded by a backslash character
 *   before any such splicing takes place.
 *
 * Note that this happens on the phase 2, before we even think of any
 * tokens.  In other words, splicing is ignorant of and transparent for
 * the rest of tokenizer.
 */

#define A(x) #x
#define B(x) A(x)
/* This should result in "\a" */
/* XXX: currently sparse produces "a" */
/* Partially fixed: now it gives "\\a", which is a separate problem */
B(\a)

#define C\
 1
/* This should give 1 */
C

#define D\
1
/* And this should give D, since '\n' is removed and we get no whitespace */
/* XXX: currently sparse produces 1 */
/* Fixed */
D

#define E '\\
a'
/* This should give '\a' - with no warnings issued */
/* XXX: currently sparse complains a lot and ends up producing a */
/* Fixed */
E

/* This should give nothing */
/* XXX: currently sparse produces more junk */
/* Fixed */
// junk \
more junk

/* This should also give nothing */
/* XXX: currently sparse produces / * comment * / */
/* Fixed */
/\
* comment *\
/

/* And this should complain since final newline should not be eaten by '\\' */
/* XXX: currently sparse does not notice */
/* Fixed */
\