Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
6372943d
Commit
6372943d
authored
7 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
Simplify list of input files
parent
c08b29eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/markdown-report/md_gen.ml
+49
-1
49 additions, 1 deletion
src/plugins/markdown-report/md_gen.ml
with
49 additions
and
1 deletion
src/plugins/markdown-report/md_gen.ml
+
49
−
1
View file @
6372943d
...
@@ -146,6 +146,54 @@ let section_stubs env =
...
@@ -146,6 +146,54 @@ let section_stubs env =
else
else
content
content
let
get_files
()
=
let
dir_table
=
Datatype
.
String
.
Hashtbl
.
create
17
in
let
add_entry
f
=
let
dir
=
Filename
.
dirname
f
in
let
base
=
Filename
.
basename
f
in
let
suf
=
try
let
i
=
String
.
rindex
base
'.'
in
String
.
sub
base
i
(
String
.
length
base
-
i
)
with
Not_found
->
""
in
let
entries
=
try
Datatype
.
String
.
Hashtbl
.
find
dir_table
dir
with
Not_found
->
Datatype
.
String
.
Map
.
empty
in
let
subentries
=
try
Datatype
.
String
.
Map
.
find
suf
entries
with
Not_found
->
Datatype
.
String
.
Set
.
empty
in
Datatype
.
String
.(
Hashtbl
.
replace
dir_table
dir
(
Map
.
add
suf
(
Set
.
add
base
subentries
)
entries
))
in
List
.
iter
add_entry
(
Kernel
.
Files
.
get
()
);
let
treat_subentry
dir
dir_files
suf
files
l
=
let
dir_files
=
List
.
fold_left
(
fun
acc
s
->
if
Filename
.
check_suffix
s
suf
then
Datatype
.
String
.
Set
.
add
s
acc
else
acc
)
Datatype
.
String
.
Set
.
empty
dir_files
in
if
Datatype
.
String
.
Set
.
subset
dir_files
files
then
(
dir
^
"/*"
^
suf
)
::
l
else
Datatype
.
String
.
Set
.
elements
files
@
l
in
let
treat_entry
dir
map
l
=
try
let
dir_files
=
Array
.
to_list
(
Sys
.
readdir
dir
)
in
Datatype
.
String
.
Map
.
fold
(
treat_subentry
dir
dir_files
)
map
l
with
Sys_error
s
->
Mdr_params
.
warning
"Unable to find directory %s: %s"
dir
s
;
Datatype
.
String
.
Map
.
fold
(
fun
_
s
l
->
Datatype
.
String
.
Set
.
elements
s
@
l
)
map
l
in
Datatype
.
String
.
Hashtbl
.
fold
treat_entry
dir_table
[]
let
gen_inputs
env
=
let
gen_inputs
env
=
let
anchor
=
"c-input"
in
let
anchor
=
"c-input"
in
let
prelude
=
let
prelude
=
...
@@ -166,7 +214,7 @@ let gen_inputs env =
...
@@ -166,7 +214,7 @@ let gen_inputs env =
plain
"that have been considered during the analysis \
plain
"that have been considered during the analysis \
are the following:"
are the following:"
);
);
UL
(
List
.
map
(
fun
x
->
[
Text
[
Inline_code
x
]])
(
Kernel
.
Files
.
get
()
));
UL
(
List
.
map
(
fun
x
->
[
Text
[
Inline_code
x
]])
(
get_files
()
));
]]
]]
let
gen_config
env
=
let
gen_config
env
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment