Commit Graph

352 Commits

Author SHA1 Message Date
Dave Halter cef9f1bdbd Fix one-line error recovery for all things that are using a suite
Fixes https://github.com/davidhalter/jedi/issues/1138.
2018-06-12 12:56:27 +02:00
Aaron Meurer 34154d05a0 Don't mutate the standard library token.tok_name dictionary (#42)
* Don't mutate the standard library token.tok_name dictionary

Fixes #41.

* More robust test that tok_name isn't mutated

This test now works in Python 2.7, and actually tests something in Python 3.7,
and it's better anyway because it tests the whole dictionary instead of just
one token.

* Fix test_tok_name_copied in Python 3.7 and PyPy

Apparently Python 3.7 adds N_TOKENS to the tok_name dictionary, and PyPy
doesn't have NT_OFFSET in it.
2018-06-08 18:46:16 +02:00
Dave Halter c2eacdb81c The diff parser was slighly off with prefixes, fixes #1121 2018-05-20 19:13:50 +02:00
Dave Halter f20106d88e Fix a prefix issue with error leafs. 2018-04-22 19:28:30 +02:00
Dave Halter 8eda8decea Fix whitespace issues with prefixes 2018-04-07 15:34:58 +02:00
Dave Halter cba4f2ccc1 Fix the syntax errors from f-strings 2018-04-07 02:14:35 +02:00
Dave Halter 8f1a436ba1 Remove the old f-string grammar and fix the tests with the new syntax 2018-04-07 02:11:26 +02:00
Dave Halter 9d2ce4bcd4 Fix a few fstring error gatherings 2018-04-06 09:50:07 +02:00
Dave Halter 7c7f4f4e54 Fix a test 2018-04-05 00:45:23 +02:00
Dave Halter 065da34272 Fix an issue in the diff parser about endmarker newlines
This was discovered in https://github.com/davidhalter/jedi/issues/1000.
2018-03-11 23:41:18 +01:00
Alisdair Robertson 647073b1b9 Iter raise statements in a Function (#16)
* Add Function.iter_raise_stmts method and tests

* Add Alisdair Robertson to AUTHORS.txt

* Cleanup Function.iter_raise_stmts and test

Decided not to try and exclude exceptions that would be caught by a try-catch
2017-10-28 13:35:49 +02:00
Dave Halter b944fb9145 Fix a test around rb/br string literals. 2017-09-02 14:09:15 +02:00
Dave Halter e79c0755eb iter_return_stmts should also return return statements without a value. 2017-09-02 12:32:32 +02:00
Dave Halter d3e58955a9 iter_yield_expr should not work correctly. 2017-09-01 09:34:01 +02:00
Dave Halter a21ec2c0ad Better yield/yield from support. 2017-09-01 01:06:07 +02:00
Dave Halter 68fa70b959 future_import_names is not public, at the moment. 2017-09-01 00:25:32 +02:00
Dave Halter fa0bf4951c Fix string prefixes for Python2. 2017-09-01 00:20:24 +02:00
Dave Halter db1079a7fe Actual support fo backticks. 2017-08-28 18:32:48 +02:00
Dave Halter cba82773d4 Small test refactoring, because not all fstrings errors from parso match the CPython equivalents. 2017-08-26 19:18:16 +02:00
Dave Halter 66606403c7 Most fstrings issues should be fixed now. 2017-08-26 19:15:09 +02:00
Dave Halter 5b7a01ba62 Finally add all fstring errors except the nested invalid syntax stuff that occurs in nested Python. 2017-08-26 12:16:06 +02:00
Dave Halter 68cc383d02 Do proper error recover for fstrings and fix another issue there. 2017-08-26 12:02:10 +02:00
Dave Halter 1893f77e15 Add issue "f-string: expecting }". 2017-08-26 11:53:59 +02:00
Dave Halter 296ecc6728 Add 'f-string: expressions nested too deeply' issue. 2017-08-26 11:10:04 +02:00
Dave Halter 7d4aa755a5 Add conversion issues. 2017-08-26 03:13:59 +02:00
Dave Halter 8a448303d1 Fix an issue that created an endless loop. 2017-08-26 03:08:10 +02:00
Dave Halter ede8a2139f Add some first f-string issues. 2017-08-25 22:09:58 +02:00
Dave Halter f3db064d7d Try to correctly calculate start positions. 2017-08-25 20:58:28 +02:00
Dave Halter 8bc54f5a29 Fix all the issues with f-string escapes. 2017-08-25 10:22:41 +02:00
Dave Halter 204e750dd5 Add more f-string tests. 2017-08-25 09:47:24 +02:00
Dave Halter 0c0a4b5a5d Add some fstring tests. 2017-08-24 01:39:28 +02:00
Dave Halter 88c3c0567a Rename TokenInfo to PythonToken. 2017-08-21 09:33:41 +02:00
Dave Halter 820e94e03a Move the error node checking to a rule. 2017-08-19 12:43:47 +02:00
Dave Halter 904f293830 Move annassign and starexprs. 2017-08-18 18:15:24 +02:00
Dave Halter 51f2de28c6 source_to_unicode -> python_bytes_to_unicode. 2017-08-15 20:07:24 +02:00
Dave Halter ab027885c7 Refactor splitlines -> split_lines. 2017-08-15 19:54:21 +02:00
Dave Halter 476d5fb0d1 Some Python2.7 fixes. 2017-08-15 19:34:47 +02:00
Dave Halter 86aa185136 Use source_to_unicode by default with errors='strict'. 2017-08-15 19:27:27 +02:00
Dave Halter e2c97e9675 Skip tests in PyPy that don't make sense to test. 2017-08-06 18:04:31 +02:00
Dave Halter 3c961e2b70 Rename .params to .get_params(). 2017-08-06 17:29:29 +02:00
Dave Halter 90edb2d0cf Move the iter_errors and normalizer methods to grammar.py. 2017-08-06 15:32:50 +02:00
Dave Halter 3e39a04bb1 Fix opening contexts at the right position. 2017-08-06 14:39:26 +02:00
Dave Halter 8382f338ca Fix some small issues around expr_stmt. 2017-08-06 02:52:52 +02:00
Dave Halter f4b51d91ee Add python3.4/3.3 issue 'can use starred expression only as assignment target'. 2017-08-06 01:38:05 +02:00
Dave Halter 97525958b6 Move failing examples to a separate file. 2017-08-06 00:46:05 +02:00
Dave Halter d33e45f4cd Rename a test function. 2017-08-06 00:38:14 +02:00
Dave Halter 0e3e393f37 Self test on parsos files to check if there's no syntax errors. 2017-08-05 23:39:44 +02:00
Dave Halter 065081f227 Fix two more TODOs about bytes in Python 2. 2017-08-05 23:12:33 +02:00
Dave Halter a2d6336028 General cleanup in syntax error detection. Adding a few comments. 2017-08-05 23:03:39 +02:00
Dave Halter c3aab1b148 Finally able to delete a function because all the tests were generalized. 2017-08-05 22:55:12 +02:00