File: HappyDoAction.hs.prettyprinter.golden

package info (click to toggle)
haskell-src-exts 1.23.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,852 kB
  • sloc: haskell: 13,707; makefile: 12
file content (20 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE MagicHash #-}
module HappyDoAction where

foo :: Int#
happyDoAction i tk st
  = case action of
        0# -> happyFail i tk st
        -1# -> happyAccept i tk st
        n | (n <# (0# :: Int#)) -> (happyReduceArr ! rule) i tk st
          where rule = (I# ((negateInt# ((n +# (1# :: Int#))))))
        n -> happyShift new_state i tk st
          where new_state = (n -# (1# :: Int#))
  where off = indexShortOffAddr happyActOffsets st
        off_i = (off +# i)
        check
          = if (off_i >=# (0# :: Int#)) then
              (indexShortOffAddr happyCheck off_i ==# i) else False
        action
          | check = indexShortOffAddr happyTable off_i
          | otherwise = indexShortOffAddr happyDefActions st