1{-# LANGUAGE MagicHash #-}
2module HappyDoAction where
3
4foo :: Int#
5happyDoAction i tk st
6  = case action of
7        0# -> happyFail i tk st
8        -1# -> happyAccept i tk st
9        n | (n <# (0# :: Int#)) -> (happyReduceArr ! rule) i tk st
10          where rule = (I# ((negateInt# ((n +# (1# :: Int#))))))
11        n -> happyShift new_state i tk st
12          where new_state = (n -# (1# :: Int#))
13  where off = indexShortOffAddr happyActOffsets st
14        off_i = (off +# i)
15        check
16          = if (off_i >=# (0# :: Int#)) then
17              (indexShortOffAddr happyCheck off_i ==# i) else False
18        action
19          | check = indexShortOffAddr happyTable off_i
20          | otherwise = indexShortOffAddr happyDefActions st
21