Skip to content

Commit 924804b

Browse files
authored
Fixing #833 with NoCut (#842)
1 parent 75fe55c commit 924804b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: src/main/scala/viper/silver/plugin/standard/termination/TerminationPlugin.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TerminationPlugin(@unused reporter: viper.silver.reporter.Reporter,
4747
def decreases[$: P]: P[PSpecification[PDecreasesKeyword.type]] =
4848
P((P(PDecreasesKeyword) ~ (decreasesWildcard | decreasesStar | decreasesTuple)) map (PSpecification.apply _).tupled).pos
4949
def decreasesTuple[$: P]: P[PDecreasesTuple] =
50-
P((exp.delimited(PSym.Comma) ~~~ condition.lw.?) map (PDecreasesTuple.apply _).tupled).pos
50+
P((NoCut(exp).delimited(PSym.Comma) ~~~ condition.lw.?) map (PDecreasesTuple.apply _).tupled).pos
5151
def decreasesWildcard[$: P]: P[PDecreasesWildcard] = P((P(PWildcardSym) ~~~ condition.lw.?) map (PDecreasesWildcard.apply _).tupled).pos
5252
def decreasesStar[$: P]: P[PDecreasesStar] = P(P(PSym.Star) map (PDecreasesStar(_) _)).pos
5353
def condition[$: P]: P[(PReserved[PIfKeyword.type], PExp)] = P(P(PIfKeyword) ~ exp)

Diff for: src/test/resources/all/issues/silver/0833.vpr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
function gggg(a: Int): Int
5+
decreases
6+
7+
@opaque()
8+
function hhhh(a: Int): Int
9+
decreases

0 commit comments

Comments
 (0)