better error message
This commit is contained in:
@@ -202,7 +202,7 @@ buildInitialHeap (Program ss) = mapAccumL allocateSc mempty compiled
|
|||||||
| k `elem` domain = [Push n]
|
| k `elem` domain = [Push n]
|
||||||
| otherwise = [PushGlobal k]
|
| otherwise = [PushGlobal k]
|
||||||
where
|
where
|
||||||
n = fromMaybe (error "unknown var") $ lookup k g
|
n = fromMaybe (error $ "undeclared var: " <> k) $ lookup k g
|
||||||
domain = fmap fst g
|
domain = fmap fst g
|
||||||
|
|
||||||
compileC g (IntE n) = [PushInt n]
|
compileC g (IntE n) = [PushInt n]
|
||||||
|
|||||||
Reference in New Issue
Block a user