File: bogus-token.y

package info (click to toggle)
happy 1.18.9-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,024 kB
  • sloc: haskell: 6,327; xml: 3,388; yacc: 809; makefile: 263
file content (23 lines) | stat: -rw-r--r-- 333 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
module Main where
import Control.Exception as Exception
}

%tokentype { Token }
%token A { A }

%name parse

%%

parse : A { () }

{
data Token = A | B

test1 = parse [B]
main =  do Exception.try (print test1 >> fail "Test failed.") :: IO (Either ErrorCall ())
           putStrLn "Test worked"

happyError = error "parse error"
}