From 2fdf749be059c2eb09ffc799ae97c9176c71adf3 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Sun, 6 Apr 2008 02:28:43 +0000 Subject: [PATCH] Handle Infer in evalSimpleLiteral. --- common/EvalLiterals.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/EvalLiterals.hs b/common/EvalLiterals.hs index eccd481..f1b51bf 100644 --- a/common/EvalLiterals.hs +++ b/common/EvalLiterals.hs @@ -113,6 +113,13 @@ fromRead = fromRead' id undefined -- | Evaluate a simple (non-array) literal. evalSimpleLiteral :: A.Expression -> EvalM OccValue +-- If the type hasn't yet been inferred, we use the default type. +evalSimpleLiteral (A.Literal _ A.Infer (A.ByteLiteral _ s)) + = evalByteLiteral s +evalSimpleLiteral (A.Literal _ A.Infer (A.IntLiteral _ s)) + = fromRead OccInt (readSigned readDec) s +evalSimpleLiteral (A.Literal _ A.Infer (A.HexLiteral _ s)) + = fromRead OccInt readHex s evalSimpleLiteral (A.Literal _ A.Byte (A.ByteLiteral _ s)) = evalByteLiteral s evalSimpleLiteral (A.Literal _ A.Byte (A.IntLiteral _ s))