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
5eef44c8
Commit
5eef44c8
authored
Jun 14, 2021
by
Zachary Yedidia
Committed by
Zachary Snow
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file output write mode
parent
c0cb401a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
src/Job.hs
+3
-1
src/sv2v.hs
+3
-0
No files found.
src/Job.hs
View file @
5eef44c8
...
...
@@ -26,6 +26,7 @@ data Exclude
data
Write
=
Stdout
|
Adjacent
|
File
deriving
(
Show
,
Typeable
,
Data
,
Eq
)
instance
Default
Write
where
...
...
@@ -66,7 +67,8 @@ defaultJob = Job
,
verbose
=
nam
"verbose"
&=
help
"Retain certain conversion artifacts"
,
write
=
nam_
"write"
&=
name
"w"
&=
typ
"MODE"
&=
help
(
"How to write output; default is 'stdout'; use 'adjacent' to"
++
" create a .v file next to each input"
)
++
" create a .v file next to each input; use 'file' to create a"
++
" sv2v_output.v file"
)
}
&=
program
"sv2v"
&=
summary
(
"sv2v "
++
version
)
...
...
src/sv2v.hs
View file @
5eef44c8
...
...
@@ -64,6 +64,9 @@ writeOutput _ [] [] =
hPutStrLn
stderr
"Warning: No input files specified (try `sv2v --help`)"
writeOutput
Stdout
_
asts
=
hPrint
stdout
$
concat
asts
writeOutput
File
_
asts
=
writeFile
f
$
show
$
concat
asts
where
f
=
"sv2v_output.v"
writeOutput
Adjacent
inPaths
asts
=
do
outPaths
<-
mapM
rewritePath
inPaths
badPaths
<-
filterM
doesFileExist
outPaths
...
...
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