Commit Graph

352 Commits

Author SHA1 Message Date
Dave Halter 0dea94c801 Bump version for the next release 2017-11-05 15:11:51 +01:00
Dave Halter 5c1e953c17 Add the v0.1.1 changes to the changelog 2017-11-05 12:43:55 +01:00
Dave Halter a29ec25598 Use os.path.join instead of a slash
Fixes #20
2017-11-04 14:58:57 +01:00
Mike Morearty 04360cdfe7 Load from cache even when code was given
Change Grammar._parse() to try load_module() even if code was passed
to it.

In many cases, _parse() is passed both the code and the path to the .py
file. E.g. in jedi-vim if you type "import foo.", then every .py file in
directory "foo" will reach Grammar._parse() with both the `code` and the
`path` variables filled in. This change allows the cache to be used in
those cases.
2017-11-04 11:16:28 +01:00
Robin Roth 4824534f8a Support async for statement 2017-11-01 19:48:24 +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
Alisdair Robertson 5b5d855fab Clarify what a prefix is 2017-10-26 15:03:05 +02:00
Alisdair Robertson 04e18ebb01 Docstring for BaseNode.get_leaf_for_position 2017-10-26 15:03:05 +02:00
Alisdair Robertson d3cfcc24b8 Correct seperator for param anotation docstring 2017-10-26 15:03:05 +02:00
Alisdair Robertson 89646e0970 Fix Name role in PythonMixin.get_name_of_position docstring 2017-10-26 15:03:05 +02:00
Mike Morearty bc8566e964 Use cPickle instead of pickle
Change Parso to use cPickle instead of pickle when reading/writing the
cache, which speeds up the cache significantly.

In Python 2, cPickle is up to 1000 times faster than pickle. (In Python
3, if you "import pickle", you are actually getting cPickle.)

As is the convention, the code tries to import cPickle, and if that
fails, it falls back to pickle.

This has a big impact for users of jedi-vim, since in many cases Vim
uses Python 2.
2017-10-24 01:10:32 +02:00
Mike Morearty 89932c368d Fix the cache path
Any caller of Parso can specify a cache path, and if none is specified,
parso will fall back to a default.

Parso's code to read a file from the cache handled this correctly; but
its code to write a file to the cache had a bug -- any override of the
default was ignored.

In the case of Jedi, this is a significant problem, since Jedi overrides
the default. The result is that files will be written to the cache, but
will then never be found when reading from the cache.
2017-10-24 01:08:57 +02:00
Dave Halter dcae8cda92 Merge branch 'master' of github.com:davidhalter/parso 2017-10-12 22:59:24 +02:00
Dave Halter 1f6683b8ac Don't use the root logger
The root logger should not be used in parso. Use custom loggers for each module. Fixes #9.
2017-10-12 22:59:17 +02:00
Håken Lid 0ec02e1d7f Add support for python 3.7 (#8)
grammar37.txt is simply a copy of grammar36.txt, since there's no syntax
changes in 3.7

https://docs.python.org/3.7/whatsnew/3.7.html
2017-10-02 00:48:09 +02:00
Dave Halter 26e882d19c Magic names were not validated correctly
Fixes #6.
2017-09-14 09:04:08 +02:00
Dave Halter 3a506b44ac Remove dead code in get_definition. Fixes #4. 2017-09-05 08:59:16 +02:00
Dave Halter e0f74dd8ad Bump the Python version. 2017-09-04 22:54:48 +02:00
Dave Halter 05a8236d3f Small corrections. 2017-09-04 22:51:17 +02:00
Dave Halter 2067845cef Try to recommend using parso without diff_cache. 2017-09-04 22:03:12 +02:00
Dave Halter dcdd3bbc8e More tree docstrings. 2017-09-04 21:58:48 +02:00
Dave Halter 82868580a2 Fix a docstring. 2017-09-04 21:38:57 +02:00
Dave Halter a18baf0d2c The readme should match the documentation. 2017-09-04 21:31:45 +02:00
Dave Halter 032c7563c4 Document issues about our internal tree. 2017-09-04 20:54:48 +02:00
Dave Halter b83c641057 Better documentation for leafs/nodes. 2017-09-04 20:19:00 +02:00
Dave Halter 97d9aeafb7 Bettter NoeOrLeaf docstrings. 2017-09-04 09:48:23 +02:00
Dave Halter 7a277c7302 Move to python 3.6 intersphinx. 2017-09-03 23:32:43 +02:00
Dave Halter 5993765e0a Better documentation of issues. 2017-09-03 23:01:34 +02:00
Dave Halter 435d310c2b More general overhaul of the documentation. 2017-09-03 22:20:03 +02:00
Dave Halter 8aa280342a Rework the parse documentation. 2017-09-03 22:08:28 +02:00
Dave Halter 73c61bca4a More docstrings. 2017-09-03 18:36:03 +02:00
Dave Halter 60ed141d80 A few documentation improvements. 2017-09-03 14:02:53 +02:00
Dave Halter 091e72562c Bump version. 2017-09-03 01:14:35 +02:00
Dave Halter fc6202ffb3 Rename _get_definition to get_definition. 2017-09-03 00:42:06 +02:00
Dave Halter 0e201810fa Remove the old get_definition function. 2017-09-03 00:41:39 +02:00
Dave Halter 7a9739c5d6 Add an option to the new get_definition. 2017-09-02 23:45:50 +02:00
Dave Halter 1bf9ca94bb A small docstring. 2017-09-02 22:41:15 +02:00
Dave Halter a4d28d2eda Rework is_definition. 2017-09-02 17:26:29 +02:00
Dave Halter 7a85409da7 Get rid of one more isinstance. 2017-09-02 13:59:21 +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 9ab5937a3c Fix yield scanning. 2017-09-01 18:03:47 +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 910a660c6f Fix some todos. 2017-09-01 00:35:22 +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 ba2c0ad41a Bump version. 2017-08-31 22:44:15 +02:00
Dave Halter 5c3304f7c2 Move start symbols a bit. 2017-08-31 19:39:27 +02:00
Dave Halter 9ae1b000de Small whitespace change. 2017-08-30 16:10:36 +02:00
Dave Halter 20f3fd101a Fix py3.3 and remove a print. 2017-08-28 21:47:00 +02:00