From a732a632287074e74a1dd394149b36e83526a0cf Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 25 Apr 2012 16:37:12 -0700 Subject: Dafny: fixed resolution bug for inductive datatypes (previous check did not handle generic datatypes correctly) Dafny: fixed compiler bug in inductive datatypes (missing type parameters in emitted code) Dafny: added "codatatype" declaration (syntax only for now) --- Util/Emacs/dafny-mode.el | 2 +- Util/VS2010/Dafny/DafnyLanguageService/Grammar.cs | 3 ++- Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs | 1 + Util/latex/dafny.sty | 2 +- Util/vim/syntax/dafny.vim | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Util') diff --git a/Util/Emacs/dafny-mode.el b/Util/Emacs/dafny-mode.el index 56b56000..f16b09b5 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" "type" "function" "predicate" "ghost" "var" "method" "constructor" "unlimited" + "class" "datatype" "codatatype" "type" "function" "predicate" "ghost" "var" "method" "constructor" "unlimited" "module" "imports" "static" "refines" "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 41923a98..012058f6 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", "type", + "class", "ghost", "static", "var", "method", "constructor", "datatype", "codatatype", "type", "assert", "assume", "new", "this", "object", "refines", "unlimited", "module", "imports", "if", "then", "else", "while", "invariant", @@ -267,6 +267,7 @@ namespace Demo | "method" | "constructor" | "datatype" + | "codatatype" | "type" | "assert" | "assume" diff --git a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs b/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs index 650c01bd..48faa5ec 100644 --- a/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs +++ b/Util/VS2010/DafnyExtension/DafnyExtension/TokenTagger.cs @@ -242,6 +242,7 @@ namespace DafnyLanguage case "case": case "choose": case "class": + case "codatatype": case "constructor": case "datatype": case "decreases": diff --git a/Util/latex/dafny.sty b/Util/latex/dafny.sty index b23e2dc4..4126d2f2 100644 --- a/Util/latex/dafny.sty +++ b/Util/latex/dafny.sty @@ -5,7 +5,7 @@ \usepackage{listings} \lstdefinelanguage{dafny}{ - morekeywords={class,datatype,type,bool,nat,int,object,set,multiset,seq,array,array2,array3,% + morekeywords={class,datatype,codatatype,type,bool,nat,int,object,set,multiset,seq,array,array2,array3,% function,predicate,unlimited, ghost,var,static,refines, method,constructor,returns,module,imports,in, diff --git a/Util/vim/syntax/dafny.vim b/Util/vim/syntax/dafny.vim index 37038f35..6af28094 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 predicate method constructor -syntax keyword dafnyTypeDef class datatype type +syntax keyword dafnyTypeDef class datatype codatatype 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 -- cgit v1.2.3