Skip to content

Commit 42cccc1

Browse files
davidcokdavidcok
andauthored
RM updates re grammar (#1089)
Co-authored-by: davidcok <[email protected]>
1 parent a5f3971 commit 42cccc1

File tree

12 files changed

+46
-68
lines changed

12 files changed

+46
-68
lines changed

RELEASE.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ This is the procedure for generating a new Dafny release.
66
1) In an up-to-date repository, with the master branch checked out
77
and up-to-date (e.g., git pull upstream)
88
cd to the repo root (i.e., dafny, which contains Source, Binaries, etc.)
9-
create and checkout a new branch: e.g. git checkout -b release
109

1110
2) Select a version number (descriptor) $VER (e.g., "3.0.0-alpha")
12-
Edit it into Source/version.cs
13-
Also edit the release name into .github/workflows/release-downloads.yml
14-
for the 'ver' variable for Windows
11+
Edit it into Source/version.cs. Push/merge that change to the master branch.
1512

1613
3) Run 'Scripts/package.py "$VER"' (in a Linux or Mac system)
1714
Warnings about missing fonts can be ignored.
@@ -24,7 +21,10 @@ This is the procedure for generating a new Dafny release.
2421

2522
6) Push the Publish button.
2623

27-
7) Commit the modified files, such as Source/version.cs,
24+
7) Edit the release name into .github/workflows/release-downloads.yml
25+
for the 'ver' variable for Windows
26+
27+
Commit the modified files, such as
2828
.github/workflows/release-downloads,yml, docs/DafnyRef/DafnyRef.pdf,
2929
possibly docs/DafnyRef/Options.txt
3030

Scripts/quicktest.out

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,16 @@ Dafny program verifier finished with 0 verified, 1 error
1010
Compiling on C#
1111

1212
Dafny program verifier finished with 0 verified, 0 errors
13-
Running...
14-
1513
(42, 131)
1614
Compiling to Javascript
1715

1816
Dafny program verifier finished with 0 verified, 0 errors
19-
Running...
20-
2117
(42, 131)
2218
Compiling to Java
2319

2420
Dafny program verifier finished with 0 verified, 0 errors
25-
Compiled program written to c-java/c.java
26-
Additional code written to c-java/_System/nat.java
27-
Additional code written to c-java/_System/__default.java
28-
Additional code written to c-java/dafny/Tuple0.java
29-
Running...
30-
3121
(42, 131)
3222
Compiling to Go
3323

3424
Dafny program verifier finished with 0 verified, 0 errors
35-
Compiled program written to c-go/src/c.go
36-
Additional code written to c-go/src/dafny/dafny.go
37-
Additional code written to c-go/src/System_/System_.go
38-
Running...
39-
4025
(42, 131)

Scripts/quicktest.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ $DIR/dafny /compile:0 a.dfy
1010
echo Should fail
1111
$DIR/dafny /compile:0 -useBaseNameForFileName b.dfy
1212
echo Compiling on C#
13-
$DIR/dafny /compile:3 /compileTarget:cs c.dfy
13+
$DIR/dafny /compile:3 /compileVerbose:0 /compileTarget:cs c.dfy
1414
echo Compiling to Javascript
15-
$DIR/dafny /compile:3 /compileTarget:js c.dfy
15+
$DIR/dafny /compile:3 /compileVerbose:0 /compileTarget:js c.dfy
1616
echo Compiling to Java
17-
$DIR/dafny /compile:3 /compileTarget:java c.dfy
17+
$DIR/dafny /compile:3 /compileVerbose:0 /compileTarget:java c.dfy
1818
echo Compiling to Go
19-
$DIR/dafny /compile:3 /compileTarget:go c.dfy
19+
$DIR/dafny /compile:3 /compileVerbose:0 /compileTarget:go c.dfy
2020
rm -rf a.dfy b.dfy c.dfy c-go c-java c

Source/Dafny/Dafny.atg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,8 @@ ModuleExport<ModuleDefinition parent, out ModuleDecl submodule>
10301030
.
10311031

10321032
/*------------------------------------------------------------------------*/
1033-
// TODO - this is somewhat a hack because it relies on TypeNameOrCtorSuffix
1033+
// Note - before the "." only Type names are permitted (no 'digits'), but name resolution sorts that
1034+
// out, since the parser does not know (without adding lookahead) when it has seen the last dot
10341035
// matching any permitted member name
10351036

10361037
ExportSignature<bool opaque, out ExportSignature exsig>

docs/DafnyRef/DafnyRef.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,8 @@ user understand how to do proofs with Dafny.
5454
<!--PDF NEWPAGE-->
5555
{% include_relative UserGuide.md %}
5656

57-
# 25. TODO
5857

59-
-- const, static const
60-
61-
-- declarations
62-
63-
-- inference of array sizes
64-
65-
-- witness, ghost witness clauses
66-
67-
-- customizable error messages
68-
69-
-- opaque types
70-
71-
-- traits, object
72-
73-
-- non-null types
74-
75-
-- abstemious functions
76-
77-
-- labels (for program locations)
78-
79-
-- updates to shared destructors
80-
81-
-- labelled assertion statements, labelled preconditions
8258

8359
{% include_relative SyntaxTests.md %}
8460

85-
# 27. References
61+
# 26. References

docs/DafnyRef/Expressions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,12 @@ TODO: what about multi-dimensional arrays
501501

502502
## 20.17. Object Allocation
503503
````grammar
504-
ObjectAllocation_ = "new" Type [ "." ( Ident | digits ) ]
504+
ObjectAllocation_ = "new" Type [ "." TypeNameOrCtorSuffix ]
505505
[ "(" [ Expressions ] ")" ]
506506
````
507507

508508
This allocated a new object of a class type as explained
509-
in section [Class Types](#sec-class-types)].
509+
in section [Class Types](#sec-class-types).
510510

511511
## 20.18. Havoc Right-Hand-Side
512512
````grammar

docs/DafnyRef/Grammar.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,11 @@ MethodFunctionName = NoUSIdentOrDigits
470470
LabelName = NoUSIdentOrDigits
471471
AttributeName = NoUSIdent
472472
ExportId = NoUSIdentOrDigits
473+
TypeNameOrCtorSuffix = NoUSIdentOrDigits
473474
````
474475

476+
Some parsing constexts
477+
475478
### 2.6.3. Qualified Names
476479
```grammar
477480
QualifiedModuleName = ModuleName { "." ModuleName }

docs/DafnyRef/Modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ ModuleExport =
294294
| "extends" ExportId { "," ExportId }
295295
}
296296
297-
ExportSignature = IdentOrDigits [ "." IdentOrDigits ]
297+
ExportSignature = TypeNameOrCtorSuffix [ "." TypeNameOrCtorSuffix ]
298298
````
299299

300300
In some programming languages, keywords such as `public`, `private`, and `protected`

docs/DafnyRef/Refinement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Typically this is the presence of a `...` token.
6262

6363
A refining export set declaration begins with the syntax
6464
````grammar
65-
"export" Ident "..."
65+
"export" Ident ellipsis
6666
````
6767
but otherwise contains the same `provides`, `reveals` and `extends` sections,
6868
with the ellipsis indicating that it is a refining declaration.

docs/DafnyRef/Statements.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,9 @@ VarDeclStatement =
607607
)
608608
";"
609609
610-
CasePatternLocal = "(" CasePattern { "," CasePattern } ")" // TODO
610+
CasePatternLocal = ( [ Ident ] "(" CasePatternLocsl { "," CasePatternLocal } ")"
611+
| LocalIdentTypeOptional
612+
)
611613
````
612614

613615
A ``VarDeclStatement`` is used to declare one or more local variables in

0 commit comments

Comments
 (0)