summaryrefslogtreecommitdiff
path: root/Source/Dafny/Parser.cs
Commit message (Collapse)AuthorAge
* Fix issue 138. Allow parenthese with the nullary constructor inGravatar qunyanm2016-02-26
| | | | "case" of a match statement and match expression.
* Mark old "import A as B" syntax as deprecated. The new syntax is "import A : B"Gravatar qunyanm2016-02-02
|
* Implement module export so we can export a subset of items defined in theGravatar qunyanm2016-01-29
| | | | module.
* Fix build and test failures, cleanup grammar.Gravatar Richard L. Ford2016-01-27
| | | | | | | | | | 1. A build failure caused by a method call before a contract was fixed. 2. An absolute path in an ".expect" file was changed to relative. 3. I eliminated the TopDecls and DeclModifiers non-terminals. They were giving a warning from Coco/R about being deletable. Instead I used repetition of the TopDecl or DeclModifier non-terminals where they had been used. I think this is also cleaner to talk about.
* Implement 'extern' declaration modifier.Gravatar Richard L. Ford2016-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'extern' declaration modifier provides a more convenient way of interfacing Dafny code with C# source files and .Net DLLs. We support an 'extern' keyword on a module, class, function method, or method (cannot extern ghost). We check the CompileNames of all modules to make sure there are no duplicate names. Every Dafny-generated C# class is marked partial, so it can potentially be extended. The extern keyword could be accompanied by an optional string naming the corresponding C# method/class to connect to. If not given the name of the method/class is used. An 'extern' keyword implies an {:axiom} attribute for functions and methods, so their ensures clauses are assumed to be true without proof. In addition to the .dfy files, the user may supply C# files (.cs) and dynamic linked libraries (.dll) on command line. These will be passed onto the C# compiler, the .cs files as sources, and the .dll files as references. As part of this change the grammar was refactored some. New productions are - TopDecls - a list of top-level declarations. - TopDecl - a single top-level declaration - DeclModifiers - a list of declaration modifiers which are either 'abstract', 'ghost', 'static', 'protected', or 'extern'. They can be in any order and we diagnose duplicates. In addition, since they are not all allowed in all contexts, we check and give diagnostics if an DeclModifier appears where it is not allowed.
* Fix issue 94. Allow tuple-based assignment in statement contexts.Gravatar qunyanm2015-11-14
|
* Fix issue 101. Instead of swapping operands for Exp opcode in BinaryExpr,Gravatar qunyanm2015-11-10
| | | | | swap them when the expr is first created in parser or for calcstmt. This avoids problems of operands being swapped again when the expr is copied.
* Introduced new datatype update syntax: D.(f := E)Gravatar leino2015-10-23
| | | | | The old syntax, D[f := E], is still supported for a short while, but generates a warning about that syntax being deprecated. The new syntax also supports multiple updates: D.(f := E0, g := E1, h := E2)
* Parsing and pretty printing of the new "existential guards" of the two kinds ↵Gravatar leino2015-10-03
| | | | of "if" statements.
* Merge.Gravatar Clément Pit--Claudel2015-08-19
|\ | | | | | | | | Changes that were needed included preventing the InductionRewriter from iterating on a SplitQuantifier and using the new error reporting engine.
* | Refactor the error reporting codeGravatar Clément Pit--Claudel2015-08-18
| | | | | | | | | | The new error reporting system has a simpler interface, isn't tied to the resolver, and contains error source information.
| * Disallow user-defined attributes that begin with an underscoreGravatar leino2015-08-11
|/
* Update the VS extension to use the error interface defined in 576eac2e17ffGravatar Clément Pit--Claudel2015-07-29
|
* MergeGravatar Clément Pit--Claudel2015-07-28
|\
| * Updated parser generation to work with latest update in boogiepartners. Note ↵Gravatar Rustan Leino2015-07-27
| | | | | | | | that Coco.exe is now included in boogiepartners.
* | Clean up error reporting.Gravatar Clément Pit--Claudel2015-07-27
|/ | | | | There now is one main entry point for reporting errors, warnings, or information. Next step is to make the VS extension use that.
* Fix a bug with includes and /useBaseNameForFileNameGravatar Clément Pit--Claudel2015-07-23
| | | | | | | If /useBasenameForFilename is specified, tokens just contain file names, which is not enough to locate included files. Solution based on Rustan's advice.
* Fix: Unify column numbers in Dafny's errorsGravatar Clément Pit--Claudel2015-07-23
| | | | | | | | | Dafny counts from 0, but Boogie counts from 1. Tokens are 1-based. Thus when we print tokens, we need to decrement the column number. This was done for resolver errors, but not for verification or parsing errors. In addition, parsing errors were inconsistent with resolution errors case-wise. Unfortunately, the fix affects the output of many tests.
* IronDafny related changes:Gravatar Michael Lowell Roberts2015-07-22
| | | | | - diabled error message related to ensures clauses requiring function bodies in the case of abstract modules. - fixed bug in similar error message related to bodyless methods in abstract modules.
* MergeGravatar Rustan Leino2015-07-16
|\
| * Fixed bugs in the parsing of explicit type arguments.Gravatar Rustan Leino2015-07-16
| | | | | | | | | | Fixed resolution bug where some type arguments were not checked to have been determined. Fixed resolution bugs where checking for equality-supporting types was missing.
* | [IronDafny] implemented workaround for "import opened" bug(s).Gravatar Michael Lowell Roberts2015-07-13
|/
* multiple changes...Gravatar Michael Lowell Roberts2015-07-02
| | | | | - fix for requirement inheritance in refinement. - minimimally viable implementation of exclusive refinement feature.
* Add the ability to specify how much "fuel" a function should have,Gravatar Bryan Parno2015-07-01
| | | | | | | | | | | | | | | | | | | i.e., how many times Z3 is permitted to unfold it's definition. The new {:fuel} annotation can be added to the function itself, it which case it will apply to all uses of that function, or it can overridden within the scope of a module, function, method, iterator, calc, forall, while, assert, or assume. The general format is: {:fuel functionName,lowFuel,highFuel} When applied as an annotation to the function itself, omit functionName. If highFuel is omitted, it defaults to lowFuel + 1. The default fuel setting for recursive functions is 1,2. Setting the fuel higher, say, to 3,4, will give more unfoldings, which may make some proofs go through with less programmer assistance (e.g., with fewer assert statements), but it may also increase verification time, so use it with care. Setting the fuel to 0,0 is similar to making the definition opaque, except when used with all literal arguments.
* Add a compatibility layer over BigInteger.ParseGravatar Clément Pit--Claudel2015-06-07
| | | | | | | Mono currently does not implement support for BigInteger.Parse, so use Int64 if possible, and throw the same error as was previously returned otherwise. This is not too much of a problem in practice, because most of the integers that we actually come across in real-life source files seem to fit in an Int64.
* Add an infinite set collection type.Gravatar qunyanm2015-05-29
|
* Fix issue #79. Allow tuple pattern matching with parenthesis only.Gravatar qunyanm2015-05-15
|
* Allow MatchExpr and MatchStmt to have nested patterns. Such asGravatar qunyanm2015-05-14
| | | | | | | | | | | | | | | | | | function last<T>(xs: List<T>): T requires xs != Nil { match xs case Cons(y, Nil) => y case Cons(y, Cons(z, zs)) => last(Cons(z, zs)) } And function minus(x: Nat, y: Nat): Nat { match (x, y) case (Zero, _) => Zero case (Suc(_), Zero) => x case (Suc(a), Suc(b)) => minus(a, b) }
* Added "inductive lemma" methodsGravatar leino2015-05-07
|
* Added inductive predicatesGravatar leino2015-05-06
|
* Eliminate redundant checks of newtype and opaque function well-formedness ↵Gravatar chrishaw2015-04-02
| | | | from included files
* Allow trigger annotations in more statements and expressionsGravatar chrishaw2015-03-11
|
* Added 'protected' keyword (syntax)Gravatar leino2015-03-07
|
* Stop pretty-print from emitting deprecated semi-colons.Gravatar qunyanm2015-03-05
|
* Fixed issue #59.Gravatar wuestholz2015-03-03
|
* Add imap display/update expressionsGravatar chrishaw2015-02-27
|
* Add imap type, which is like map but may have have infinite sizeGravatar chrishaw2015-02-26
|
* Minor change to grammar to avoid missing tokenGravatar wuestholz2015-01-24
|
* Switched use of List(IToken) in UserDefinedType to NameSegment/ExprDotName, ↵Gravatar leino2015-01-23
| | | | | | | so use the new name resolution machinery that handles modules and type parameters Included some inadvertently left-out test cases in dafny0/Modules0.dfy Fixed comparable-types tests
* Added command-line switch /allowGlobals to simplify transition from language ↵Gravatar leino2015-01-07
| | | | changes introduced in changeset c56031307ac1
* Fixed resolution of method calls with explicit type parameters.Gravatar leino2015-01-02
| | | | Finished refactoring of the recent name segments changes.
* Language change: All functions and methods declared lexically outside any ↵Gravatar leino2014-12-12
| | | | | | | | | | class are now automatically static, and fields are no longer allowed to be declared there. Stated differently, all heap state must now be declared inside an explicitly declared class, and functions and methods declared outside any class can be viewed as belonging to the module. The motivating benefit of this change is to no longer need the 'static' keyword when declaring a module of functions and methods.
* Fixed two crashes in resolverGravatar leino2014-12-10
| | | | Corrected merge
* MergeGravatar leino2014-12-09
|\
* | Allow user-specified type parametersGravatar leino2014-12-09
| |
| * added multiple trait inheritance.Gravatar Reza Ahmadi2014-12-03
| | | | | | | | - a class can now extend more than one traits
* | Fixed parser lookahead bug that had caused an infinite loop.Gravatar leino2014-12-02
| |
* | Snapshot, to be continuedGravatar leino2014-12-02
|/
* Use arbitrary lookahead to determine if the next expression is a lambda ↵Gravatar leino2014-11-13
| | | | expression.
* Took a pass through the whole grammar to clean up allowSemi/allowLambda ↵Gravatar leino2014-11-11
| | | | parameters