Skip to content

Instantly share code, notes, and snippets.

@miyakogi
Last active January 31, 2016 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyakogi/a7675a5a6e0d3eaea982 to your computer and use it in GitHub Desktop.
Save miyakogi/a7675a5a6e0d3eaea982 to your computer and use it in GitHub Desktop.
Jedi's patch to support type hints in python3
diff --git a/jedi/parser/grammar3.4.txt b/jedi/parser/grammar3.4.txt
index d4a32b8..45f733f 100644
--- a/jedi/parser/grammar3.4.txt
+++ b/jedi/parser/grammar3.4.txt
@@ -27,7 +27,8 @@ parameters: '(' [typedargslist] ')'
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef)
-tfpdef: NAME [':' test]
+tname: NAME [':' test]
+tfpdef: tname
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
| '*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef)
@miyakogi
Copy link
Author

気持ち悪いけど変更点を減らして2.7に近づけるためにalias的な感じに修正

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment