X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=utils%2Fgenprimopcode%2FLexer.x;h=6f48c02f8ff493c48330fca9ad4583801834c17b;hp=19b0f667d690f223945409f7b4e1bda0d277eeca;hb=b2524b3960999fffdb3767900f58825903f6560f;hpb=03ffa2bfa6c31dc6bcdcacecc2bdb3bbabd800a9 diff --git a/utils/genprimopcode/Lexer.x b/utils/genprimopcode/Lexer.x index 19b0f66..6f48c02 100644 --- a/utils/genprimopcode/Lexer.x +++ b/utils/genprimopcode/Lexer.x @@ -1,10 +1,17 @@ { +{-# LANGUAGE BangPatterns #-} -- required for versions of Alex before 2.3.4 +{-# 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/Commentary/CodingStyle#Warnings +-- for details + module Lexer (lex_tok) where -import Control.Monad.State (StateT, get) import ParserM (ParserM (..), mkT, mkTv, Token(..), St, start_code, - StartCode, Action, set_start_code, + set_start_code, inc_brace_depth, dec_brace_depth, show_pos, position, input, AlexInput, alexGetChar, alexInputPrevChar) @@ -47,6 +54,7 @@ words :- <0> "thats_all_folks" { mkT TThatsAllFolks } <0> [a-z][a-zA-Z0-9\#_]* { mkTv TLowerName } <0> [A-Z][a-zA-Z0-9\#_]* { mkTv TUpperName } + <0> [0-9][0-9]* { mkTv (TInteger . read) } <0> \" [^\"]* \" { mkTv (TString . tail . init) } [^\{\}]+ { mkTv TNoBraces } \n { mkTv TNoBraces }