Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: Parser/tokenizer.c

Issue 26581: Double coding cookie
Patch Set: Created 4 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/tokenize.py ('k') | Tools/scripts/findnocoding.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Tokenizer implementation */ 2 /* Tokenizer implementation */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 #include "pgenheaders.h" 5 #include "pgenheaders.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 #include <assert.h> 8 #include <assert.h>
9 9
10 #include "tokenizer.h" 10 #include "tokenizer.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (!r) 268 if (!r)
269 return 0; 269 return 0;
270 q = get_normal_name(r); 270 q = get_normal_name(r);
271 if (r != q) { 271 if (r != q) {
272 PyMem_FREE(r); 272 PyMem_FREE(r);
273 r = new_string(q, strlen(q), tok); 273 r = new_string(q, strlen(q), tok);
274 if (!r) 274 if (!r)
275 return 0; 275 return 0;
276 } 276 }
277 *spec = r; 277 *spec = r;
278 break;
278 } 279 }
279 } 280 }
280 } 281 }
281 return 1; 282 return 1;
282 } 283 }
283 284
284 /* Check whether the line contains a coding spec. If it does, 285 /* Check whether the line contains a coding spec. If it does,
285 invoke the set_readline function for the new encoding. 286 invoke the set_readline function for the new encoding.
286 This function receives the tok_state and the new encoding. 287 This function receives the tok_state and the new encoding.
287 Return 1 on success, 0 on failure. */ 288 Return 1 on success, 0 on failure. */
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1883 1884
1884 void 1885 void
1885 tok_dump(int type, char *start, char *end) 1886 tok_dump(int type, char *start, char *end)
1886 { 1887 {
1887 printf("%s", _PyParser_TokenNames[type]); 1888 printf("%s", _PyParser_TokenNames[type]);
1888 if (type == NAME || type == NUMBER || type == STRING || type == OP) 1889 if (type == NAME || type == NUMBER || type == STRING || type == OP)
1889 printf("(%.*s)", (int)(end - start), start); 1890 printf("(%.*s)", (int)(end - start), start);
1890 } 1891 }
1891 1892
1892 #endif 1893 #endif
OLDNEW
« no previous file with comments | « Lib/tokenize.py ('k') | Tools/scripts/findnocoding.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+