aboutsummaryrefslogtreecommitdiff
path: root/Sil/Util
diff options
context:
space:
mode:
authorCamil Staps2017-07-27 13:05:23 +0200
committerCamil Staps2017-07-27 13:05:39 +0200
commitea4794ccdc9d0d8709ba22e43494e392b48be768 (patch)
tree26cdfda5d554beeecb08983f3d4d38219a779f6c /Sil/Util
parentAdd test file for #10 (lazy logical operators) (diff)
Resolve #4: mandatory initial values for basic locals
Diffstat (limited to 'Sil/Util')
-rw-r--r--Sil/Util/Printer.icl6
1 files changed, 5 insertions, 1 deletions
diff --git a/Sil/Util/Printer.icl b/Sil/Util/Printer.icl
index ff9c3f2..3ed15fb 100644
--- a/Sil/Util/Printer.icl
+++ b/Sil/Util/Printer.icl
@@ -88,7 +88,11 @@ where
instance PrettyPrinter Initialisation
where
- print st init = st <+ init.init_type <+ " " <+ init.init_name <+ ";"
+ print st init = st <+ init.init_type <+ " " <+ init.init_name <+ val <+ ";"
+ where
+ val = case init.init_value of
+ Nothing -> ""
+ Just v -> " := " <+ v
instance PrettyPrinter Statement
where