Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do IOrigin wrapping around RangeToken, instead of inside its StartToken #5931

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
241acef
Rename IToken to IOrigin
keyboardDrummer Nov 25, 2024
69898ab
Refactoring, such joy
keyboardDrummer Nov 25, 2024
89889cc
Pre inline ToRange
keyboardDrummer Nov 26, 2024
2787c01
Before introducing Centre
keyboardDrummer Nov 26, 2024
0e5d714
It compiles
keyboardDrummer Nov 26, 2024
a43ca21
Before changing .RangeToken calls to .Origin
keyboardDrummer Nov 26, 2024
df691a4
Replace usages of RangeToken with Origin
keyboardDrummer Nov 26, 2024
5c5e592
Some tests pass but many are still failing
keyboardDrummer Nov 26, 2024
52a4676
Fix bug
keyboardDrummer Nov 26, 2024
a854010
Fixed some issues, but there are still issues with refinement
keyboardDrummer Nov 26, 2024
646ad48
LSP tests pass
keyboardDrummer Nov 26, 2024
f104a4f
Merge branch 'master' into iOriginStart
keyboardDrummer Nov 26, 2024
8946a2e
Fix parser issues
keyboardDrummer Nov 26, 2024
83bcb70
Merge branch 'iOriginStart' of github.com:keyboardDrummer/dafny into …
keyboardDrummer Nov 26, 2024
2ec82f9
Fix comp errors
keyboardDrummer Nov 26, 2024
0e4c4fb
Optimize performance
keyboardDrummer Nov 26, 2024
abc0a2d
Fix dfy code
keyboardDrummer Nov 26, 2024
12524bf
Two fixes
keyboardDrummer Nov 27, 2024
99ae588
Merge remote-tracking branch 'origin/master' into iOriginStart
keyboardDrummer Dec 2, 2024
f69f223
Fixes
keyboardDrummer Dec 2, 2024
e257680
Fix bug
keyboardDrummer Dec 2, 2024
302751b
Small fix
keyboardDrummer Dec 3, 2024
fb652b6
Another fix
keyboardDrummer Dec 3, 2024
52849f7
Fix
keyboardDrummer Dec 3, 2024
7325523
Fixes to old symbol table
keyboardDrummer Dec 3, 2024
5bf6d0c
Fixes
keyboardDrummer Dec 3, 2024
6196d62
Merge remote-tracking branch 'origin/master' into iOriginStart
keyboardDrummer Dec 3, 2024
40b2fae
Fixes
keyboardDrummer Dec 3, 2024
7977f66
Fix opaque function code
keyboardDrummer Dec 3, 2024
16f05a8
Another fix
keyboardDrummer Dec 3, 2024
194c6e4
Remove Token from AST nodes
keyboardDrummer Dec 3, 2024
5d8776e
More IOrigin instead of Token
keyboardDrummer Dec 3, 2024
d667cb2
Merge commit '5670005e495148' into iOriginStart
keyboardDrummer Dec 4, 2024
b8377ca
Merge commit 'de81b69edde260' into iOriginStart
keyboardDrummer Dec 4, 2024
2187519
Merge remote-tracking branch 'origin/master' into iOriginStart
keyboardDrummer Dec 4, 2024
3f12d68
Refactoring
keyboardDrummer Dec 4, 2024
72c7275
Fixes and a rename
keyboardDrummer Dec 4, 2024
97df3e2
Fixes
keyboardDrummer Dec 4, 2024
981c547
Ran formatter
keyboardDrummer Dec 4, 2024
d64a635
Fix formatting.cs
keyboardDrummer Dec 4, 2024
9a9e4c4
Parser class cast fix
keyboardDrummer Dec 4, 2024
f1fd455
Fixes
keyboardDrummer Dec 4, 2024
47f5ab0
Small changes
keyboardDrummer Dec 4, 2024
6519ea9
Fixes
keyboardDrummer Dec 5, 2024
83e9ab8
Do not use copied nodes as CanVerify targets, instead of doing .Disti…
keyboardDrummer Dec 5, 2024
d5ee1c9
Let symbols that are redeclared during refinement, having their own o…
keyboardDrummer Dec 5, 2024
efecd0d
Tiny changes
keyboardDrummer Dec 5, 2024
6a389d1
Merge remote-tracking branch 'fork/refinedSymbolVerification' into iO…
keyboardDrummer Dec 5, 2024
13f28a5
Make member private
keyboardDrummer Dec 5, 2024
f43a45f
Update expect files
keyboardDrummer Dec 5, 2024
1e77aba
Add release note
keyboardDrummer Dec 5, 2024
74d3063
Merge remote-tracking branch 'fork/refinedSymbolVerification' into iO…
keyboardDrummer Dec 5, 2024
9e4b484
Fix for Json diagnostics
keyboardDrummer Dec 5, 2024
a47485c
Fix
keyboardDrummer Dec 5, 2024
0d44506
Fix NRE
keyboardDrummer Dec 5, 2024
4b7922a
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
a74ae6c
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
0da6795
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
9304736
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
486caa5
Fix --show-snippets
keyboardDrummer Dec 5, 2024
6fbd9bc
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
1b421fa
Update expect file to use more precise center tokens
keyboardDrummer Dec 5, 2024
df9a57b
Test file fixes
keyboardDrummer Dec 5, 2024
bd89393
Fix NoToken related bug
keyboardDrummer Dec 5, 2024
8d89920
Merge branch 'master' into refinedSymbolVerification
keyboardDrummer Dec 5, 2024
a029dc0
Fix bug that showed up in superPosition.dfy
keyboardDrummer Dec 5, 2024
b023940
Update expect file
keyboardDrummer Dec 5, 2024
573026a
Merge branch 'master' into refinedSymbolVerification
keyboardDrummer Dec 6, 2024
5d3cb42
Fix canVerify generation
keyboardDrummer Dec 6, 2024
e5bb351
Fixes
keyboardDrummer Dec 6, 2024
9972352
Updates
keyboardDrummer Dec 6, 2024
ded6821
Fix oops
keyboardDrummer Dec 6, 2024
a899fd8
Fixes
keyboardDrummer Dec 9, 2024
0f9a17a
Fixes
keyboardDrummer Dec 9, 2024
0f7a54d
Fixes
keyboardDrummer Dec 9, 2024
cec769b
Merge commit 'db52871199ac~1' into iOriginStart
keyboardDrummer Dec 9, 2024
5467c13
Merge branch 'refinedSymbolVerification' into iOriginStart
keyboardDrummer Dec 9, 2024
2267244
Fix warning
keyboardDrummer Dec 9, 2024
daf256c
Fixes
keyboardDrummer Dec 9, 2024
4d6faf8
Fix
keyboardDrummer Dec 9, 2024
cd9a23c
Merge commit 'db52871199ac' into iOriginStart
keyboardDrummer Dec 9, 2024
6a78ede
Fix typo
keyboardDrummer Dec 10, 2024
939f828
Fix expect files and a bug
keyboardDrummer Dec 10, 2024
2d090d7
Merge branch 'master' into iOriginStart
keyboardDrummer Dec 10, 2024
1416e11
Ran formatter
keyboardDrummer Dec 11, 2024
db6b1e7
Merge branch 'iOriginStart' of github.com:keyboardDrummer/dafny into …
keyboardDrummer Dec 11, 2024
e2f067f
Cleanup
keyboardDrummer Dec 11, 2024
1840fa9
Install dotnet in CI
keyboardDrummer Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/runtime-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches: [ master, main-* ]
merge_group:

env:
dotnet-version: 6.0.x # SDK Version for building Dafny

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -25,6 +28,10 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{env.dotnet-version}}
- name: Set up JDK 18
uses: actions/setup-java@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions Source/DafnyCore.Test/ClonerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public void ClonerKeepsBodyStartTok() {
var rangeToken = new RangeToken(Token.NoToken, Token.NoToken);
var specificationFrame = new LiteralExpr(Microsoft.Dafny.Token.NoToken, 1);
var formal1 = new Formal(Token.NoToken, "a", Microsoft.Dafny.Type.Bool, true, false, null) {
RangeToken = new RangeToken(tokenBodyStart, tokenBodyStart),
RangeOrigin = new RangeToken(tokenBodyStart, tokenBodyStart),
IsTypeExplicit = true
};
var formal2 = new Formal(Token.NoToken, "b", Microsoft.Dafny.Type.Bool, true, false, null) {
RangeToken = new RangeToken(tokenBodyStart, tokenBodyStart),
RangeOrigin = new RangeToken(tokenBodyStart, tokenBodyStart),
IsTypeExplicit = false
};
var dummyDecl = new Method(rangeToken, new Name(rangeToken, "hello"),
Expand All @@ -45,9 +45,9 @@ public void ClonerKeepsBodyStartTok() {
var cloner = new Cloner();
var dummyDecl2 = cloner.CloneMethod(dummyDecl);
Assert.Equal(2, dummyDecl2.BodyStartTok.line);
Assert.Equal(2, dummyDecl2.Ins[0].RangeToken.StartToken.line);
Assert.Equal(2, dummyDecl2.Ins[0].Origin.StartToken.line);
Assert.True(dummyDecl2.Ins[0].IsTypeExplicit);
Assert.Equal(2, dummyDecl2.Ins[1].RangeToken.StartToken.line);
Assert.Equal(2, dummyDecl2.Ins[1].Origin.StartToken.line);
Assert.False(dummyDecl2.Ins[1].IsTypeExplicit);
}
}
15 changes: 11 additions & 4 deletions Source/DafnyCore.Test/NodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ namespace DafnyCore.Test;
public class NodeTests {

class ConcreteNode : Node {
public ConcreteNode(RangeToken rangeOrigin, IEnumerable<INode>? children = null) {
RangeToken = rangeOrigin;
private IOrigin origin;

public ConcreteNode(IOrigin rangeToken, IEnumerable<INode>? children = null) {
origin = rangeToken;
Children = children ?? Enumerable.Empty<INode>();
}

public override RangeToken RangeToken { get; set; }
public override IOrigin Tok => RangeToken.StartToken;
public override IOrigin Origin => origin;

public override IOrigin RangeOrigin {
set => origin = value;
}

public override IOrigin Tok => origin.StartToken;
public override IEnumerable<INode> Children { get; }
public override IEnumerable<INode> PreResolveChildren => Children;
}
Expand Down
6 changes: 3 additions & 3 deletions Source/DafnyCore/AST/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public static Attributes ExpandAtAttribute(Program program, UserSuppliedAtAttrib
var bindings = atAttribute.UserSuppliedPreResolveBindings;

if (name == null) {
program.Reporter.Error(MessageSource.Resolver, atAttribute.RangeToken, "Attribute not recognized: " + atAttribute.ToString());
program.Reporter.Error(MessageSource.Resolver, atAttribute.Origin, "Attribute not recognized: " + atAttribute.ToString());
return null;
}

Expand All @@ -316,7 +316,7 @@ public static Attributes ExpandAtAttribute(Program program, UserSuppliedAtAttrib
}

if (!builtinSyntax.CanBeApplied(attributeHost)) {
program.Reporter.Error(MessageSource.Resolver, atAttribute.RangeToken, UserSuppliedAtAttribute.AtName + atAttribute.UserSuppliedName + " attribute cannot be applied to " + attributeHost.WhatKind);
program.Reporter.Error(MessageSource.Resolver, atAttribute.Origin, UserSuppliedAtAttribute.AtName + atAttribute.UserSuppliedName + " attribute cannot be applied to " + attributeHost.WhatKind);
}

var resolver = new ModuleResolver(new ProgramResolver(program), program.Options) {
Expand Down Expand Up @@ -614,7 +614,7 @@ private static void ResolveLikeDatatypeConstructor(Program program, Formal[] for
// Verify that provided arguments are given literally
foreach (var binding in bindings.ArgumentBindings) {
if (binding.Actual is not LiteralExpr) {
program.Reporter.Error(MessageSource.Resolver, binding.Actual.RangeToken, $"Argument to attribute {attrName} must be a literal");
program.Reporter.Error(MessageSource.Resolver, binding.Actual.Origin, $"Argument to attribute {attrName} must be a literal");
}
}
}
Expand Down
Loading
Loading