-- TODO: Allow 2147483648 in negation
weedExpression :: Expression -> WeedError
weedExpression (Unary "-" (Value TypeInt value innerDepth) outerDepth)
  | intVal > 2147483648 = Just "Integer literal out of range"
  -- Again, a dirty trick to detect if the integer literal was parenthesized
  | (innerDepth > outerDepth + 11) && intVal > 2147483647 = Just "Integer literal out of range"
  | otherwise = Nothing
  where intVal = read value
weedExpression :: Expression -> WeedError
weedExpression (Unary "-" (Value TypeInt value innerDepth) outerDepth)
  | intVal > 2147483648 = Just "Integer literal out of range"
  -- Again, a dirty trick to detect if the integer literal was parenthesized
  | (innerDepth > outerDepth + 11) && intVal > 2147483647 = Just "Integer literal out of range"
  | otherwise = Nothing
  where intVal = read value
weedExpression (Unary "-" (Value TypeInt value innerDepth) outerDepth)
  | intVal > 2147483648 = Just "Integer literal out of range"
  -- Again, a dirty trick to detect if the integer literal was parenthesized
  | (innerDepth > outerDepth + 11) && intVal > 2147483647 = Just "Integer literal out of range"
  | otherwise = Nothing
  where intVal = read value