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
27147c54
Commit
27147c54
authored
Feb 24, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some tweaks to output formatting
parent
50b7bf28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
Language/SystemVerilog/AST.hs
+10
-6
No files found.
Language/SystemVerilog/AST.hs
View file @
27147c54
...
...
@@ -348,15 +348,19 @@ instance Show Stmt where
show
(
For
(
a
,
b
)
c
(
d
,
e
)
f
)
=
printf
"for (%s = %s; %s; %s = %s)
\n
%s"
a
(
show
b
)
(
show
c
)
d
(
show
e
)
$
indent
$
show
f
show
(
AsgnBlk
v
e
)
=
printf
"%s = %s;"
(
show
v
)
(
show
e
)
show
(
Asgn
v
e
)
=
printf
"%s <= %s;"
(
show
v
)
(
show
e
)
show
(
If
a
b
Null
)
=
printf
"if (%s)
\n
%s"
(
show
a
)
(
indent
$
show
b
)
show
(
If
a
b
c
)
=
printf
"if (%s)
\n
%s
\n
else
\n
%s"
(
show
a
)
(
indent
$
show
b
)
(
indent
$
show
c
)
show
(
Timing
t
s
)
=
printf
"@(%s) %s"
(
show
t
)
(
show
s
)
show
(
If
a
b
Null
)
=
printf
"if (%s)
\n
%s"
(
show
a
)
(
show
b
)
show
(
If
a
b
c
)
=
printf
"if (%s) %s
\n
else %s"
(
show
a
)
(
show
b
)
(
show
c
)
show
(
Timing
t
s
)
=
printf
"@(%s)%s"
(
show
t
)
rest
where
rest
=
case
s
of
Block
_
_
->
" "
++
(
show
s
)
_
->
"
\n
"
++
(
indent
$
show
s
)
show
(
Null
)
=
";"
type
Case
=
([
Expr
],
Stmt
)
showCase
::
(
Show
x
,
Show
y
)
=>
([
x
],
y
)
->
String
showCase
(
a
,
b
)
=
printf
"%s:
\n
%s"
(
commas
$
map
show
a
)
(
indent
$
show
b
)
showCase
(
a
,
b
)
=
printf
"%s:
%s"
(
commas
$
map
show
a
)
(
show
b
)
data
Sense
=
Sense
LHS
...
...
@@ -398,8 +402,8 @@ instance Show GenItem where
show
(
GenBlock
(
Just
x
)
i
)
=
printf
"begin : %s
\n
%s
\n
end"
x
(
indent
$
unlines'
$
map
show
i
)
show
(
GenCase
e
c
Nothing
)
=
printf
"case (%s)
\n
%s
\n
endcase"
(
show
e
)
(
indent
$
unlines'
$
map
showCase
c
)
show
(
GenCase
e
c
(
Just
d
))
=
printf
"case (%s)
\n
%s
\n\t
default:
\n
%s
\n
endcase"
(
show
e
)
(
indent
$
unlines'
$
map
showCase
c
)
(
indent
$
indent
$
show
d
)
show
(
GenIf
e
a
GenNull
)
=
printf
"if (%s)
\n
%s"
(
show
e
)
(
indent
$
show
a
)
show
(
GenIf
e
a
b
)
=
printf
"if (%s)
\n
%s
\n
else
\n
%s"
(
show
e
)
(
indent
$
show
a
)
(
indent
$
show
b
)
show
(
GenIf
e
a
GenNull
)
=
printf
"if (%s)
%s"
(
show
e
)
(
show
a
)
show
(
GenIf
e
a
b
)
=
printf
"if (%s)
%s
\n
else %s"
(
show
e
)
(
show
a
)
(
show
b
)
show
(
GenFor
(
x1
,
e1
)
c
(
x2
,
e2
)
x
is
)
=
printf
"for (%s = %s; %s; %s = %s) %s"
x1
(
show
e1
)
(
show
c
)
x2
(
show
e2
)
(
show
$
GenBlock
(
Just
x
)
is
)
show
GenNull
=
";"
show
(
GenModuleItem
item
)
=
show
item
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