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
093a4d4d
Commit
093a4d4d
authored
Apr 18, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Struct conversion handling of default patterns with struct arrays
parent
68b6eae4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/Convert/Struct.hs
+14
-2
No files found.
src/Convert/Struct.hs
View file @
093a4d4d
...
...
@@ -213,8 +213,20 @@ convertAsgn structs types (lhs, expr) =
where
e'
=
convertExpr
(
IntegerVector
t
sg
rs
)
e
convertExpr
(
Struct
(
Packed
sg
)
fields
(
_
:
rs
))
(
Bit
e
_
)
=
convertExpr
(
Struct
(
Packed
sg
)
fields
rs
)
e
convertExpr
(
t
@
(
Struct
(
Packed
_
)
fields
_
))
(
Pattern
[(
Just
"default"
,
e
)])
=
convertExpr
t
$
Pattern
$
take
(
length
fields
)
(
repeat
(
Nothing
,
e
))
convertExpr
(
Struct
(
Packed
sg
)
fields
rs
)
(
Pattern
[(
Just
"default"
,
e
)])
=
if
Map
.
notMember
structTf
structs
then
Pattern
[(
Just
"default"
,
e
)]
else
if
null
rs
then
expanded
else
if
length
rs
==
1
then
Repeat
(
rangeSize
$
head
rs
)
[
expanded
]
else
error
$
"default pattern for multi-dimensional struct array "
++
show
structTf
++
" is not allowed"
where
structTf
=
Struct
(
Packed
sg
)
fields
expanded
=
convertExpr
(
structTf
[]
)
$
Pattern
$
take
(
length
fields
)
(
repeat
(
Nothing
,
e
))
convertExpr
(
Struct
(
Packed
sg
)
fields
[]
)
(
Pattern
itemsOrig
)
=
if
length
items
/=
length
fields
then
error
$
"struct pattern "
++
show
items
++
...
...
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