Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
New upstream version 1.1.0
· 378a3e92
Michael R. Crusoe
authored
Oct 07, 2017
378a3e92
Updated version 1.1.0 from 'upstream/1.1.0'
· ab2d87ed
Michael R. Crusoe
authored
Oct 07, 2017
with Debian dir 9ff0dfb312939220713fcb9586b516f1f6c884e4
ab2d87ed
new upstream version
· 9a6c41e8
Michael R. Crusoe
authored
Oct 07, 2017
9a6c41e8
Show whitespace changes
Inline
Side-by-side
PKG-INFO
View file @
9a6c41e8
Metadata-Version: 1.1
Name: typed-ast
Version: 1.
0.4
Version: 1.
1.0
Summary: a fork of Python 2 and 3 ast modules with type comment support
Home-page: https://github.com/python/typed_ast
Author: David Fisher
...
...
ast27/Custom/typed_ast.c
View file @
9a6c41e8
...
...
@@ -239,6 +239,7 @@ string_object_to_py_ast(const char *str, PyObject *filename, int start,
PyCompilerFlags
*
flags
)
{
mod_ty
mod
;
PyObject
*
result
;
PyArena
*
arena
=
PyArena_New
();
if
(
arena
==
NULL
)
return
NULL
;
...
...
@@ -249,7 +250,7 @@ string_object_to_py_ast(const char *str, PyObject *filename, int start,
return
NULL
;
}
PyObject
*
result
=
Ta27AST_mod2obj
(
mod
);
result
=
Ta27AST_mod2obj
(
mod
);
PyArena_Free
(
arena
);
return
result
;
}
...
...
ast27/Parser/tokenizer.c
View file @
9a6c41e8
...
...
@@ -1352,6 +1352,10 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
};
char
cbuf
[
80
];
char
*
tp
,
**
cp
;
/* used for type comment checks */
const
char
*
prefix
,
*
p
,
*
type_start
;
tp
=
cbuf
;
do
{
*
tp
++
=
c
=
tok_nextc
(
tok
);
...
...
@@ -1377,7 +1381,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
c
=
tok_nextc
(
tok
);
/* check for type comment */
const
char
*
prefix
,
*
p
,
*
type_start
;
p
=
tok
->
start
;
prefix
=
type_comment_prefix
;
while
(
*
prefix
&&
p
<
tok
->
cur
)
{
...
...
ast27/Python/ast.c
View file @
9a6c41e8
...
...
@@ -2303,6 +2303,7 @@ ast_for_class_bases(struct compiling *c, const node* n)
static
stmt_ty
ast_for_expr_stmt
(
struct
compiling
*
c
,
const
node
*
n
)
{
int
num
;
REQ
(
n
,
expr_stmt
);
/* expr_stmt: testlist (augassign (yield_expr|testlist)
| ('=' (yield_expr|testlist))* [TYPE_COMMENT])
...
...
@@ -2311,7 +2312,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
| '<<=' | '>>=' | '**=' | '//='
test: ... here starts the operator precendence dance
*/
int
num
=
NCH
(
n
);
num
=
NCH
(
n
);
if
(
num
==
1
||
(
num
==
2
&&
TYPE
(
CHILD
(
n
,
1
))
==
TYPE_COMMENT
))
{
expr_ty
e
=
ast_for_testlist
(
c
,
CHILD
(
n
,
0
));
...
...
@@ -3516,12 +3517,13 @@ parsenumber(struct compiling *c, const char *s)
/* Make a copy without the trailing 'L' */
size_t
len
=
end
-
s
+
1
;
char
*
copy
=
malloc
(
len
);
PyObject
*
result
;
if
(
copy
==
NULL
)
return
PyErr_NoMemory
();
memcpy
(
copy
,
s
,
len
);
copy
[
len
-
1
]
=
'\0'
;
old_style_octal
=
len
>
2
&&
copy
[
0
]
==
'0'
&&
copy
[
1
]
>=
'0'
&&
copy
[
1
]
<=
'9'
;
PyObject
*
result
=
PyLong_FromString
(
copy
,
(
char
**
)
0
,
old_style_octal
?
8
:
0
);
result
=
PyLong_FromString
(
copy
,
(
char
**
)
0
,
old_style_octal
?
8
:
0
);
free
(
copy
);
return
result
;
}
...
...
ast3/Custom/typed_ast.c
View file @
9a6c41e8
...
...
@@ -249,6 +249,7 @@ string_object_to_py_ast(const char *str, PyObject *filename, int start,
PyCompilerFlags
*
flags
,
int
feature_version
)
{
mod_ty
mod
;
PyObject
*
result
;
PyArena
*
arena
=
PyArena_New
();
if
(
arena
==
NULL
)
return
NULL
;
...
...
@@ -259,7 +260,7 @@ string_object_to_py_ast(const char *str, PyObject *filename, int start,
return
NULL
;
}
PyObject
*
result
=
Ta3AST_mod2obj
(
mod
);
result
=
Ta3AST_mod2obj
(
mod
);
PyArena_Free
(
arena
);
return
result
;
}
...
...
ast3/Python/ast.c
View file @
9a6c41e8
...
...
@@ -2274,6 +2274,7 @@ ast_for_atom(struct compiling *c, const node *n)
return
str
;
}
case
NUMBER
:
{
PyObject
*
pynum
;
const
char
*
s
=
STR
(
ch
);
/* Underscores in numeric literals are only allowed in Python 3.6 or greater */
/* Check for underscores here rather than in parse_number so we can report a line number on error */
...
...
@@ -2282,7 +2283,7 @@ ast_for_atom(struct compiling *c, const node *n)
"Underscores in numeric literals are only supported in Python 3.6 and greater"
);
return
NULL
;
}
PyObject
*
pynum
=
parsenumber
(
c
,
s
);
pynum
=
parsenumber
(
c
,
s
);
if
(
!
pynum
)
return
NULL
;
...
...
@@ -3040,6 +3041,7 @@ ast_for_testlist(struct compiling *c, const node* n)
static
stmt_ty
ast_for_expr_stmt
(
struct
compiling
*
c
,
const
node
*
n
)
{
int
num
;
REQ
(
n
,
expr_stmt
);
/* expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) |
('=' (yield_expr|testlist_star_expr))* [TYPE_COMMENT])
...
...
@@ -3049,7 +3051,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
| '<<=' | '>>=' | '**=' | '//='
test: ... here starts the operator precedence dance
*/
int
num
=
NCH
(
n
);
num
=
NCH
(
n
);
if
(
num
==
1
||
(
num
==
2
&&
TYPE
(
CHILD
(
n
,
1
))
==
TYPE_COMMENT
))
{
expr_ty
e
=
ast_for_testlist
(
c
,
CHILD
(
n
,
0
));
...
...
debian/changelog
View file @
9a6c41e8
python3-typed-ast (1.1.0-1) unstable; urgency=medium
* New upstream version.
-- Michael R. Crusoe <michael.crusoe@gmail.com> Sat, 07 Oct 2017 10:06:39 -0700
python3-typed-ast (1.0.4-1) unstable; urgency=medium
* New upstream version
...
...
debian/control
View file @
9a6c41e8
...
...
@@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 9),
python3-all,
python3-setuptools,
python3-all-dev
Standards-Version: 4.
0.0
Standards-Version: 4.
1.1
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/python3-typed-ast.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/python3-typed-ast.git
Homepage: http://www.mypy-lang.org/
...
...
setup.py
View file @
9a6c41e8
...
...
@@ -87,7 +87,7 @@ based on the CPython 2.7 and 3.6 parsers.
"""
.
strip
()
setup
(
name
=
'
typed-ast
'
,
version
=
'
1.
0.4
'
,
version
=
'
1.
1.0
'
,
description
=
'
a fork of Python 2 and 3 ast modules with type comment support
'
,
long_description
=
long_description
,
author
=
'
David Fisher
'
,
...
...
typed_ast.egg-info/PKG-INFO
View file @
9a6c41e8
Metadata-Version: 1.1
Name: typed-ast
Version: 1.
0.4
Version: 1.
1.0
Summary: a fork of Python 2 and 3 ast modules with type comment support
Home-page: https://github.com/python/typed_ast
Author: David Fisher
...
...