Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROSA - Formally Proven Schedulability Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RT-PROOFS
PROSA - Formally Proven Schedulability Analysis
Commits
4918b196
Commit
4918b196
authored
5 years ago
by
Björn Brandenburg
Browse files
Options
Downloads
Patches
Plain Diff
proofloc.py: do not count proofs that have been commented out
parent
8ae21891
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!60
Move "classic" Prosa to rt.classic namespace and update documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/proofloc.py
+12
-3
12 additions, 3 deletions
scripts/proofloc.py
with
12 additions
and
3 deletions
scripts/proofloc.py
+
12
−
3
View file @
4918b196
...
@@ -27,6 +27,9 @@ r"""
...
@@ -27,6 +27,9 @@ r"""
"""
"""
,
re
.
VERBOSE
)
,
re
.
VERBOSE
)
COMMENT_START_PATTERN
=
re
.
compile
(
r
"
\(\*
"
)
COMMENT_END_PATTERN
=
re
.
compile
(
r
"
\*\)
"
)
def
banner
(
fname
):
def
banner
(
fname
):
fill1
=
(
76
-
len
(
fname
))
//
2
fill1
=
(
76
-
len
(
fname
))
//
2
fill2
=
76
-
len
(
fname
)
-
fill1
fill2
=
76
-
len
(
fname
)
-
fill1
...
@@ -41,25 +44,31 @@ def silent(tag, line_number, line):
...
@@ -41,25 +44,31 @@ def silent(tag, line_number, line):
def
process_file
(
fname
,
annotate
=
silent
):
def
process_file
(
fname
,
annotate
=
silent
):
proofs
=
[]
proofs
=
[]
in_proof
=
False
in_proof
=
False
in_comment
=
0
claim
=
'
???
'
claim
=
'
???
'
with
open
(
fname
)
as
f
:
with
open
(
fname
)
as
f
:
for
i
,
line
in
enumerate
(
f
):
for
i
,
line
in
enumerate
(
f
):
# simplification: we assume comment start/end not on otherwise
# significant lines
in_comment
+=
len
(
COMMENT_START_PATTERN
.
findall
(
line
))
in_comment
-=
len
(
COMMENT_END_PATTERN
.
findall
(
line
))
assert
in_comment
>=
0
name_match
=
CLAIM_NAME_PATTERN
.
search
(
line
)
name_match
=
CLAIM_NAME_PATTERN
.
search
(
line
)
if
not
name_match
is
None
:
if
not
name_match
is
None
:
claim
=
name_match
.
group
(
2
)
claim
=
name_match
.
group
(
2
)
if
in_proof
:
if
in_proof
:
if
PROOF_END_PATTERN
.
search
(
line
):
if
not
in_comment
and
PROOF_END_PATTERN
.
search
(
line
):
annotate
(
'
###
'
,
i
,
line
)
annotate
(
'
###
'
,
i
,
line
)
proofs
.
append
(
(
fname
,
start
+
1
,
claim
,
i
-
start
-
1
)
)
proofs
.
append
(
(
fname
,
start
+
1
,
claim
,
i
-
start
-
1
)
)
in_proof
=
False
in_proof
=
False
claim
=
'
???
'
claim
=
'
???
'
else
:
else
:
annotate
(
'
P
'
,
i
,
line
)
annotate
(
'
P
'
,
i
,
line
)
elif
SINGLE_LINE_PROOF_PATTERN
.
search
(
line
):
elif
not
in_comment
and
SINGLE_LINE_PROOF_PATTERN
.
search
(
line
):
annotate
(
'
*P*
'
,
i
,
line
)
annotate
(
'
*P*
'
,
i
,
line
)
proofs
.
append
(
(
fname
,
i
+
1
,
claim
,
1
)
)
proofs
.
append
(
(
fname
,
i
+
1
,
claim
,
1
)
)
claim
=
'
???
'
claim
=
'
???
'
elif
PROOF_START_PATTERN
.
search
(
line
):
elif
not
in_comment
and
PROOF_START_PATTERN
.
search
(
line
):
annotate
(
'
***
'
,
i
,
line
)
annotate
(
'
***
'
,
i
,
line
)
in_proof
=
True
in_proof
=
True
start
=
i
start
=
i
...
...
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