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

Delta Between Two Patch Sets: Python/pythonrun.c

Issue 3353: make built-in tokenizer available via Python C API
Left Patch Set: Created 5 years, 9 months ago
Right Patch Set: Created 4 years, 11 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:
Right: Side by side diff | Download
« no previous file with change/comment | « Python/ast.c ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 1
2 /* Python interpreter top-level routines, including init/exit */ 2 /* Python interpreter top-level routines, including init/exit */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 5
6 #include "Python-ast.h" 6 #include "Python-ast.h"
7 #undef Yield /* undefine macro conflicting with winbase.h */ 7 #undef Yield /* undefine macro conflicting with winbase.h */
8 #include "grammar.h" 8 #include "grammar.h"
9 #include "node.h" 9 #include "node.h"
10 #include "token.h" 10 #include "token.h"
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 PyObject *msg_obj = NULL; 1260 PyObject *msg_obj = NULL;
1261 char *msg = NULL; 1261 char *msg = NULL;
1262 int offset = err->offset; 1262 int offset = err->offset;
1263 1263
1264 errtype = PyExc_SyntaxError; 1264 errtype = PyExc_SyntaxError;
1265 switch (err->error) { 1265 switch (err->error) {
1266 case E_ERROR: 1266 case E_ERROR:
1267 return; 1267 return;
1268 case E_SYNTAX: 1268 case E_SYNTAX:
1269 errtype = PyExc_IndentationError; 1269 errtype = PyExc_IndentationError;
1270 if (err->expected == INDENT) 1270 if (err->expected == PYTOK_INDENT)
1271 msg = "expected an indented block"; 1271 msg = "expected an indented block";
1272 else if (err->token == INDENT) 1272 else if (err->token == PYTOK_INDENT)
1273 msg = "unexpected indent"; 1273 msg = "unexpected indent";
1274 else if (err->token == DEDENT) 1274 else if (err->token == PYTOK_DEDENT)
1275 msg = "unexpected unindent"; 1275 msg = "unexpected unindent";
1276 else { 1276 else {
1277 errtype = PyExc_SyntaxError; 1277 errtype = PyExc_SyntaxError;
1278 msg = "invalid syntax"; 1278 msg = "invalid syntax";
1279 } 1279 }
1280 break; 1280 break;
1281 case E_TOKEN: 1281 case E_TOKEN:
1282 msg = "invalid token"; 1282 msg = "invalid token";
1283 break; 1283 break;
1284 case E_EOFS: 1284 case E_EOFS:
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 #undef PyRun_InteractiveLoop 1527 #undef PyRun_InteractiveLoop
1528 PyAPI_FUNC(int) 1528 PyAPI_FUNC(int)
1529 PyRun_InteractiveLoop(FILE *f, const char *p) 1529 PyRun_InteractiveLoop(FILE *f, const char *p)
1530 { 1530 {
1531 return PyRun_InteractiveLoopFlags(f, p, NULL); 1531 return PyRun_InteractiveLoopFlags(f, p, NULL);
1532 } 1532 }
1533 1533
1534 #ifdef __cplusplus 1534 #ifdef __cplusplus
1535 } 1535 }
1536 #endif 1536 #endif
LEFTRIGHT
« Python/ast.c ('k') | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

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