Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tom Niget
typon
Commits
26b46351
Commit
26b46351
authored
Jul 07, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fields to member list of class
parent
4855c26b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
trans/transpiler/phases/typing/stdlib.py
trans/transpiler/phases/typing/stdlib.py
+8
-1
No files found.
trans/transpiler/phases/typing/stdlib.py
View file @
26b46351
...
@@ -30,7 +30,14 @@ class StdlibVisitor(NodeVisitorSeq):
...
@@ -30,7 +30,14 @@ class StdlibVisitor(NodeVisitorSeq):
self
.
scope
.
vars
[
node
.
targets
[
0
].
id
]
=
VarDecl
(
VarKind
.
LOCAL
,
self
.
visit
(
node
.
value
))
self
.
scope
.
vars
[
node
.
targets
[
0
].
id
]
=
VarDecl
(
VarKind
.
LOCAL
,
self
.
visit
(
node
.
value
))
def
visit_AnnAssign
(
self
,
node
:
ast
.
AnnAssign
):
def
visit_AnnAssign
(
self
,
node
:
ast
.
AnnAssign
):
self
.
scope
.
vars
[
node
.
target
.
id
]
=
VarDecl
(
VarKind
.
LOCAL
,
self
.
anno
().
visit
(
node
.
annotation
))
ty
=
self
.
anno
().
visit
(
node
.
annotation
)
if
self
.
cur_class
:
assert
isinstance
(
self
.
cur_class
,
TypeType
)
if
isinstance
(
self
.
cur_class
.
type_object
,
ABCMeta
):
raise
NotImplementedError
else
:
self
.
cur_class
.
type_object
.
members
[
node
.
target
.
id
]
=
ty
.
gen_sub
(
self
.
cur_class
.
type_object
,
self
.
typevars
)
self
.
scope
.
vars
[
node
.
target
.
id
]
=
VarDecl
(
VarKind
.
LOCAL
,
ty
)
def
visit_ImportFrom
(
self
,
node
:
ast
.
ImportFrom
):
def
visit_ImportFrom
(
self
,
node
:
ast
.
ImportFrom
):
pass
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment