Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sv2v
Overview
Overview
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
lvzhengyang
sv2v
Commits
4bc3eb8d
Commit
4bc3eb8d
authored
Mar 08, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more gracefully unknown type handling in Struct conversion
parent
bddb8cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/Convert/Struct.hs
+7
-2
No files found.
src/Convert/Struct.hs
View file @
4bc3eb8d
...
@@ -128,12 +128,16 @@ convertAsgn structs types (lhs, expr) =
...
@@ -128,12 +128,16 @@ convertAsgn structs types (lhs, expr) =
Nothing
->
(
Implicit
[]
,
LHSIdent
x
)
Nothing
->
(
Implicit
[]
,
LHSIdent
x
)
Just
t
->
(
t
,
LHSIdent
x
)
Just
t
->
(
t
,
LHSIdent
x
)
convertLHS
(
LHSBit
l
e
)
=
convertLHS
(
LHSBit
l
e
)
=
(
tf
$
tail
rs
,
LHSBit
l'
e
)
if
null
rs
then
(
Implicit
[]
,
LHSBit
l'
e
)
else
(
tf
$
tail
rs
,
LHSBit
l'
e
)
where
where
(
t
,
l'
)
=
convertLHS
l
(
t
,
l'
)
=
convertLHS
l
(
tf
,
rs
)
=
typeRanges
t
(
tf
,
rs
)
=
typeRanges
t
convertLHS
(
LHSRange
l
r
)
=
convertLHS
(
LHSRange
l
r
)
=
(
tf
rs'
,
LHSRange
l'
r
)
if
null
rs
then
(
Implicit
[]
,
LHSRange
l'
r
)
else
(
tf
rs'
,
LHSRange
l'
r
)
where
where
(
t
,
l'
)
=
convertLHS
l
(
t
,
l'
)
=
convertLHS
l
(
tf
,
rs
)
=
typeRanges
t
(
tf
,
rs
)
=
typeRanges
t
...
@@ -150,6 +154,7 @@ convertAsgn structs types (lhs, expr) =
...
@@ -150,6 +154,7 @@ convertAsgn structs types (lhs, expr) =
hi'
=
BinOp
Add
base
$
BinOp
Sub
hi
lo
hi'
=
BinOp
Add
base
$
BinOp
Sub
hi
lo
lo'
=
base
lo'
=
base
tr
=
(
simplify
hi'
,
simplify
lo'
)
tr
=
(
simplify
hi'
,
simplify
lo'
)
Implicit
_
->
(
Implicit
[]
,
LHSDot
l'
x
)
_
->
error
$
"convertLHS encountered dot for bad type: "
++
show
(
t
,
l
,
x
)
_
->
error
$
"convertLHS encountered dot for bad type: "
++
show
(
t
,
l
,
x
)
where
where
(
t
,
l'
)
=
convertLHS
l
(
t
,
l'
)
=
convertLHS
l
...
...
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