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
5ef24d2d
Commit
5ef24d2d
authored
Oct 11, 2019
by
Zachary Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omit empty subroutine args list
parent
b660cfbd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
src/Language/SystemVerilog/AST/Expr.hs
+2
-2
src/Language/SystemVerilog/AST/Stmt.hs
+3
-2
No files found.
src/Language/SystemVerilog/AST/Expr.hs
View file @
5ef24d2d
...
...
@@ -76,7 +76,7 @@ instance Show Expr where
show
(
BinOp
o
a
b
)
=
printf
"(%s %s %s)"
(
show
a
)
(
show
o
)
(
show
b
)
show
(
Dot
e
n
)
=
printf
"%s.%s"
(
show
e
)
n
show
(
Mux
c
a
b
)
=
printf
"(%s ? %s : %s)"
(
show
c
)
(
show
a
)
(
show
b
)
show
(
Call
ps
f
l
)
=
printf
"%s%s
(%s)"
(
maybe
""
(
++
"::"
)
ps
)
f
(
show
l
)
show
(
Call
ps
f
l
)
=
printf
"%s%s
%s"
(
maybe
""
(
++
"::"
)
ps
)
f
(
show
l
)
show
(
Cast
tore
e
)
=
printf
"%s'(%s)"
(
showEither
tore
)
(
show
e
)
show
(
DimsFn
f
v
)
=
printf
"%s(%s)"
(
show
f
)
(
showEither
v
)
show
(
DimFn
f
v
e
)
=
printf
"%s(%s, %s)"
(
show
f
)
(
showEither
v
)
(
show
e
)
...
...
@@ -93,7 +93,7 @@ data Args
deriving
(
Eq
,
Ord
)
instance
Show
Args
where
show
(
Args
pnArgs
kwArgs
)
=
commas
strs
show
(
Args
pnArgs
kwArgs
)
=
"("
++
(
commas
strs
)
++
")"
where
strs
=
(
map
showPnArg
pnArgs
)
++
(
map
showKwArg
kwArgs
)
showPnArg
=
maybe
""
show
...
...
src/Language/SystemVerilog/AST/Stmt.hs
View file @
5ef24d2d
...
...
@@ -28,7 +28,7 @@ import Text.Printf (printf)
import
Language.SystemVerilog.AST.ShowHelp
(
commas
,
indent
,
unlines'
,
showPad
,
showCase
)
import
Language.SystemVerilog.AST.Attr
(
Attr
)
import
Language.SystemVerilog.AST.Decl
(
Decl
)
import
Language.SystemVerilog.AST.Expr
(
Expr
,
Args
)
import
Language.SystemVerilog.AST.Expr
(
Expr
,
Args
(
..
)
)
import
Language.SystemVerilog.AST.LHS
(
LHS
)
import
Language.SystemVerilog.AST.Op
(
AsgnOp
(
AsgnOpEq
))
import
Language.SystemVerilog.AST.Type
(
Identifier
)
...
...
@@ -84,7 +84,8 @@ instance Show Stmt where
where
showInit
(
l
,
e
)
=
showAssign
(
l
,
AsgnOpEq
,
e
)
showAssign
::
(
LHS
,
AsgnOp
,
Expr
)
->
String
showAssign
(
l
,
op
,
e
)
=
printf
"%s %s %s"
(
show
l
)
(
show
op
)
(
show
e
)
show
(
Subroutine
ps
x
a
)
=
printf
"%s%s(%s);"
(
maybe
""
(
++
"::"
)
ps
)
x
(
show
a
)
show
(
Subroutine
ps
x
a
)
=
printf
"%s%s%s;"
(
maybe
""
(
++
"::"
)
ps
)
x
aStr
where
aStr
=
if
a
==
Args
[]
[]
then
""
else
show
a
show
(
AsgnBlk
o
v
e
)
=
printf
"%s %s %s;"
(
show
v
)
(
show
o
)
(
show
e
)
show
(
Asgn
t
v
e
)
=
printf
"%s <= %s%s;"
(
show
v
)
(
maybe
""
showPad
t
)
(
show
e
)
show
(
While
e
s
)
=
printf
"while (%s) %s"
(
show
e
)
(
show
s
)
...
...
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