Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pycomsdk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
com
pycomsdk
Commits
fcfb8126
Commit
fcfb8126
authored
5 years ago
by
Savva Golubitsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
array of objects changed to dict
parent
3b1e99df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
parser.py
comsdk/parser.py
+8
-7
No files found.
comsdk/parser.py
View file @
fcfb8126
...
...
@@ -10,7 +10,6 @@ scope = [
class
Stmt
():
__slots__
=
(
'name'
,
'module'
,
'entry_func'
,
'predicate'
,
...
...
@@ -19,10 +18,9 @@ class Stmt():
'morphism'
,
'parallelism'
)
def
__init__
(
self
,
name
):
def
__init__
(
self
):
for
slot
in
self
.
__slots__
:
setattr
(
self
,
slot
,
None
)
self
.
name
=
name
def
__str__
(
self
):
stri
=
""
...
...
@@ -42,18 +40,21 @@ if graphcheck is None:
# Все что до __BEGIN__ считается объявлением
beg
=
re
.
search
((
scope
[
0
]),
dotfile
)
.
start
()
stmts
=
[]
stmts
=
{}
rawstmts
=
re
.
findall
(
r"\w+\s\[.*\]"
,
dotfile
[:
beg
])
for
raw
in
rawstmts
:
res
=
raw
.
split
(
r" "
,
1
)
st
=
Stmt
(
res
[
0
]
)
st
=
Stmt
()
rs
=
res
[
1
][
1
:
-
1
]
.
split
(
r", "
)
for
r
in
rs
:
r
=
r
.
split
(
r"="
,
1
)
for
s
in
st
.
__slots__
:
if
s
==
r
[
0
]:
setattr
(
st
,
s
,
r
[
1
])
print
(
st
)
stmts
.
append
(
st
)
stmts
[
res
[
0
]]
=
st
for
s
in
stmts
:
print
(
s
,
stmts
[
s
])
This diff is collapsed.
Click to expand it.
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