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
3aecdb2c
Commit
3aecdb2c
authored
5 years ago
by
Marco Perronet
Committed by
Björn Brandenburg
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update coqdocjs
... to get support for proofs started by `Next Obligation`.
parent
f4330fe0
No related branches found
No related tags found
No related merge requests found
Pipeline
#21312
passed
5 years ago
Stage: build
Stage: process
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/coqdocjs/resources/coqdocjs.js
+43
-15
43 additions, 15 deletions
scripts/coqdocjs/resources/coqdocjs.js
with
43 additions
and
15 deletions
scripts/coqdocjs/resources/coqdocjs.js
+
43
−
15
View file @
3aecdb2c
...
@@ -6,7 +6,13 @@ function replace(s){
...
@@ -6,7 +6,13 @@ function replace(s){
if
(
m
=
s
.
match
(
/^
(
.+
)
'/
))
{
if
(
m
=
s
.
match
(
/^
(
.+
)
'/
))
{
return
replace
(
m
[
1
])
+
"
'
"
;
return
replace
(
m
[
1
])
+
"
'
"
;
}
else
if
(
m
=
s
.
match
(
/^
([
A-Za-z
]
+
)
_
?(\d
+
)
$/
))
{
}
else
if
(
m
=
s
.
match
(
/^
([
A-Za-z
]
+
)
_
?(\d
+
)
$/
))
{
return
replace
(
m
[
1
])
+
m
[
2
].
replace
(
/
\d
/g
,
function
(
d
){
return
coqdocjs
.
subscr
[
d
]});
return
replace
(
m
[
1
])
+
m
[
2
].
replace
(
/
\d
/g
,
function
(
d
){
if
(
coqdocjs
.
subscr
.
hasOwnProperty
(
d
))
{
return
coqdocjs
.
subscr
[
d
];
}
else
{
return
d
;
}
});
}
else
if
(
coqdocjs
.
repl
.
hasOwnProperty
(
s
)){
}
else
if
(
coqdocjs
.
repl
.
hasOwnProperty
(
s
)){
return
coqdocjs
.
repl
[
s
]
return
coqdocjs
.
repl
[
s
]
}
else
{
}
else
{
...
@@ -57,18 +63,29 @@ function replNodes() {
...
@@ -57,18 +63,29 @@ function replNodes() {
});
});
}
}
function
isProofStart
(
s
){
function
isVernacStart
(
l
,
t
){
return
s
==
"
Proof
"
;
t
=
t
.
trim
();
for
(
var
s
of
l
){
if
(
t
==
s
||
t
.
startsWith
(
s
+
"
"
)
||
t
.
startsWith
(
s
+
"
.
"
)){
return
true
;
}
}
return
false
;
}
function
isProofStart
(
n
){
return
isVernacStart
([
"
Proof
"
],
n
.
textContent
)
||
(
isVernacStart
([
"
Next
"
],
n
.
textContent
)
&&
isVernacStart
([
"
Obligation
"
],
n
.
nextSibling
.
nextSibling
.
textContent
));
}
}
function
isProofEnd
(
s
){
function
isProofEnd
(
s
){
return
[
"
Qed
"
,
"
Admitted
"
,
"
Defined
"
].
indexOf
(
s
)
>
-
1
;
return
isVernacStart
(
[
"
Qed
"
,
"
Admitted
"
,
"
Defined
"
,
"
Abort
"
],
s
)
;
}
}
function
proofStatus
(){
function
proofStatus
(){
var
proofs
=
toArray
(
document
.
getElementsByClassName
(
"
proof
"
));
var
proofs
=
toArray
(
document
.
getElementsByClassName
(
"
proof
"
));
if
(
proofs
.
length
)
{
if
(
proofs
.
length
)
{
for
(
proof
of
proofs
)
{
for
(
var
proof
of
proofs
)
{
if
(
proof
.
getAttribute
(
"
show
"
)
===
"
false
"
)
{
if
(
proof
.
getAttribute
(
"
show
"
)
===
"
false
"
)
{
return
"
some-hidden
"
;
return
"
some-hidden
"
;
}
}
...
@@ -85,8 +102,15 @@ function updateView(){
...
@@ -85,8 +102,15 @@ function updateView(){
}
}
function
foldProofs
()
{
function
foldProofs
()
{
toArray
(
document
.
getElementsByClassName
(
"
id
"
)).
forEach
(
function
(
node
){
var
hasCommands
=
true
;
if
(
isProofStart
(
node
.
textContent
))
{
var
nodes
=
document
.
getElementsByClassName
(
"
command
"
);
if
(
nodes
.
length
==
0
)
{
hasCommands
=
false
;
console
.
log
(
"
no command tags found
"
)
nodes
=
document
.
getElementsByClassName
(
"
id
"
);
}
toArray
(
nodes
).
forEach
(
function
(
node
){
if
(
isProofStart
(
node
))
{
var
proof
=
document
.
createElement
(
"
span
"
);
var
proof
=
document
.
createElement
(
"
span
"
);
proof
.
setAttribute
(
"
class
"
,
"
proof
"
);
proof
.
setAttribute
(
"
class
"
,
"
proof
"
);
...
@@ -98,10 +122,9 @@ function foldProofs() {
...
@@ -98,10 +122,9 @@ function foldProofs() {
node
=
proof
.
nextSibling
;
node
=
proof
.
nextSibling
;
}
}
if
(
proof
.
nextSibling
)
proof
.
appendChild
(
proof
.
nextSibling
);
// the Qed
if
(
proof
.
nextSibling
)
proof
.
appendChild
(
proof
.
nextSibling
);
// the Qed
if
(
proof
.
nextSibling
)
proof
.
appendChild
(
proof
.
nextSibling
);
// the dot after the Qed
if
(
!
hasCommands
&&
proof
.
nextSibling
)
proof
.
appendChild
(
proof
.
nextSibling
);
// the dot after the Qed
proof
.
addEventListener
(
"
click
"
,
function
(
proof
){
return
function
(
e
){
proof
.
addEventListener
(
"
click
"
,
function
(
proof
){
return
function
(
e
){
console
.
log
(
e
.
target
.
parentNode
.
tagName
);
if
(
e
.
target
.
parentNode
.
tagName
.
toLowerCase
()
===
"
a
"
)
if
(
e
.
target
.
parentNode
.
tagName
.
toLowerCase
()
===
"
a
"
)
return
;
return
;
proof
.
setAttribute
(
"
show
"
,
proof
.
getAttribute
(
"
show
"
)
===
"
true
"
?
"
false
"
:
"
true
"
);
proof
.
setAttribute
(
"
show
"
,
proof
.
getAttribute
(
"
show
"
)
===
"
true
"
?
"
false
"
:
"
true
"
);
...
@@ -123,6 +146,13 @@ function toggleProofs(){
...
@@ -123,6 +146,13 @@ function toggleProofs(){
}
}
function
repairDom
(){
function
repairDom
(){
// pull whitespace out of command
toArray
(
document
.
getElementsByClassName
(
"
command
"
)).
forEach
(
function
(
node
){
while
(
node
.
firstChild
&&
node
.
firstChild
.
textContent
.
trim
()
==
""
){
console
.
log
(
"
try move
"
);
node
.
parentNode
.
insertBefore
(
node
.
firstChild
,
node
);
}
});
toArray
(
document
.
getElementsByClassName
(
"
id
"
)).
forEach
(
function
(
node
){
toArray
(
document
.
getElementsByClassName
(
"
id
"
)).
forEach
(
function
(
node
){
node
.
setAttribute
(
"
type
"
,
node
.
getAttribute
(
"
title
"
));
node
.
setAttribute
(
"
type
"
,
node
.
getAttribute
(
"
title
"
));
});
});
...
@@ -137,12 +167,10 @@ function repairDom(){
...
@@ -137,12 +167,10 @@ function repairDom(){
function
fixTitle
(){
function
fixTitle
(){
var
url
=
"
/
"
+
window
.
location
.
pathname
;
var
url
=
"
/
"
+
window
.
location
.
pathname
;
var
modulename
=
"
.
"
+
url
.
substring
(
url
.
lastIndexOf
(
'
/
'
)
+
1
,
url
.
lastIndexOf
(
'
.
'
));
var
basename
=
url
.
substring
(
url
.
lastIndexOf
(
'
/
'
)
+
1
,
url
.
lastIndexOf
(
'
.
'
));
modulename
=
modulename
.
substring
(
modulename
.
lastIndexOf
(
'
.
'
)
+
1
);
if
(
basename
===
"
toc
"
)
{
document
.
title
=
"
Table of Contents
"
;}
if
(
modulename
===
"
toc
"
)
{
modulename
=
"
Table of Contents
"
;}
else
if
(
basename
===
"
indexpage
"
)
{
document
.
title
=
"
Index
"
;}
else
if
(
modulename
===
"
indexpage
"
)
{
modulename
=
"
Index
"
;}
else
{
document
.
title
=
basename
;}
else
{
modulename
=
modulename
+
"
.v
"
;};
document
.
title
=
modulename
;
}
}
function
postprocess
(){
function
postprocess
(){
...
...
This diff is collapsed.
Click to expand it.
Björn Brandenburg
@bbb
mentioned in issue
#58 (closed)
·
5 years ago
mentioned in issue
#58 (closed)
mentioned in issue #58
Toggle commit list
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