diff options
author | leino <unknown> | 2015-08-11 19:26:35 -0700 |
---|---|---|
committer | leino <unknown> | 2015-08-11 19:26:35 -0700 |
commit | 4325b50ed7732bdd2b7b7455bd290f385d0f5383 (patch) | |
tree | 28c8dc232826b6ba3a4e8851ab34a0f61253e91d /Source/Dafny/Printer.cs | |
parent | 34cb773ec61c32479c8d189b23e000af956cc28e (diff) |
Disallow user-defined attributes that begin with an underscore
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r-- | Source/Dafny/Printer.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs index 7a93a140..6081f2c6 100644 --- a/Source/Dafny/Printer.cs +++ b/Source/Dafny/Printer.cs @@ -443,11 +443,13 @@ namespace Microsoft.Dafny { }
public void PrintOneAttribute(Attributes a, string nameSubstitution = null) {
Contract.Requires(a != null);
- wr.Write(" {{:{0}", nameSubstitution ?? a.Name);
+ var name = nameSubstitution ?? a.Name;
+ var usAttribute = name.StartsWith("_");
+ wr.Write(" {1}{{:{0}", name, usAttribute ? "/*" : "");
if (a.Args != null) {
PrintAttributeArgs(a.Args, false);
}
- wr.Write("}");
+ wr.Write("}}{0}", usAttribute ? "*/" : "");
}
public void PrintAttributeArgs(List<Expression> args, bool isFollowedBySemicolon) {
|