Dave Halter
2a691eefff
Including pgen2 tests from the cpython repo.
2015-12-26 03:15:09 +01:00
Dave Halter
ab5d0ed72b
Starting with Python 3.4 from is not a token that always is a "new" statement.
2015-12-26 02:47:22 +01:00
Dave Halter
eb2e41f771
Grammar versioning has now a smoother interface.
2015-12-25 19:30:25 +01:00
Dave Halter
a373e34229
The parser without error recovery raises an error now if he's not able to parse something.
2015-12-25 18:53:05 +01:00
Dave Halter
c15551ccc1
Errortokens should also make the parser fail in the normal parser.
2015-12-20 23:11:52 +01:00
Dave Halter
c4906e0e3f
Rework the parser so we can use arbitrary start nodes of the syntax.
...
This also includes a rework for error recovery in the parser. This is now just possible for file_input parsing, which means for full files.
Includes also a refactoring of the tokenizer. No more do we have to add an additional newline, because it now works correctly (removes certain confusion.
2015-12-20 22:25:41 +01:00
Dave Halter
ab91cfa3b5
Fix: print_stmt was not actually cared for in Python 2.7, #662 .
2015-12-15 13:08:37 +01:00
Dave Halter
10df0f933f
Remove the strange check in the parser to always create expr_stmt and file_input.
2015-03-05 15:30:07 +01:00
Dave Halter
9c2e73d460
Add syntax errors to the parser.
2015-03-04 17:12:51 +01:00
Dave Halter
3a5b2d396e
Failed statements should not lead to parser fails.
2015-02-22 20:29:22 +01:00
Dave Halter
0c1bbf78e2
Rename SubModule to Module, because that's a more fitting description. There were reasons for the name before the new fast parser, but those don't exist anymore.
2015-02-05 14:16:43 +01:00
Dave Halter
109fdc53e0
Fix the remaining fast parser issues.
2015-02-05 01:13:00 +01:00
Dave Halter
fdfe17ada5
Import the token IDs directly, this way we minimize lookups.
2015-02-05 00:44:01 +01:00
Dave Halter
dce952aec6
Fix an issue with omited dedents in the parser.
2015-02-05 00:11:12 +01:00
Dave Halter
e23e354fe8
Simplified the line splitting and with that a few other things in the fast parser.
2015-02-03 22:22:57 +01:00
Dave Halter
66dfa59286
Fix some endmarker prefix issues in the fast parser.
2015-02-03 22:09:55 +01:00
Dave Halter
f9fe6b47eb
Fix error statement stacks positions.
2015-02-02 10:43:47 +01:00
Dave Halter
bc118e8047
Simplify the fast parser tokenizer more. Now it is more readable and less buggy (+bugfixes).
2015-01-31 20:09:44 +01:00
Dave Halter
413da3b790
Remove the line_offset calculation. We can now also remove it from tokenize. With the position_modifier we have enough tools to change a position, we don't need to do that in tokenize.py.
2015-01-29 17:57:01 +01:00
Dave Halter
c7563470b1
We don't need set_global_names, just set the attribute directly.
2015-01-28 15:00:17 +01:00
Dave Halter
5e8f8f7a8d
Fix issues with error correction / newline correction.
2015-01-27 12:24:54 +01:00
Dave Halter
88a3e25814
Fix newline stuff for empty parsers.
2015-01-27 01:15:39 +01:00
Dave Halter
39e869d146
Test added newline module end_pos as well.
2015-01-26 22:02:11 +01:00
Dave Halter
07c60d7ff6
Fix DEDENT issues in _remove_newline.
2015-01-26 21:17:50 +01:00
Dave Halter
61e2bba380
Tests and implementation to remove the last newline again in the parser tree, to be able to exactly reproduce the parser input.
2015-01-26 21:07:14 +01:00
Dave Halter
446f5b9018
Fix issues with the right count of parsers used.
2015-01-24 20:19:03 +01:00
Dave Halter
4d6afd3c99
Fix fast parser tests.
2015-01-24 00:06:16 +01:00
Dave Halter
d6b3b76d26
First fast parser version that actually let a test pass.
2015-01-19 00:39:51 +01:00
Dave Halter
cf223a71f5
Add a position modifier for the fast parser. Not yet in use though.
2015-01-15 13:57:56 +01:00
Dave Halter
cc64265187
Grammar modifications so that the Python2.7 grammar looks more like the Python 3.4 grammar.
2015-01-13 01:05:13 +01:00
Dave Halter
f59e05f8e7
Switch grammars depending on Python version.
2015-01-12 13:33:44 +01:00
Dave Halter
582b9b01af
Get invalid INDENTs working.
...
The following DEDENT's are removed.
2015-01-12 12:22:57 +01:00
Dave Halter
5c98f6cf04
Suites don't have to contain statements anymore, this makes autocompletion better in certain cases.
2015-01-12 01:11:46 +01:00
Dave Halter
83a94c12c9
Correct global name issues.
2015-01-08 01:20:53 +01:00
Dave Halter
d9d3740c92
Trying to replace the old pgen2 token module with a token module more tightly coupled to the standard library.
2014-12-16 01:52:15 +01:00
Dave Halter
eaace104dd
Replace the tokenizer's output with a tuple (switching back from a Token class).
2014-12-16 00:10:07 +01:00
Dave Halter
680fdd574b
Remove some old unused tokenize stuff.
2014-12-15 17:44:40 +01:00
Dave Halter
b911a39fb4
The driver file is now empty.
2014-12-15 17:27:27 +01:00
Dave Halter
55a6dbc8a2
Remove the old driver code of pgen2.
2014-12-15 17:18:01 +01:00
Dave Halter
4e0172a915
Partial parser.__init__' cleanup.
2014-12-15 16:21:35 +01:00
Dave Halter
af303e10c8
Statement -> ExprStmt.
2014-12-15 16:18:09 +01:00
Dave Halter
bb747a83e8
Small fix with big impact for the previously done simple_stmt error recovery. Now it actually works.
2014-12-07 19:45:19 +01:00
Dave Halter
db636c35ae
Error recovery should not delete parts of simple_stmt.
2014-12-07 18:04:55 +01:00
Dave Halter
425741e285
Fix assertion/isinstance type information.
2014-12-02 17:45:19 +01:00
Dave Halter
3cc4da28ed
Fix lambda_nocond.
2014-12-01 11:56:28 +01:00
Dave Halter
bcd998ae02
Lambdas are own namespaces and deserve their own used_names dictionary in the parser.
2014-12-01 11:49:52 +01:00
Dave Halter
88853c78f4
Get lambdas mostly working.
2014-12-01 02:47:48 +01:00
Dave Halter
417db4e83f
suites without indent can also be deleted.
2014-11-29 13:30:21 +01:00
Dave Halter
a7560069b0
Fixes for issues with empty compound_stmt. We always remove a whole stmt and just a funcdef as an error correction.
2014-11-29 13:25:31 +01:00
Dave Halter
3fb1934462
Fix invalid test issues.
2014-11-29 01:35:26 +01:00