Commit e63151cf authored by Andrei Paskevich's avatar Andrei Paskevich

syntax: use "pure { term }" instead of "{| term |}"

Aesthetics is a harsh mistress.
parent 1aa6a8b1
......@@ -28,7 +28,7 @@
;; Note: comment font-lock is guaranteed by suitable syntax entries
'("(\\*\\([^*)]\\([^*]\\|\\*[^)]\\)*\\)?\\*)" . font-lock-comment-face)
; '("{}\\|{[^|]\\([^}]*\\)}" . font-lock-type-face)
`(,(why3-regexp-opt '("invariant" "variant" "diverges" "requires" "ensures" "returns" "raises" "reads" "writes" "assert" "assume" "check")) . font-lock-type-face)
`(,(why3-regexp-opt '("invariant" "variant" "diverges" "requires" "ensures" "pure" "returns" "raises" "reads" "writes" "assert" "assume" "check")) . font-lock-type-face)
`(,(why3-regexp-opt '("use" "clone" "scope" "import" "export" "coinductive" "inductive" "external" "constant" "function" "predicate" "val" "exception" "axiom" "lemma" "goal" "type" "mutable" "abstract" "private" "any" "match" "let" "rec" "in" "if" "then" "else" "begin" "end" "while" "for" "to" "downto" "do" "done" "loop" "absurd" "ghost" "raise" "try" "with" "theory" "uses" "module" "converter" "fun" "at" "old" "true" "false" "forall" "exists" "label" "by" "so" "meta")) . font-lock-keyword-face)
)
"Minimal highlighting for Why3 mode")
......
......@@ -222,6 +222,7 @@ on linking described in file LICENSE.
<keyword>check</keyword>
<keyword>invariant</keyword>
<keyword>old</keyword>
<keyword>pure</keyword>
<keyword>raises</keyword>
<keyword>reads</keyword>
<keyword>requires</keyword>
......
......@@ -10,7 +10,7 @@ check,clone,coinductive,constant,diverges,do,done,downto,%
else,end,ensures,exception,exists,export,false,for,forall,fun,%
function,ghost,goal,if,import,in,inductive,invariant,label,lemma,%
let,loop,match,meta,module,mutable,not,old,%
predicate,private,raise,raises,reads,rec,requires,result,%
predicate,private,pure,raise,raises,reads,rec,requires,result,%
returns,scope,so,then,theory,to,true,try,type,use,val,variant,while,%
with,writes},%
string=[b]",%
......
......@@ -100,7 +100,7 @@ syn keyword whyType bool int list map option real
syn keyword whyType array ref unit
syn keyword whySpec absurd assert assume check diverges ensures invariant
syn keyword whySpec raises reads requires returns variant writes at old
syn keyword whySpec pure raises reads requires returns variant writes at old
syn match whyConstructor "(\s*)"
syn match whyConstructor "\u\(\w\|'\)*\>"
......
......@@ -83,6 +83,7 @@
"mutable", MUTABLE;
"old", OLD;
"private", PRIVATE;
"pure", PURE;
"raise", RAISE;
"raises", RAISES;
"reads", READS;
......@@ -182,10 +183,6 @@ rule token = parse
{ LEFTBRC }
| "}"
{ RIGHTBRC }
| "{|"
{ LEFTPURE }
| "|}"
{ RIGHTPURE }
| ":"
{ COLON }
| ";"
......
......@@ -135,7 +135,7 @@
%token ABSTRACT ABSURD ANY ASSERT ASSUME AT BEGIN CHECK
%token DIVERGES DO DONE DOWNTO ENSURES EXCEPTION FOR
%token FUN GHOST INVARIANT LABEL MODULE MUTABLE OLD
%token PRIVATE RAISE RAISES READS REC REQUIRES RETURNS
%token PRIVATE PURE RAISE RAISES READS REC REQUIRES RETURNS
%token TO TRY VAL VARIANT WHILE WRITES
(* symbols *)
......@@ -153,7 +153,7 @@
(* program symbols *)
%token AMPAMP BARBAR LEFTBRC RIGHTBRC LEFTPURE RIGHTPURE SEMICOLON
%token AMPAMP BARBAR LEFTBRC RIGHTBRC SEMICOLON
(* Precedences *)
......@@ -811,7 +811,7 @@ expr_sub:
| LEFTPAR comma_list2(expr) RIGHTPAR { Etuple $2 }
| LEFTBRC field_list1(expr) RIGHTBRC { Erecord $2 }
| LEFTBRC expr_arg WITH field_list1(expr) RIGHTBRC { Eupdate ($2, $4) }
| LEFTPURE term RIGHTPURE { Epure $2 }
| PURE LEFTBRC term RIGHTBRC { Epure $3 }
| expr_dot DOT lqualid_rich { Eidapp ($3, [$1]) }
| expr_arg LEFTSQ expr RIGHTSQ
{ Eidapp (get_op $startpos($2) $endpos($2), [$1;$3]) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment