X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fgenprimopcode%2FParser.y;h=5773abb4fe2d95822001eb945b52f1046c105bf0;hb=1f7ab811c4421458568b0ed900b496192fee885b;hp=07f1a84863a679be3749fd3bfcec0a60e70ce6c8;hpb=d759c7231dde979ed2824bd39b2fdff24357d355;p=ghc-hetmet.git diff --git a/utils/genprimopcode/Parser.y b/utils/genprimopcode/Parser.y index 07f1a84..5773abb 100644 --- a/utils/genprimopcode/Parser.y +++ b/utils/genprimopcode/Parser.y @@ -1,10 +1,11 @@ { -{-# OPTIONS_GHC -w #-} +{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 +{-# OPTIONS -w -Wwarn #-} -- The above warning supression flag is a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings -- for details module Parser (parse) where @@ -16,6 +17,7 @@ import Syntax } %name parsex +%expect 0 %tokentype { Token } %monad { ParserM } %lexer { lex_tok } { TEOF } @@ -46,6 +48,7 @@ import Syntax lowerName { TLowerName $$ } upperName { TUpperName $$ } string { TString $$ } + integer { TInteger $$ } noBraces { TNoBraces $$ } %% @@ -64,6 +67,7 @@ pOption :: { Option } pOption : lowerName '=' false { OptionFalse $1 } | lowerName '=' true { OptionTrue $1 } | lowerName '=' pStuffBetweenBraces { OptionString $1 $3 } + | lowerName '=' integer { OptionInteger $1 $3 } pEntries :: { [Entry] } pEntries : pEntry pEntries { $1 : $2 }