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
4d2930e4
Commit
4d2930e4
authored
4 years ago
by
Björn Brandenburg
Browse files
Options
Downloads
Patches
Plain Diff
proof state recorder: handle multiple closing '}'
parent
062a16aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!117
proof-state recorder tweaks and fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/record-proof-state.py
+15
-4
15 additions, 4 deletions
scripts/record-proof-state.py
with
15 additions
and
4 deletions
scripts/record-proof-state.py
+
15
−
4
View file @
4d2930e4
...
...
@@ -57,6 +57,12 @@ def statement_end_offsets(opts, src):
else
:
return
False
def
prev_is
(
i
,
c
):
if
i
>
0
:
return
src
[
i
-
1
]
==
c
else
:
return
False
def
next_is_whitespace
(
i
):
if
i
+
1
<
len
(
src
):
return
src
[
i
+
1
].
isspace
()
...
...
@@ -141,10 +147,15 @@ def statement_end_offsets(opts, src):
# look for closing braces -- this is a brittle heuristic, but
# we need to catch sub-proofs because coqtop in emacs mode
# produces a prompt every time we enter a sub-proof
elif
not
in_comment
and
in_proof
and
cur_is
(
i
,
'
}
'
)
\
and
next_is_whitespace
(
i
)
and
prev_is_whitespace
(
i
):
yield
i
+
1
last
=
i
+
1
elif
not
in_comment
and
in_proof
and
cur_is
(
i
,
'
}
'
)
and
\
(
next_is_whitespace
(
i
)
or
next_is
(
i
,
'
}
'
))
and
\
(
prev_is_whitespace
(
i
)
or
prev_is
(
i
,
'
}
'
)):
if
next_is_whitespace
(
i
):
yield
i
+
1
last
=
i
+
1
else
:
yield
i
last
=
i
# similarly, look for opening braces
elif
not
in_comment
and
in_proof
and
cur_is
(
i
,
'
{
'
)
\
and
next_is_whitespace
(
i
)
and
prev_is_whitespace
(
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