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

Provide more flexibility in configuring which return statements get separate VCs with isolate_assertions #979

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Source/Core/Generic/TokenWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public int CompareTo(IToken? other) {
return Inner.CompareTo(other);
}

public bool IsSourceToken => false;

public int kind {
get => Inner.kind;
set => Inner.kind = value;
Expand Down
6 changes: 6 additions & 0 deletions Source/Core/Token.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ namespace Microsoft.Boogie
[Immutable]
public interface IToken : IComparable<IToken>
{
/// <summary>
/// True if this token was created during parsing
/// </summary>
bool IsSourceToken { get; }
int kind { get; set; } // token kind
string filename { get; set; } // token file
int pos { get; set; } // token position in the source text (starting at 0)
Expand Down Expand Up @@ -48,6 +52,8 @@ public Token(int linenum, int colnum)
this._val = "anything so that it is nonnull";
}

public bool IsSourceToken => true;

public int kind
{
get { return this._kind; }
Expand Down
2 changes: 1 addition & 1 deletion Source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- Target framework and package configuration -->
<PropertyGroup>
<Version>3.4.1</Version>
<Version>3.4.2</Version>
<TargetFramework>net6.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Authors>Boogie</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static (List<ManualSplit> Isolated, ManualSplit Remainder) GetParts(VCGen

var gotoFromReturn = gotoCmd.tok as GotoFromReturn;
var isolateAttribute = QKeyValue.FindAttribute(gotoCmd.Attributes, p => p.Key == "isolate");
var isTypeOfAssert = gotoFromReturn != null && gotoFromReturn.Origin.tok is Token;
var isTypeOfAssert = gotoFromReturn != null && gotoFromReturn.Origin.tok.IsSourceToken;
var isolate = BlockRewriter.ShouldIsolate(isTypeOfAssert && splitOnEveryAssert, isolateAttribute);
if (!isolate) {
continue;
Expand Down
Loading