summaryrefslogtreecommitdiff
path: root/Util
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2011-11-21 22:40:44 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2011-11-21 22:40:44 -0800
commit166c105b43515bfdbde52514fa9c16ffd61eea25 (patch)
tree1d01cd5c3147c98ccc03e43a6659574f5c3f81c7 /Util
parentb07cff8fc3c732986c42b31226f0d7b06ed55886 (diff)
Dafny: Added "type" declaration (syntax: "type X;"), which introduces an arbitrary type (like a global type parameter). In the future, a refined module may allow such types to be instantiated.
Diffstat (limited to 'Util')
-rw-r--r--Util/Emacs/dafny-mode.el2
-rw-r--r--Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs3
-rw-r--r--Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs1
-rw-r--r--Util/latex/dafny.sty2
-rw-r--r--Util/vim/syntax/dafny.vim2
5 files changed, 6 insertions, 4 deletions
diff --git a/Util/Emacs/dafny-mode.el b/Util/Emacs/dafny-mode.el
index 7235303a..89974290 100644
--- a/Util/Emacs/dafny-mode.el
+++ b/Util/Emacs/dafny-mode.el
@@ -30,7 +30,7 @@
]\\)*" . font-lock-comment-face)
`(,(dafny-regexp-opt '(
- "class" "datatype" "function" "ghost" "var" "method" "constructor" "unlimited"
+ "class" "datatype" "type" "function" "ghost" "var" "method" "constructor" "unlimited"
"module" "imports" "static" "refines" "replaces" "by"
"returns" "requires" "ensures" "modifies" "reads" "free"
"invariant" "decreases"
diff --git a/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs b/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs
index 557beb32..f2924420 100644
--- a/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs
+++ b/Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs
@@ -17,7 +17,7 @@ namespace Demo
StringLiteral stringLiteral = TerminalFactory.CreateCSharpString("String");
this.MarkReservedWords( // NOTE: these keywords must also appear once more below
- "class", "ghost", "static", "var", "method", "constructor", "datatype",
+ "class", "ghost", "static", "var", "method", "constructor", "datatype", "type",
"assert", "assume", "new", "this", "object", "refines", "replaces", "by",
"unlimited", "module", "imports",
"if", "then", "else", "while", "invariant",
@@ -267,6 +267,7 @@ namespace Demo
| "method"
| "constructor"
| "datatype"
+ | "type"
| "assert"
| "assume"
| "new"
diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs
index e8e94e17..23c71d45 100644
--- a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs
+++ b/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs
@@ -287,6 +287,7 @@ namespace DafnyLanguage
case "then":
case "this":
case "true":
+ case "type":
case "unlimited":
case "var":
case "while":
diff --git a/Util/latex/dafny.sty b/Util/latex/dafny.sty
index 34ee3d1d..b829985a 100644
--- a/Util/latex/dafny.sty
+++ b/Util/latex/dafny.sty
@@ -5,7 +5,7 @@
\usepackage{listings}
\lstdefinelanguage{dafny}{
- morekeywords={class,datatype,bool,nat,int,object,set,multiset,seq,array,array2,array3,%
+ morekeywords={class,datatype,type,bool,nat,int,object,set,multiset,seq,array,array2,array3,%
function,unlimited,
ghost,var,static,refines,replaces,by,
method,constructor,returns,module,imports,in,
diff --git a/Util/vim/syntax/dafny.vim b/Util/vim/syntax/dafny.vim
index b806fb0b..ab8f120d 100644
--- a/Util/vim/syntax/dafny.vim
+++ b/Util/vim/syntax/dafny.vim
@@ -6,7 +6,7 @@
syntax clear
syntax case match
syntax keyword dafnyFunction function method constructor
-syntax keyword dafnyTypeDef class datatype
+syntax keyword dafnyTypeDef class datatype type
syntax keyword dafnyConditional if then else match case
syntax keyword dafnyRepeat while parallel
syntax keyword dafnyStatement havoc assume assert return new print break label