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
6d6d8831
Commit
6d6d8831
authored
7 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
Debug info when parsing remark files
parent
fc5cf3eb
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/parse_remarks.ml
+13
-4
13 additions, 4 deletions
src/plugins/markdown-report/parse_remarks.ml
with
13 additions
and
4 deletions
src/plugins/markdown-report/parse_remarks.ml
+
13
−
4
View file @
6d6d8831
...
@@ -5,6 +5,8 @@ type env =
...
@@ -5,6 +5,8 @@ type env =
(* markdown lines of current element, in reverse order. *)
(* markdown lines of current element, in reverse order. *)
mutable
remarks
:
Markdown
.
element
list
Datatype
.
String
.
Map
.
t
}
mutable
remarks
:
Markdown
.
element
list
Datatype
.
String
.
Map
.
t
}
let
dkey
=
Mdr_params
.
register_category
"remarks"
let
empty_env
()
=
let
empty_env
()
=
{
current_section
=
""
;
{
current_section
=
""
;
is_markdown
=
false
;
is_markdown
=
false
;
...
@@ -30,14 +32,17 @@ let is_section = Str.regexp "^#[^{]{\\([^}]*\\)}"
...
@@ -30,14 +32,17 @@ let is_section = Str.regexp "^#[^{]{\\([^}]*\\)}"
let
parse_line
env
line
=
let
parse_line
env
line
=
if
env
.
is_markdown
then
begin
if
env
.
is_markdown
then
begin
if
Str
.
string_match
end_markdown
line
0
then
begin
if
Str
.
string_match
end_markdown
line
0
then
begin
let
remark
=
Markdown
.
Raw
(
List
.
rev
env
.
current_markdown
)
in
Mdr_params
.
debug
~
dkey
"Remark for section %s:@
\n
%a"
env
.
current_section
Markdown
.
pp_element
remark
;
env
.
remarks
<-
env
.
remarks
<-
Datatype
.
String
.
Map
.
add
Datatype
.
String
.
Map
.
add
env
.
current_section
[
remark
]
env
.
remarks
;
env
.
current_section
[
Markdown
.
Raw
(
List
.
rev
env
.
current_markdown
)]
env
.
remarks
;
env
.
current_markdown
<-
[]
env
.
current_markdown
<-
[]
end
else
if
Str
.
string_match
include_markdown
line
0
then
begin
end
else
if
Str
.
string_match
include_markdown
line
0
then
begin
let
f
=
Str
.
matched_group
1
line
in
let
f
=
Str
.
matched_group
1
line
in
Mdr_params
.
debug
~
dkey
"Remark for section %s in file %s"
env
.
current_section
f
;
try
try
let
chan
=
open_in
f
in
let
chan
=
open_in
f
in
add_channel
env
chan
;
add_channel
env
chan
;
...
@@ -49,9 +54,12 @@ let parse_line env line =
...
@@ -49,9 +54,12 @@ let parse_line env line =
env
.
current_markdown
<-
line
::
env
.
current_markdown
;
env
.
current_markdown
<-
line
::
env
.
current_markdown
;
end
end
end
else
if
Str
.
string_match
beg_markdown
line
0
then
begin
end
else
if
Str
.
string_match
beg_markdown
line
0
then
begin
Mdr_params
.
debug
~
dkey
"Checking remarks for section %s"
env
.
current_section
;
env
.
is_markdown
<-
true
env
.
is_markdown
<-
true
end
else
if
Str
.
string_match
is_section
line
0
then
begin
end
else
if
Str
.
string_match
is_section
line
0
then
begin
let
sec
=
Str
.
matched_group
1
line
in
let
sec
=
Str
.
matched_group
1
line
in
Mdr_params
.
debug
~
dkey
"Entering section %s"
env
.
current_section
;
env
.
current_section
<-
sec
env
.
current_section
<-
sec
end
end
...
@@ -67,6 +75,7 @@ let parse_remarks env chan =
...
@@ -67,6 +75,7 @@ let parse_remarks env chan =
env
env
let
get_remarks
f
=
let
get_remarks
f
=
Mdr_params
.
debug
~
dkey
"Using remarks file %s"
f
;
try
try
let
chan
=
open_in
f
in
let
chan
=
open_in
f
in
let
{
remarks
}
=
parse_remarks
(
empty_env
()
)
chan
in
let
{
remarks
}
=
parse_remarks
(
empty_env
()
)
chan
in
...
...
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