Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
39dc5820
Commit
39dc5820
authored
Jul 07, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for subscript setitem
parent
d84f8bc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
trans/transpiler/phases/typing/block.py
trans/transpiler/phases/typing/block.py
+10
-1
No files found.
trans/transpiler/phases/typing/block.py
View file @
39dc5820
...
...
@@ -96,8 +96,17 @@ class ScoperBlockVisitor(ScoperVisitor):
attr_type
=
self
.
expr
().
visit
(
target
)
attr_type
.
unify
(
decl_val
)
return
False
elif
isinstance
(
target
,
ast
.
Subscript
):
expr
=
self
.
expr
()
left
=
expr
.
visit
(
target
.
value
)
args
=
target
.
slice
if
type
(
target
.
slice
)
==
tuple
else
[
target
.
slice
]
args
=
[
expr
.
visit
(
e
)
for
e
in
args
]
if
len
(
args
)
==
1
:
args
=
args
[
0
]
expr
.
make_dunder
([
left
,
args
,
decl_val
],
"setitem"
)
return
False
else
:
raise
NotImplementedError
(
target
)
raise
NotImplementedError
(
ast
.
unparse
(
target
)
)
def
visit_FunctionDef
(
self
,
node
:
ast
.
FunctionDef
):
argtypes
=
[
self
.
visit_annotation
(
arg
.
annotation
)
for
arg
in
node
.
args
.
args
]
...
...
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