Changeset 7035 for src/Pugs/Parser.hs
- Timestamp:
- 09/17/05 22:55:58 (3 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Parser.hs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Parser.hs
r7033 r7035 898 898 "BEGIN" -> do 899 899 -- We've to exit if the user has written code like BEGIN { exit }. 900 possiblyExit =<< unsafeEvalExp (checkForIOLeak fun) 900 val <- possiblyExit =<< unsafeEvalExp (checkForIOLeak fun) 901 -- And install any pragmas they've requested. 902 env <- getRuleEnv 903 let idat = unsafePerformIO $ liftSTM $ readTVar $ envInitDat env 904 install $ initPragmas idat 905 return val 901 906 "CHECK" -> vcode2checkBlock code 902 907 "INIT" -> vcode2initBlock code 903 908 "FIRST" -> vcode2firstBlock code 904 909 _ -> fail "" 910 where 911 install [] = return () 912 install (x:xs) = do 913 env' <- getRuleEnv 914 let env'' = envCaller env' -- not sure about this. 915 case env'' of 916 Just target -> do 917 putRuleEnv target { envPragmas = 918 PrPrags{ pragma = x 919 , pragmas = envPragmas target} } 920 install xs 921 _ -> fail "no caller env to install pragma in" 905 922 906 923 {-| Wraps a call to @&Pugs::Internals::check_for_io_leak@ around the input
