Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
pluto
Commits
17add357
Commit
17add357
authored
Apr 24, 2020
by
Anders Blomdell
Browse files
Generalize AUTO generation somewhat
parent
3b3238cd
Changes
2
Show whitespace changes
Inline
Side-by-side
robotlab_safety/pluto_auto.py
View file @
17add357
...
@@ -17,11 +17,11 @@ class PlutoVariables:
...
@@ -17,11 +17,11 @@ class PlutoVariables:
pass
pass
def
codegen
(
self
,
expr
):
def
codegen
(
self
,
expr
):
m
=
re
.
match
(
'([^=]+)=A
LL\(
(.*)\
)
'
,
expr
)
m
=
re
.
match
(
'([^=]+)=A
ND\{(.*),
(.*)\
}
'
,
expr
)
if
m
:
if
m
:
lh
=
m
.
group
(
1
)
lh
=
m
.
group
(
1
)
regexp
=
m
.
group
(
2
).
replace
(
'*'
,
'.*'
)
regexp
=
m
.
group
(
2
).
replace
(
'*'
,
'.*'
)
rh
=
[
"(%s+/SM_Pluto%d_Present)"
%
(
v
,
self
.
by_name
[
v
][
0
])
rh
=
[
m
.
group
(
3
).
format
(
v
,
pluto
=
self
.
by_name
[
v
][
0
])
for
v
in
self
.
by_name
if
re
.
match
(
regexp
,
v
)]
for
v
in
self
.
by_name
if
re
.
match
(
regexp
,
v
)]
return
(
"%s=%s"
%
(
lh
,
'*'
.
join
(
rh
)))
return
(
"%s=%s"
%
(
lh
,
'*'
.
join
(
rh
)))
raise
Exception
(
'Invalid expression'
,
expr
)
raise
Exception
(
'Invalid expression'
,
expr
)
...
...
robotlab_safety/safety_2020.sps
View file @
17add357
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
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