Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
679f056a
Commit
679f056a
authored
Mar 17, 2011
by
Jean-Christophe Filliâtre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
programs: new construct loop ... end for infinite loops
parent
b3d2056a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
share/emacs/why.el
share/emacs/why.el
+1
-1
src/parser/lexer.mll
src/parser/lexer.mll
+1
-0
src/parser/parser.pre.mly
src/parser/parser.pre.mly
+2
-2
tests/test-pgm-jcf.mlw
tests/test-pgm-jcf.mlw
+2
-2
No files found.
share/emacs/why.el
View file @
679f056a
...
...
@@ -30,7 +30,7 @@
;; '("(\\*\\([^*)]\\([^*]\\|\\*[^)]\\)*\\)?\\*)" . font-lock-comment-face)
'
(
"{\\([^}]*\\)}"
.
font-lock-type-face
)
`
(
,
(
why-regexp-opt
'
(
"use"
"clone"
"namespace"
"import"
"export"
"inductive"
"external"
"logic"
"parameter"
"exception"
"axiom"
"lemma"
"goal"
"type"
"mutable"
"model"
"abstract"
))
.
font-lock-builtin-face
)
`
(
,
(
why-regexp-opt
'
(
"and"
"any"
"match"
"let"
"rec"
"in"
"if"
"then"
"else"
"begin"
"end"
"while"
"invariant"
"variant"
"for"
"to"
"downto"
"do"
"done"
"label"
"assert"
"absurd"
"assume"
"check"
"ghost"
"try"
"with"
"theory"
"uses"
"module"
))
.
font-lock-keyword-face
)
`
(
,
(
why-regexp-opt
'
(
"and"
"any"
"match"
"let"
"rec"
"in"
"if"
"then"
"else"
"begin"
"end"
"while"
"invariant"
"variant"
"for"
"to"
"downto"
"do"
"done"
"label"
"
loop"
"
assert"
"absurd"
"assume"
"check"
"ghost"
"try"
"with"
"theory"
"uses"
"module"
))
.
font-lock-keyword-face
)
; `(,(why-regexp-opt '("unit" "bool" "int" "float" "prop" "array")) . font-lock-type-face)
)
"Minimal highlighting for Why mode"
)
...
...
src/parser/lexer.mll
View file @
679f056a
...
...
@@ -92,6 +92,7 @@
(* "ghost", GHOST; *)
"invariant"
,
INVARIANT
;
"label"
,
LABEL
;
"loop"
,
LOOP
;
"model"
,
MODEL
;
"module"
,
MODULE
;
"mutable"
,
MUTABLE
;
...
...
src/parser/parser.pre.mly
View file @
679f056a
...
...
@@ -167,7 +167,7 @@
%
token
ABSTRACT
ABSURD
ANY
ASSERT
ASSUME
BEGIN
CHECK
DO
DONE
DOWNTO
%
token
EXCEPTION
FOR
%
token
FUN
INVARIANT
LABEL
MODEL
MODULE
MUTABLE
PARAMETER
RAISE
%
token
FUN
INVARIANT
LABEL
LOOP
MODEL
MODULE
MUTABLE
PARAMETER
RAISE
%
token
RAISES
READS
REC
TO
TRY
VARIANT
WHILE
WRITES
/*
symbols
*/
...
...
@@ -1075,7 +1075,7 @@ expr:
{
mk_expr
(
Ematch
(
mk_expr
(
Etuple
(
$
2
::$
4
))
,
$
7
))
}
|
LABEL
uident
COLON
expr
{
mk_expr
(
Elabel
(
$
2
,
$
4
))
}
|
DO
loop_annotation
expr
DONE
|
LOOP
loop_annotation
expr
END
{
mk_expr
(
Eloop
(
$
2
,
$
3
))
}
|
WHILE
expr
DO
loop_annotation
expr
DONE
{
mk_expr
...
...
tests/test-pgm-jcf.mlw
View file @
679f056a
...
...
@@ -20,10 +20,10 @@ module P
let foo () =
{}
let x = ref 0 in
do
loop
x := !x + 1;
if !x = 100 then raise (Exit !x)
done
end
{ false } | Exit -> { result = 100 }
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment