1
0
forked from VimPlug/jedi
Commit Graph

198 Commits

Author SHA1 Message Date
Dave Halter 142f6652b5 Move toward ParserWithRecovery for the completion context.
It was simply not possible to do it with the normal parser, because of dedents.
2016-07-28 23:14:24 +02:00
Dave Halter ff47fab62a Remove Whitespace class and replace it with Newline and Endmarker. 2016-07-24 17:16:36 +02:00
Dave Halter e5f09e1c7d Fix an issue with end_pos of a module. 2016-07-08 00:03:52 +02:00
Dave Halter adcc1c2b51 Don't delete ErrorNode names. They are part of the parser now.
Fixes #594 and possibly also #590 and #579.
2016-07-07 18:33:45 +02:00
Dave Halter 9245181a8c Some python 2.7 (and 3.3) compatibility improvements. 2016-07-03 02:54:21 +02:00
Dave Halter 80aa9ad079 A small python 2 bugfix. 2016-06-22 00:45:14 +02:00
Dave Halter 6853bd70f4 Adding a token in pgen should have the same signature that the tokenizer uses. 2016-06-14 18:09:31 +02:00
Dave Halter 01ddacfec4 Generalize the tuple order of tokens. 2016-06-14 08:57:38 +02:00
Dave Halter 118ba7d833 A lot of stuff is not needed anymore, because of the recent refactorings. 2016-06-14 08:31:36 +02:00
Dave Halter 27f05de3b7 Fix a few more issues, mostly with the fast parser. 2016-06-13 18:21:17 +02:00
Dave Halter 82c76fa689 Merge with the linter branch (especially the changes of pep484. 2016-06-07 13:51:25 +02:00
Dave Halter 87a75fdfe4 Remove old unused code. 2016-06-06 09:27:43 +02:00
Dave Halter dd85fc6ffd Add error token in a normal way to the syntax tree as ErrorLeaf. 2016-06-05 14:49:57 +02:00
Dave Halter 5edcf47512 Break Interpreter completion even more in favor of a better solution in the future. 2016-06-03 19:31:42 +02:00
Dave Halter 0c7894b3e6 Fix a few fast parser tests. 2016-06-02 08:24:52 +02:00
Dave Halter ad8d730a57 More test fixes. 2016-05-31 01:12:07 +02:00
Dave Halter 4f6368e7eb Now ErrorLeaf and ErrorNode are part of the syntax tree. This makes probably sense. The documentation will follow once it's clear how they will shape out. 2016-05-30 00:34:58 +02:00
Dave Halter daa68b66ad Fix a few issues caused by the refactoring. 2016-05-29 19:49:35 +02:00
Dave Halter feef45f4bb Fixed all on_import tests. 2016-05-29 12:08:53 +02:00
Dave Halter 4714b464a6 Further import completion improvements. 2016-05-28 02:08:43 +02:00
Dave Halter cbba314286 Progress and actually passing a few tests. 2016-05-26 00:10:54 +02:00
Dave Halter d4a10929e2 Starting to create a way of how context sensitive completions can be made.
This involves playing heavily with the parser pgen2. We use its stack to check for all possible tokens/keywords.
2016-05-23 18:11:44 +02:00
Dave Halter c09a916ab5 Didn't load grammar for Python 2.6 correctly. 2016-01-27 17:52:42 -02:00
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