summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar leino <unknown>2014-10-20 18:42:33 -0700
committerGravatar leino <unknown>2014-10-20 18:42:33 -0700
commitc182b533a83dfee69828620f12a051feaab03eac (patch)
tree6223081d1ca9009afb83f0ff44758a196f9cfce9 /Source/Dafny/Printer.cs
parent12242050fe7069f7dcf4e99f23b14f447e6b55e0 (diff)
Add char literals.
Disallow backslash from being part of identifier names.
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index 5eba44ee..c1a911f6 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -1214,7 +1214,9 @@ namespace Microsoft.Dafny {
wr.Write("null");
} else if (e.Value is bool) {
wr.Write((bool)e.Value ? "true" : "false");
- } else if (e.Value is string) {
+ } else if (e is CharLiteralExpr) {
+ wr.Write("'{0}'", (string)e.Value);
+ } else if (e is StringLiteralExpr) {
var str = (StringLiteralExpr)e;
wr.Write("{0}\"{1}\"", str.IsVerbatim ? "@" : "", (string)e.Value);
} else if (e.Value is Basetypes.BigDec) {