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
006e0e08
Commit
006e0e08
authored
Apr 10, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed struct pattern field ordering
parent
346d7efb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/Convert/Struct.hs
+5
-4
No files found.
src/Convert/Struct.hs
View file @
006e0e08
...
...
@@ -6,8 +6,8 @@
module
Convert.Struct
(
convert
)
where
import
Data.Maybe
(
isJust
)
import
Data.List
(
sortOn
)
import
Data.Maybe
(
fromJust
,
isJust
)
import
Data.List
(
elemIndex
,
sortOn
)
import
Data.Tuple
(
swap
)
import
Control.Monad.Writer
import
qualified
Data.Map.Strict
as
Map
...
...
@@ -229,8 +229,9 @@ convertAsgn structs types (lhs, expr) =
then
zip
(
map
(
Just
.
snd
)
fields
)
(
map
snd
items
)
else
items
items''
=
map
subMap
items'
fieldRange
=
\
(
Just
x
,
_
)
->
lookupUnstructRange
structTf
x
exprs
=
map
snd
$
reverse
$
sortOn
fieldRange
items''
fieldNames
=
map
snd
fields
itemPosition
=
\
(
Just
x
,
_
)
->
fromJust
$
elemIndex
x
fieldNames
exprs
=
map
snd
$
sortOn
itemPosition
items''
convertExpr
_
other
=
other
-- try expression conversion by looking at the *innermost* type first
...
...
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