Skip to content

Commit 1b588f0

Browse files
authored
Merge pull request #795 from viperproject/meilers_disallow_nested_macros
Add argument to properly disallow nested macros
2 parents 8466d7c + add2669 commit 1b588f0

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/scala/viper/silver/parser/FastParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ class FastParser {
751751
}
752752

753753
def stmt(allowDefine: Boolean = true)(implicit ctx : P[_]) : P[PStmt] = P(ParserExtension.newStmtAtStart(ctx) | annotatedStmt |
754-
stmtReservedKw(allowDefine) | stmtBlock() |
754+
stmtReservedKw(allowDefine) | stmtBlock(allowDefine) |
755755
assign | ParserExtension.newStmtAtEnd(ctx))
756756

757757
def annotatedStmt(implicit ctx : P[_]): P[PStmt] = P((annotation ~ stmt()) map (PAnnotatedStmt.apply _).tupled).pos
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Any copyright is dedicated to the Public Domain.
2+
// http://creativecommons.org/publicdomain/zero/1.0/
3+
4+
define outer_macro () {
5+
//:: ExpectedOutput(parser.error)
6+
{ define inner_macro 42 }
7+
}
8+
9+
method test()
10+
{
11+
outer_macro()
12+
}

0 commit comments

Comments
 (0)