{-# LANGUAGE DeriveGeneric #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -- UUAGC 0.9.53.1 (src/GLua/AG/PrettyPrint.ag) module GLua.AG.PrettyPrint where {-# LINE 10 "src/GLua/AG/AST.ag" #-} import GLua.AG.Token import GLua.TokenTypes () import GHC.Generics import Data.Aeson {-# LINE 15 "src/GLua/AG/PrettyPrint.hs" #-} {-# LINE 4 "src/GLua/AG/PrettyPrint.ag" #-} import Prelude hiding ((<>)) import Data.List (foldl') import GLua.AG.AST import Text.PrettyPrint hiding (parens, brackets, braces) import GLua.TokenTypes import Data.Maybe import Text.Parsec import Text.Parsec.Error import Text.ParserCombinators.UU.BasicInstances hiding (pos) import Debug.Trace {-# LINE 29 "src/GLua/AG/PrettyPrint.hs" #-} {-# LINE 19 "src/GLua/AG/PrettyPrint.ag" #-} tok :: MToken -> Doc tok (MToken _ t) = zeroWidthText . show $ t printList :: (a -> Doc) -> String -> [a] -> Doc printList _ _ [] = empty printList f sep' (e : es) = (f e) <> g es where g [] = empty g (e' : es') = zeroWidthText sep' <> (f e') <> g es' data IsEmpty = IsEmpty | NonEmpty fromEmpty :: IsEmpty -> Bool fromEmpty IsEmpty = True fromEmpty NonEmpty = False toEmpty :: Bool -> IsEmpty toEmpty b = if b then IsEmpty else NonEmpty data PrettyPrintConfig = PPConfig { spaceAfterParens :: Bool, spaceAfterBrackets :: Bool, spaceAfterBraces :: Bool, spaceEmptyParens :: Bool, spaceEmptyBraces :: Bool, spaceAfterLabel :: Bool, spaceBeforeComma :: Bool, spaceAfterComma :: Bool, semicolons :: Bool, cStyle :: Bool, removeRedundantParens :: Bool, minimizeParens :: Bool, assumeOperatorAssociativity :: Bool, indentation :: String } defaultPPConfig :: PrettyPrintConfig defaultPPConfig = PPConfig { spaceAfterParens = False, spaceAfterBrackets = False, spaceAfterBraces = False, spaceEmptyParens = False, spaceEmptyBraces = False, spaceAfterLabel = False, spaceBeforeComma = False, spaceAfterComma = True, semicolons = False, cStyle = False, removeRedundantParens = True, assumeOperatorAssociativity = True, minimizeParens = False, indentation = " " } metaDoc :: Maybe MToken -> Doc metaDoc (Just m) = zchr ':' <> tok m metaDoc Nothing = empty printVarList :: [(PrefixExp, Maybe MExpr)] -> Doc printVarList vars = printList pp_prefixexp ", " (map fst vars) <-> zchr '=' <-> printList pp_mexpr ", " (catMaybes . map snd $ vars) printStats :: [MStat] -> Int -> Doc printStats [] _ = empty printStats (x : xs) i = nest (i * 4) (pp_mstat x i) $+$ printStats xs i printElIfs :: [(MExpr, Block)] -> Int -> Doc printElIfs [] _ = empty printElIfs ((e, b) : es) i = zeroWidthText "elseif" <-> pp_mexpr e <-> zeroWidthText "then" $+$ pp_block b i $+$ printElIfs es i printEls :: Maybe Block -> Int -> Doc printEls Nothing _ = empty printEls (Just b) i = zeroWidthText "else" $+$ pp_block b i renderPos :: LineColPos -> String renderPos (LineColPos l c _) = "line " ++ show (succ l) ++ ", column " ++ show (succ c) renderRegion :: Region -> String renderRegion (Region l r) = renderPos l ++ " - " ++ renderPos r renderSourcePos :: SourcePos -> String renderSourcePos sp = "line " ++ (show . succ . sourceLine $ sp) ++ ", column " ++ (show . succ . sourceColumn $ sp) getMStatPos :: MStat -> String getMStatPos (MStat p _) = renderRegion p getAReturnPos :: AReturn -> String getAReturnPos (AReturn p _) = renderRegion p getAReturnPos NoReturn = "" getMExprPos :: MExpr -> String getMExprPos (MExpr p _) = renderRegion p renderError :: Error LineColPos -> String renderError (Inserted str pos strs) = renderPos pos ++ ": Inserted '" ++ str ++ "'." ++ render_expecting strs renderError (Deleted str pos strs) = renderPos pos ++ ": Removed '" ++ str ++ "'. " ++render_expecting strs renderError (Replaced str1 str2 pos strs) = renderPos pos ++ ": Replaced '" ++ str1 ++ "' with '" ++ str2 ++ "' at " ++ renderPos pos ++ render_expecting strs renderError (DeletedAtEnd str) = "Deleted '" ++ str ++ "' at the end of the Lua file because the parser doesn't know what to do with it." render_expecting :: [String] -> String render_expecting [a] = "Parser expected a " ++ a render_expecting (a:as) = "Parser expected one of [" ++ a ++ concat (map (", " ++) as) ++ "]" render_expecting [] = "Parser expected nothing" renderPSError :: ParseError -> String renderPSError ps = map replNL . showErrorMessages "or" "unknown parse error" "expecting" "unexpected" "end of input" . errorMessages $ ps where replNL '\n' = ' ' replNL c = c -- | Render comments on multiple lines renderMLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc renderMLComments conf ind toks = foldl' ($+$) empty . map (indent conf ind . tok . convertComment conf) $ toks -- | Render comments, and prefer having them on a single line. It may not print comments on the same -- line if that would cause a syntax error (e.g. a multiline comment after a single line comment) renderSLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc renderSLComments conf ind toks = foldl' combine empty . map (convertComment conf) $ toks where combine :: Doc -> MToken -> Doc combine acc mt@(MToken _pos t) = case t of -- Block comments after single line comments cannot be printed on the same line, as that -- would cause a syntax error, e.g. in this case: -- foo = { -- single line comment -- --[[multiline -- comment -- ]] -- } -- Make sure in these cases the comment is printed on a new line, rather than on the -- same line DashBlockComment _depth comment | '\n' `elem` comment -> acc $+$ (indent conf ind $ tok mt) SlashBlockComment comment | '\n' `elem` comment -> acc $+$ (indent conf ind $ tok mt) _ -> acc <-> tok mt convertComment :: PrettyPrintConfig -> MToken -> MToken convertComment conf (MToken p t) = MToken p $ convert' t where convert' :: Token -> Token convert' = if cStyle conf then cComment else luaComment luaComment :: Token -> Token luaComment (SlashComment s) = DashComment s luaComment (SlashBlockComment s) = DashBlockComment (lastBracket s) s luaComment t' = t' -- converting /*]*/ would end up in --[[]]] when plainly converted -- Deepen the block comment by 1 if that's the case lastBracket :: String -> Int lastBracket [] = 0 lastBracket s = if last s == ']' then 1 else 0 cComment :: Token -> Token cComment (DashComment s) = SlashComment s cComment (DashBlockComment _ s) = SlashBlockComment s cComment t' = t' indent :: PrettyPrintConfig -> Int -> Doc -> Doc indent conf n = (<>) $ zeroWidthText (concat . replicate n $ indentation conf) parens :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc parens conf ie doc = zchr '(' `sep'` doc `sep'` zchr ')' where sep' :: Doc -> Doc -> Doc sep' = if spaceAfterParens conf && (not (fromEmpty ie) || spaceEmptyParens conf) then (<->) else (<>) brackets :: PrettyPrintConfig -> Doc -> Doc brackets conf doc = zchr '[' `sep'` doc `sep'` zchr ']' where sep' :: Doc -> Doc -> Doc sep' = if spaceAfterBrackets conf then (<->) else (<>) braces :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc braces conf ie doc = zchr '{' `sep'` doc `sep'` zchr '}' where sep' :: Doc -> Doc -> Doc sep' = if spaceAfterBraces conf && (not (fromEmpty ie) || spaceEmptyBraces conf) then (<->) else (<>) -- Zero width char zchr :: Char -> Doc zchr c = zeroWidthText [c] -- Zero width <+> infixl 6 <-> (<->) :: Doc -> Doc -> Doc a <-> b | a == empty = b | b == empty = a | otherwise = a <> zchr ' ' <> b -- Operator levels, where level 1 is the lowest level, and level 8 is the highest one -- See http://www.lua.org/manual/5.2/manual.html#3.4.7 data OperatorLevel -- At the top level, there is no assigned operator level yet. This serves as a bottom value. = TopLevelExpression | OperatorLevel1 | OperatorLevel2 | OperatorLevel3 | OperatorLevel4 | OperatorLevel5 | OperatorLevel6 | OperatorLevel7 | OperatorLevel8 deriving (Eq, Ord) {-# LINE 240 "src/GLua/AG/PrettyPrint.hs" #-} {-# LINE 754 "src/GLua/AG/PrettyPrint.ag" #-} pp_block :: Block -> Int -> Doc pp_block p i = pretty_Syn_Block (wrap_Block (sem_Block p) (Inh_Block [] i defaultPPConfig emptyRg)) pp_mstat :: MStat -> Int -> Doc pp_mstat p i = pretty_Syn_MStat (wrap_MStat (sem_MStat p) (Inh_MStat [] i False False defaultPPConfig)) pp_prefixexp :: PrefixExp -> Doc pp_prefixexp p = pretty_Syn_PrefixExp (wrap_PrefixExp (sem_PrefixExp p) (Inh_PrefixExp [] 0 True TopLevelExpression defaultPPConfig)) pp_pfexprsuffix :: PFExprSuffix -> Doc pp_pfexprsuffix p = pretty_Syn_PFExprSuffix (wrap_PFExprSuffix (sem_PFExprSuffix p) (Inh_PFExprSuffix [] 0 defaultPPConfig)) pp_field :: Field -> Doc pp_field p = pretty_Syn_Field (wrap_Field (sem_Field p) (Inh_Field [] 0 defaultPPConfig)) pp_mexpr :: MExpr -> Doc pp_mexpr p = pretty_Syn_MExpr (wrap_MExpr (sem_MExpr p) (Inh_MExpr [] 0 True TopLevelExpression defaultPPConfig)) prettyprint :: AST -> String prettyprint p = render $ pretty_Syn_AST (wrap_AST (sem_AST p) (Inh_AST 0 defaultPPConfig)) prettyprintConf :: PrettyPrintConfig -> AST -> String prettyprintConf conf p = render $ pretty_Syn_AST (wrap_AST (sem_AST p) (Inh_AST 0 conf)) renderBlock :: Block -> String renderBlock p = render $ pretty_Syn_Block (wrap_Block (sem_Block p) (Inh_Block [] 0 defaultPPConfig emptyRg)) renderStat :: Stat -> String renderStat p = render $ pretty_Syn_Stat (wrap_Stat (sem_Stat p) (Inh_Stat [] 0 False False defaultPPConfig emptyRg)) renderMStat :: MStat -> String renderMStat p = render $ pretty_Syn_MStat (wrap_MStat (sem_MStat p) (Inh_MStat [] 0 False False defaultPPConfig)) renderAReturn :: AReturn -> String renderAReturn p = render $ pretty_Syn_AReturn (wrap_AReturn (sem_AReturn p) (Inh_AReturn [] 0 defaultPPConfig)) renderFuncName :: FuncName -> String renderFuncName p = render $ pretty_Syn_FuncName (wrap_FuncName (sem_FuncName p) (Inh_FuncName [] 0 defaultPPConfig)) renderPrefixExp :: PrefixExp -> String renderPrefixExp p = render $ pretty_Syn_PrefixExp (wrap_PrefixExp (sem_PrefixExp p) (Inh_PrefixExp [] 0 True TopLevelExpression defaultPPConfig)) renderExpr :: Expr -> String renderExpr p = render $ pretty_Syn_Expr (wrap_Expr (sem_Expr p) (Inh_Expr [] 0 True TopLevelExpression defaultPPConfig emptyRg)) renderMExpr :: MExpr -> String renderMExpr p = render $ pretty_Syn_MExpr (wrap_MExpr (sem_MExpr p) (Inh_MExpr [] 0 True TopLevelExpression defaultPPConfig)) renderArgs :: Args -> String renderArgs p = render $ pretty_Syn_Args (wrap_Args (sem_Args p) (Inh_Args [] 0 defaultPPConfig)) renderField :: Field -> String renderField p = render $ pretty_Syn_Field (wrap_Field (sem_Field p) (Inh_Field [] 0 defaultPPConfig)) {-# LINE 299 "src/GLua/AG/PrettyPrint.hs" #-} -- AReturn ----------------------------------------------------- -- cata sem_AReturn :: AReturn -> T_AReturn sem_AReturn (AReturn _pos _values) = (sem_AReturn_AReturn _pos (sem_MExprList _values)) sem_AReturn (NoReturn) = (sem_AReturn_NoReturn) -- semantic domain type T_AReturn = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),AReturn,Bool,Bool,Doc,Int) data Inh_AReturn = Inh_AReturn {comments_Inh_AReturn :: ([MToken]),indent_Inh_AReturn :: Int,ppconf_Inh_AReturn :: PrettyPrintConfig} data Syn_AReturn = Syn_AReturn {comments_Syn_AReturn :: ([MToken]),copy_Syn_AReturn :: AReturn,hasBreaking_Syn_AReturn :: Bool,isMultiline_Syn_AReturn :: Bool,pretty_Syn_AReturn :: Doc,statementCount_Syn_AReturn :: Int} wrap_AReturn :: T_AReturn -> Inh_AReturn -> Syn_AReturn wrap_AReturn sem (Inh_AReturn _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_AReturn _lhsOcomments _lhsOcopy _lhsOhasBreaking _lhsOisMultiline _lhsOpretty _lhsOstatementCount)) sem_AReturn_AReturn :: Region -> T_MExprList -> T_AReturn sem_AReturn_AReturn pos_ values_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _valuesOcomments :: ([MToken]) _lhsOcomments :: ([MToken]) _valuesOisHead :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOstatementCount :: Int _lhsOcopy :: AReturn _valuesOindent :: Int _valuesOppconf :: PrettyPrintConfig _valuesIcomments :: ([MToken]) _valuesIcopy :: MExprList _valuesIisAssociative :: Bool _valuesIisMultiline :: Bool _valuesIpos :: Region _valuesIprecedence :: OperatorLevel _valuesIpretty :: Doc _lhsOpretty = ({-# LINE 552 "src/GLua/AG/PrettyPrint.ag" #-} _prettyCommentsBefore $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "return") <-> _valuesIpretty <> _semicolon <-> _prettyCommentsAfter {-# LINE 348 "src/GLua/AG/PrettyPrint.hs" #-} ) _isMultiline = ({-# LINE 553 "src/GLua/AG/PrettyPrint.ag" #-} _valuesIisMultiline {-# LINE 353 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 554 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf then zchr ';' else empty {-# LINE 358 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsBefore = ({-# LINE 555 "src/GLua/AG/PrettyPrint.ag" #-} renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore ) {-# LINE 363 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsAfter = ({-# LINE 556 "src/GLua/AG/PrettyPrint.ag" #-} renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter ) {-# LINE 368 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsBefore = ({-# LINE 557 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then span (\(MToken pos _) -> pos `before` pos_) _lhsIcomments else ([], _lhsIcomments) {-# LINE 373 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsAfter = ({-# LINE 558 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then span (\(MToken pos _) -> pos `beforeOrOnLine` (rgOr _valuesIpos pos_)) (snd _commentsBefore ) else ([], snd _commentsBefore ) {-# LINE 378 "src/GLua/AG/PrettyPrint.hs" #-} ) _valuesOcomments = ({-# LINE 559 "src/GLua/AG/PrettyPrint.ag" #-} snd _commentsAfter {-# LINE 383 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 560 "src/GLua/AG/PrettyPrint.ag" #-} _valuesIcomments {-# LINE 388 "src/GLua/AG/PrettyPrint.hs" #-} ) _valuesOisHead = ({-# LINE 561 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 393 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 562 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 398 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _isMultiline {-# LINE 403 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-} 1 {-# LINE 408 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AReturn pos_ _valuesIcopy {-# LINE 413 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 418 "src/GLua/AG/PrettyPrint.hs" #-} ) _valuesOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 423 "src/GLua/AG/PrettyPrint.hs" #-} ) _valuesOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 428 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _valuesIcomments,_valuesIcopy,_valuesIisAssociative,_valuesIisMultiline,_valuesIpos,_valuesIprecedence,_valuesIpretty) = values_ _valuesOcomments _valuesOindent _valuesOisHead _valuesOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount))) sem_AReturn_NoReturn :: T_AReturn sem_AReturn_NoReturn = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOstatementCount :: Int _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: AReturn _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 563 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 447 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 564 "src/GLua/AG/PrettyPrint.ag" #-} 0 {-# LINE 452 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 457 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 462 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} NoReturn {-# LINE 467 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 472 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 477 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount))) -- AST --------------------------------------------------------- -- cata sem_AST :: AST -> T_AST sem_AST (AST _comments _chunk) = (sem_AST_AST _comments (sem_Block _chunk)) -- semantic domain type T_AST = Int -> PrettyPrintConfig -> ( AST,Bool,Doc) data Inh_AST = Inh_AST {indent_Inh_AST :: Int,ppconf_Inh_AST :: PrettyPrintConfig} data Syn_AST = Syn_AST {copy_Syn_AST :: AST,isMultiline_Syn_AST :: Bool,pretty_Syn_AST :: Doc} wrap_AST :: T_AST -> Inh_AST -> Syn_AST wrap_AST sem (Inh_AST _lhsIindent _lhsIppconf) = (let ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIindent _lhsIppconf in (Syn_AST _lhsOcopy _lhsOisMultiline _lhsOpretty)) sem_AST_AST :: ([MToken]) -> T_Block -> T_AST sem_AST_AST comments_ chunk_ = (\ _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _chunkOcomments :: ([MToken]) _chunkOstatRegion :: Region _lhsOisMultiline :: Bool _lhsOcopy :: AST _chunkOindent :: Int _chunkOppconf :: PrettyPrintConfig _chunkIcomments :: ([MToken]) _chunkIcopy :: Block _chunkIhasBreaking :: Bool _chunkIisMultiline :: Bool _chunkIpretty :: Doc _chunkIstatementCount :: Int _lhsOpretty = ({-# LINE 460 "src/GLua/AG/PrettyPrint.ag" #-} _chunkIpretty $+$ _prettyComments {-# LINE 520 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyComments = ({-# LINE 461 "src/GLua/AG/PrettyPrint.ag" #-} renderMLComments _lhsIppconf _lhsIindent _chunkIcomments {-# LINE 525 "src/GLua/AG/PrettyPrint.hs" #-} ) _chunkOcomments = ({-# LINE 462 "src/GLua/AG/PrettyPrint.ag" #-} comments_ {-# LINE 530 "src/GLua/AG/PrettyPrint.hs" #-} ) _chunkOstatRegion = ({-# LINE 463 "src/GLua/AG/PrettyPrint.ag" #-} emptyRg {-# LINE 535 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _chunkIisMultiline {-# LINE 540 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AST comments_ _chunkIcopy {-# LINE 545 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 550 "src/GLua/AG/PrettyPrint.hs" #-} ) _chunkOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 555 "src/GLua/AG/PrettyPrint.hs" #-} ) _chunkOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 560 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _chunkIcomments,_chunkIcopy,_chunkIhasBreaking,_chunkIisMultiline,_chunkIpretty,_chunkIstatementCount) = chunk_ _chunkOcomments _chunkOindent _chunkOppconf _chunkOstatRegion in ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty))) -- Args -------------------------------------------------------- -- cata sem_Args :: Args -> T_Args sem_Args (ListArgs _args) = (sem_Args_ListArgs (sem_MExprList _args)) sem_Args (TableArg _arg) = (sem_Args_TableArg (sem_FieldList _arg)) sem_Args (StringArg _arg) = (sem_Args_StringArg _arg) -- semantic domain type T_Args = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),Args,Bool,Doc) data Inh_Args = Inh_Args {comments_Inh_Args :: ([MToken]),indent_Inh_Args :: Int,ppconf_Inh_Args :: PrettyPrintConfig} data Syn_Args = Syn_Args {comments_Syn_Args :: ([MToken]),copy_Syn_Args :: Args,isMultiline_Syn_Args :: Bool,pretty_Syn_Args :: Doc} wrap_Args :: T_Args -> Inh_Args -> Syn_Args wrap_Args sem (Inh_Args _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_Args _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty)) sem_Args_ListArgs :: T_MExprList -> T_Args sem_Args_ListArgs args_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _argsOisHead :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: Args _lhsOcomments :: ([MToken]) _argsOcomments :: ([MToken]) _argsOindent :: Int _argsOppconf :: PrettyPrintConfig _argsIcomments :: ([MToken]) _argsIcopy :: MExprList _argsIisAssociative :: Bool _argsIisMultiline :: Bool _argsIpos :: Region _argsIprecedence :: OperatorLevel _argsIpretty :: Doc _lhsOpretty = ({-# LINE 662 "src/GLua/AG/PrettyPrint.ag" #-} parens _lhsIppconf _emptyParams _argsIpretty {-# LINE 612 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyParams = ({-# LINE 663 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null _argsIcopy {-# LINE 617 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOisHead = ({-# LINE 664 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 622 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _argsIisMultiline {-# LINE 627 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ListArgs _argsIcopy {-# LINE 632 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 637 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _argsIcomments {-# LINE 642 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 647 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 652 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 657 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _argsIcomments,_argsIcopy,_argsIisAssociative,_argsIisMultiline,_argsIpos,_argsIprecedence,_argsIpretty) = args_ _argsOcomments _argsOindent _argsOisHead _argsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) sem_Args_TableArg :: T_FieldList -> T_Args sem_Args_TableArg arg_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _argOindent :: Int _lhsOisMultiline :: Bool _lhsOcopy :: Args _lhsOcomments :: ([MToken]) _argOcomments :: ([MToken]) _argOppconf :: PrettyPrintConfig _argIcanFitOnSameLine :: Bool _argIcomments :: ([MToken]) _argIcopy :: FieldList _argIisMultiline :: Bool _argIisNil :: Bool _argIpretty :: Doc _lhsOpretty = ({-# LINE 665 "src/GLua/AG/PrettyPrint.ag" #-} if _argIisMultiline then _prettyMulti else _prettySingle {-# LINE 684 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyMulti = ({-# LINE 666 "src/GLua/AG/PrettyPrint.ag" #-} zchr '{' $+$ indent _lhsIppconf (_lhsIindent + 1) _argIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}') {-# LINE 689 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettySingle = ({-# LINE 667 "src/GLua/AG/PrettyPrint.ag" #-} braces _lhsIppconf _emptyContents _argIpretty {-# LINE 694 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyContents = ({-# LINE 668 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null _argIcopy {-# LINE 699 "src/GLua/AG/PrettyPrint.hs" #-} ) _argOindent = ({-# LINE 669 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + (if _argIisMultiline then 1 else 0) {-# LINE 704 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _argIisMultiline {-# LINE 709 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} TableArg _argIcopy {-# LINE 714 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 719 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _argIcomments {-# LINE 724 "src/GLua/AG/PrettyPrint.hs" #-} ) _argOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 729 "src/GLua/AG/PrettyPrint.hs" #-} ) _argOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 734 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _argIcanFitOnSameLine,_argIcomments,_argIcopy,_argIisMultiline,_argIisNil,_argIpretty) = arg_ _argOcomments _argOindent _argOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) sem_Args_StringArg :: MToken -> T_Args sem_Args_StringArg arg_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcopy :: Args _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 670 "src/GLua/AG/PrettyPrint.ag" #-} tok arg_ {-# LINE 752 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 757 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} StringArg arg_ {-# LINE 762 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 767 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 772 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) -- BinOp ------------------------------------------------------- -- cata sem_BinOp :: BinOp -> T_BinOp sem_BinOp (AOr) = (sem_BinOp_AOr) sem_BinOp (AAnd) = (sem_BinOp_AAnd) sem_BinOp (ALT) = (sem_BinOp_ALT) sem_BinOp (AGT) = (sem_BinOp_AGT) sem_BinOp (ALEQ) = (sem_BinOp_ALEQ) sem_BinOp (AGEQ) = (sem_BinOp_AGEQ) sem_BinOp (ANEq) = (sem_BinOp_ANEq) sem_BinOp (AEq) = (sem_BinOp_AEq) sem_BinOp (AConcatenate) = (sem_BinOp_AConcatenate) sem_BinOp (APlus) = (sem_BinOp_APlus) sem_BinOp (BinMinus) = (sem_BinOp_BinMinus) sem_BinOp (AMultiply) = (sem_BinOp_AMultiply) sem_BinOp (ADivide) = (sem_BinOp_ADivide) sem_BinOp (AModulus) = (sem_BinOp_AModulus) sem_BinOp (APower) = (sem_BinOp_APower) -- semantic domain type T_BinOp = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),BinOp,Bool,Bool,OperatorLevel,Doc) data Inh_BinOp = Inh_BinOp {comments_Inh_BinOp :: ([MToken]),indent_Inh_BinOp :: Int,ppconf_Inh_BinOp :: PrettyPrintConfig} data Syn_BinOp = Syn_BinOp {comments_Syn_BinOp :: ([MToken]),copy_Syn_BinOp :: BinOp,isAssociative_Syn_BinOp :: Bool,isMultiline_Syn_BinOp :: Bool,precedence_Syn_BinOp :: OperatorLevel,pretty_Syn_BinOp :: Doc} wrap_BinOp :: T_BinOp -> Inh_BinOp -> Syn_BinOp wrap_BinOp sem (Inh_BinOp _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_BinOp _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty)) sem_BinOp_AOr :: T_BinOp sem_BinOp_AOr = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 745 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText (if cStyle _lhsIppconf then "||" else "or") {-# LINE 836 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 746 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel1 {-# LINE 841 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 747 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 846 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 851 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AOr {-# LINE 856 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 861 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 866 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AAnd :: T_BinOp sem_BinOp_AAnd = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 742 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText (if cStyle _lhsIppconf then "&&" else "and") {-# LINE 883 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 743 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel2 {-# LINE 888 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 744 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 893 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 898 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AAnd {-# LINE 903 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 908 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 913 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_ALT :: T_BinOp sem_BinOp_ALT = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 724 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "<" {-# LINE 930 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 725 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 935 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 726 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 940 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 945 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ALT {-# LINE 950 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 955 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 960 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AGT :: T_BinOp sem_BinOp_AGT = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 730 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText ">" {-# LINE 977 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 731 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 982 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 732 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 987 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 992 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AGT {-# LINE 997 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1002 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1007 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_ALEQ :: T_BinOp sem_BinOp_ALEQ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 727 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "<=" {-# LINE 1024 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 728 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 1029 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 729 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1034 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1039 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ALEQ {-# LINE 1044 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1049 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1054 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AGEQ :: T_BinOp sem_BinOp_AGEQ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 733 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText ">=" {-# LINE 1071 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 734 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 1076 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 735 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1081 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1086 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AGEQ {-# LINE 1091 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1096 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1101 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_ANEq :: T_BinOp sem_BinOp_ANEq = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 739 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText (if cStyle _lhsIppconf then "!=" else "~=") {-# LINE 1118 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 740 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 1123 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 741 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1128 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1133 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ANEq {-# LINE 1138 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1143 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1148 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AEq :: T_BinOp sem_BinOp_AEq = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 736 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "==" {-# LINE 1165 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 737 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel3 {-# LINE 1170 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 738 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1175 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1180 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AEq {-# LINE 1185 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1190 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1195 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AConcatenate :: T_BinOp sem_BinOp_AConcatenate = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 721 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText ".." {-# LINE 1212 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 722 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel4 {-# LINE 1217 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 723 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1222 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1227 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AConcatenate {-# LINE 1232 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1237 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1242 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_APlus :: T_BinOp sem_BinOp_APlus = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 703 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "+" {-# LINE 1259 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 704 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel5 {-# LINE 1264 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 705 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1269 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1274 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} APlus {-# LINE 1279 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1284 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1289 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_BinMinus :: T_BinOp sem_BinOp_BinMinus = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 706 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "-" {-# LINE 1306 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 707 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel5 {-# LINE 1311 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 708 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1316 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1321 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} BinMinus {-# LINE 1326 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1331 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1336 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AMultiply :: T_BinOp sem_BinOp_AMultiply = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 709 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "*" {-# LINE 1353 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 710 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel6 {-# LINE 1358 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 711 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1363 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1368 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AMultiply {-# LINE 1373 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1378 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1383 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_ADivide :: T_BinOp sem_BinOp_ADivide = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 712 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "/" {-# LINE 1400 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 713 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel6 {-# LINE 1405 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 714 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1410 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1415 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ADivide {-# LINE 1420 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1425 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1430 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_AModulus :: T_BinOp sem_BinOp_AModulus = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 715 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "%" {-# LINE 1447 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 716 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel6 {-# LINE 1452 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 717 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1457 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1462 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AModulus {-# LINE 1467 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1472 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1477 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_BinOp_APower :: T_BinOp sem_BinOp_APower = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: BinOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 718 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "^" {-# LINE 1494 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 719 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 1499 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 720 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1504 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1509 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} APower {-# LINE 1514 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1519 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1524 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) -- Block ------------------------------------------------------- -- cata sem_Block :: Block -> T_Block sem_Block (Block _stats _ret) = (sem_Block_Block (sem_MStatList _stats) (sem_AReturn _ret)) -- semantic domain type T_Block = ([MToken]) -> Int -> PrettyPrintConfig -> Region -> ( ([MToken]),Block,Bool,Bool,Doc,Int) data Inh_Block = Inh_Block {comments_Inh_Block :: ([MToken]),indent_Inh_Block :: Int,ppconf_Inh_Block :: PrettyPrintConfig,statRegion_Inh_Block :: Region} data Syn_Block = Syn_Block {comments_Syn_Block :: ([MToken]),copy_Syn_Block :: Block,hasBreaking_Syn_Block :: Bool,isMultiline_Syn_Block :: Bool,pretty_Syn_Block :: Doc,statementCount_Syn_Block :: Int} wrap_Block :: T_Block -> Inh_Block -> Syn_Block wrap_Block sem (Inh_Block _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion in (Syn_Block _lhsOcomments _lhsOcopy _lhsOhasBreaking _lhsOisMultiline _lhsOpretty _lhsOstatementCount)) sem_Block_Block :: T_MStatList -> T_AReturn -> T_Block sem_Block_Block stats_ ret_ = (\ _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _statsOisHead :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOstatementCount :: Int _lhsOcopy :: Block _lhsOcomments :: ([MToken]) _statsOcomments :: ([MToken]) _statsOindent :: Int _statsOppconf :: PrettyPrintConfig _statsOstatRegion :: Region _retOcomments :: ([MToken]) _retOindent :: Int _retOppconf :: PrettyPrintConfig _statsIcomments :: ([MToken]) _statsIcopy :: MStatList _statsIhasBreaking :: Bool _statsIisLast :: Bool _statsIisMultiline :: Bool _statsIpotentiallyAmbiguousAsStatement :: Bool _statsIpretty :: Doc _statsIstatementCount :: Int _retIcomments :: ([MToken]) _retIcopy :: AReturn _retIhasBreaking :: Bool _retIisMultiline :: Bool _retIpretty :: Doc _retIstatementCount :: Int _newl = ({-# LINE 466 "src/GLua/AG/PrettyPrint.ag" #-} if _statsIstatementCount > 0 && _retIhasBreaking then zchr '\n' else empty {-# LINE 1586 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 467 "src/GLua/AG/PrettyPrint.ag" #-} _statsIpretty <> _newl $+$ _retIpretty {-# LINE 1591 "src/GLua/AG/PrettyPrint.hs" #-} ) _statsOisHead = ({-# LINE 468 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1596 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} _statsIhasBreaking || _retIhasBreaking {-# LINE 1601 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _statsIisMultiline || _retIisMultiline {-# LINE 1606 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-} _statsIstatementCount + _retIstatementCount {-# LINE 1611 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Block _statsIcopy _retIcopy {-# LINE 1616 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1621 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _retIcomments {-# LINE 1626 "src/GLua/AG/PrettyPrint.hs" #-} ) _statsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1631 "src/GLua/AG/PrettyPrint.hs" #-} ) _statsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 1636 "src/GLua/AG/PrettyPrint.hs" #-} ) _statsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 1641 "src/GLua/AG/PrettyPrint.hs" #-} ) _statsOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 1646 "src/GLua/AG/PrettyPrint.hs" #-} ) _retOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _statsIcomments {-# LINE 1651 "src/GLua/AG/PrettyPrint.hs" #-} ) _retOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 1656 "src/GLua/AG/PrettyPrint.hs" #-} ) _retOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 1661 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _statsIcomments,_statsIcopy,_statsIhasBreaking,_statsIisLast,_statsIisMultiline,_statsIpotentiallyAmbiguousAsStatement,_statsIpretty,_statsIstatementCount) = stats_ _statsOcomments _statsOindent _statsOisHead _statsOppconf _statsOstatRegion ( _retIcomments,_retIcopy,_retIhasBreaking,_retIisMultiline,_retIpretty,_retIstatementCount) = ret_ _retOcomments _retOindent _retOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount))) -- Declaration ------------------------------------------------- -- cata sem_Declaration :: Declaration -> T_Declaration sem_Declaration ( x1,x2) = (sem_Declaration_Tuple (sem_PrefixExp x1) (sem_MaybeMExpr x2)) -- semantic domain type T_Declaration = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),Declaration,Doc,Bool,Bool,Doc,Doc,Bool) data Inh_Declaration = Inh_Declaration {comments_Inh_Declaration :: ([MToken]),indent_Inh_Declaration :: Int,ppconf_Inh_Declaration :: PrettyPrintConfig} data Syn_Declaration = Syn_Declaration {comments_Syn_Declaration :: ([MToken]),copy_Syn_Declaration :: Declaration,exprPretty_Syn_Declaration :: Doc,isDefined_Syn_Declaration :: Bool,isMultiline_Syn_Declaration :: Bool,pretty_Syn_Declaration :: Doc,varPretty_Syn_Declaration :: Doc,wouldBeAmbiguousIfNextStatementIsExprVar_Syn_Declaration :: Bool} wrap_Declaration :: T_Declaration -> Inh_Declaration -> Syn_Declaration wrap_Declaration sem (Inh_Declaration _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOvarPretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_Declaration _lhsOcomments _lhsOcopy _lhsOexprPretty _lhsOisDefined _lhsOisMultiline _lhsOpretty _lhsOvarPretty _lhsOwouldBeAmbiguousIfNextStatementIsExprVar)) sem_Declaration_Tuple :: T_PrefixExp -> T_MaybeMExpr -> T_Declaration sem_Declaration_Tuple x1_ x2_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOvarPretty :: Doc _lhsOexprPretty :: Doc _x1OparentOperatorPrecedence :: OperatorLevel _x1OparentOperatorAssociative :: Bool _lhsOisDefined :: Bool _lhsOisMultiline :: Bool _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Declaration _lhsOcomments :: ([MToken]) _lhsOpretty :: Doc _x1Ocomments :: ([MToken]) _x1Oindent :: Int _x1Oppconf :: PrettyPrintConfig _x2Ocomments :: ([MToken]) _x2Oindent :: Int _x2Oppconf :: PrettyPrintConfig _x1Icomments :: ([MToken]) _x1Icopy :: PrefixExp _x1IisAssociative :: Bool _x1IisLiteral :: Bool _x1IisMultiline :: Bool _x1IpotentiallyAmbiguousAsStatement :: Bool _x1Iprecedence :: OperatorLevel _x1Ipretty :: Doc _x2Icomments :: ([MToken]) _x2Icopy :: MaybeMExpr _x2IisAssociative :: Bool _x2IisDefined :: Bool _x2IisMultiline :: Bool _x2Iprecedence :: OperatorLevel _x2Ipretty :: Doc _x2IwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOvarPretty = ({-# LINE 406 "src/GLua/AG/PrettyPrint.ag" #-} _x1Ipretty {-# LINE 1729 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOexprPretty = ({-# LINE 407 "src/GLua/AG/PrettyPrint.ag" #-} _x2Ipretty {-# LINE 1734 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1OparentOperatorPrecedence = ({-# LINE 408 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 1739 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1OparentOperatorAssociative = ({-# LINE 409 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1744 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisDefined = ({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-} _x2IisDefined {-# LINE 1749 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _x1IisMultiline || _x2IisMultiline {-# LINE 1754 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} _x2IwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 1759 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (_x1Icopy,_x2Icopy) {-# LINE 1764 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1769 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _x2Icomments {-# LINE 1774 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 232 "src/GLua/AG/PrettyPrint.ag" #-} _x2Ipretty {-# LINE 1779 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Ocomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1784 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Oindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 1789 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Oppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 1794 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Ocomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _x1Icomments {-# LINE 1799 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Oindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 1804 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Oppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 1809 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _x1Icomments,_x1Icopy,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1IpotentiallyAmbiguousAsStatement,_x1Iprecedence,_x1Ipretty) = x1_ _x1Ocomments _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf ( _x2Icomments,_x2Icopy,_x2IisAssociative,_x2IisDefined,_x2IisMultiline,_x2Iprecedence,_x2Ipretty,_x2IwouldBeAmbiguousIfNextStatementIsExprVar) = x2_ _x2Ocomments _x2Oindent _x2Oppconf in ( _lhsOcomments,_lhsOcopy,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOvarPretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) -- Else -------------------------------------------------------- -- cata sem_Else :: Else -> T_Else sem_Else (Prelude.Just x) = (sem_Else_Just (sem_MElse x)) sem_Else Prelude.Nothing = sem_Else_Nothing -- semantic domain type T_Else = ([MToken]) -> Int -> PrettyPrintConfig -> Region -> ( ([MToken]),Else,Bool,Bool,Region,Doc) data Inh_Else = Inh_Else {comments_Inh_Else :: ([MToken]),indent_Inh_Else :: Int,ppconf_Inh_Else :: PrettyPrintConfig,statRegion_Inh_Else :: Region} data Syn_Else = Syn_Else {comments_Syn_Else :: ([MToken]),copy_Syn_Else :: Else,elsesExist_Syn_Else :: Bool,isMultiline_Syn_Else :: Bool,pos_Syn_Else :: Region,pretty_Syn_Else :: Doc} wrap_Else :: T_Else -> Inh_Else -> Syn_Else wrap_Else sem (Inh_Else _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion in (Syn_Else _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty)) sem_Else_Just :: T_MElse -> T_Else sem_Else_Just just_ = (\ _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion -> (let _lhsOelsesExist :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: Else _lhsOcomments :: ([MToken]) _lhsOpos :: Region _lhsOpretty :: Doc _justOcomments :: ([MToken]) _justOindent :: Int _justOppconf :: PrettyPrintConfig _justOstatRegion :: Region _justIcomments :: ([MToken]) _justIcopy :: MElse _justIelsesExist :: Bool _justIisMultiline :: Bool _justIpos :: Region _justIpretty :: Doc _lhsOelsesExist = ({-# LINE 443 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 1864 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _justIisMultiline {-# LINE 1869 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Just _justIcopy {-# LINE 1874 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1879 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _justIcomments {-# LINE 1884 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-} _justIpos {-# LINE 1889 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 232 "src/GLua/AG/PrettyPrint.ag" #-} _justIpretty {-# LINE 1894 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1899 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 1904 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 1909 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 1914 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _justIcomments,_justIcopy,_justIelsesExist,_justIisMultiline,_justIpos,_justIpretty) = just_ _justOcomments _justOindent _justOppconf _justOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) sem_Else_Nothing :: T_Else sem_Else_Nothing = (\ _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOpos :: Region _lhsOelsesExist :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: Else _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 444 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 1934 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 445 "src/GLua/AG/PrettyPrint.ag" #-} emptyRg {-# LINE 1939 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOelsesExist = ({-# LINE 293 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1944 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 1949 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Nothing {-# LINE 1954 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 1959 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 1964 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) -- ElseIf ------------------------------------------------------ -- cata sem_ElseIf :: ElseIf -> T_ElseIf sem_ElseIf ( x1,x2) = (sem_ElseIf_Tuple (sem_MExpr x1) (sem_Block x2)) -- semantic domain type T_ElseIf = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),ElseIf,Bool,Doc) data Inh_ElseIf = Inh_ElseIf {comments_Inh_ElseIf :: ([MToken]),indent_Inh_ElseIf :: Int,ppconf_Inh_ElseIf :: PrettyPrintConfig} data Syn_ElseIf = Syn_ElseIf {comments_Syn_ElseIf :: ([MToken]),copy_Syn_ElseIf :: ElseIf,isMultiline_Syn_ElseIf :: Bool,pretty_Syn_ElseIf :: Doc} wrap_ElseIf :: T_ElseIf -> Inh_ElseIf -> Syn_ElseIf wrap_ElseIf sem (Inh_ElseIf _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_ElseIf _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty)) sem_ElseIf_Tuple :: T_MExpr -> T_Block -> T_ElseIf sem_ElseIf_Tuple x1_ x2_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _x2Oindent :: Int _x2OstatRegion :: Region _x1OparentOperatorPrecedence :: OperatorLevel _x1OparentOperatorAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: ElseIf _lhsOcomments :: ([MToken]) _x1Ocomments :: ([MToken]) _x1Oindent :: Int _x1Oppconf :: PrettyPrintConfig _x2Ocomments :: ([MToken]) _x2Oppconf :: PrettyPrintConfig _x1Icomments :: ([MToken]) _x1Icopy :: MExpr _x1IisAssociative :: Bool _x1IisLiteral :: Bool _x1IisMultiline :: Bool _x1Ipos :: Region _x1Iprecedence :: OperatorLevel _x1Ipretty :: Doc _x1IwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _x2Icomments :: ([MToken]) _x2Icopy :: Block _x2IhasBreaking :: Bool _x2IisMultiline :: Bool _x2Ipretty :: Doc _x2IstatementCount :: Int _lhsOpretty = ({-# LINE 426 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "elseif" <-> _x1Ipretty <-> zeroWidthText "then" $+$ _x2Ipretty {-# LINE 2024 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Oindent = ({-# LINE 427 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 2029 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2OstatRegion = ({-# LINE 428 "src/GLua/AG/PrettyPrint.ag" #-} emptyRg {-# LINE 2034 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1OparentOperatorPrecedence = ({-# LINE 429 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 2039 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1OparentOperatorAssociative = ({-# LINE 430 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2044 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _x1IisMultiline || _x2IisMultiline {-# LINE 2049 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (_x1Icopy,_x2Icopy) {-# LINE 2054 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2059 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _x2Icomments {-# LINE 2064 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Ocomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2069 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Oindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 2074 "src/GLua/AG/PrettyPrint.hs" #-} ) _x1Oppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2079 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Ocomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _x1Icomments {-# LINE 2084 "src/GLua/AG/PrettyPrint.hs" #-} ) _x2Oppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2089 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _x1Icomments,_x1Icopy,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Ipos,_x1Iprecedence,_x1Ipretty,_x1IwouldBeAmbiguousIfNextStatementIsExprVar) = x1_ _x1Ocomments _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf ( _x2Icomments,_x2Icopy,_x2IhasBreaking,_x2IisMultiline,_x2Ipretty,_x2IstatementCount) = x2_ _x2Ocomments _x2Oindent _x2Oppconf _x2OstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) -- ElseIfList -------------------------------------------------- -- cata sem_ElseIfList :: ElseIfList -> T_ElseIfList sem_ElseIfList list = (Prelude.foldr sem_ElseIfList_Cons sem_ElseIfList_Nil (Prelude.map sem_MElseIf list)) -- semantic domain type T_ElseIfList = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),ElseIfList,Bool,Bool,Region,Doc) data Inh_ElseIfList = Inh_ElseIfList {comments_Inh_ElseIfList :: ([MToken]),indent_Inh_ElseIfList :: Int,ppconf_Inh_ElseIfList :: PrettyPrintConfig} data Syn_ElseIfList = Syn_ElseIfList {comments_Syn_ElseIfList :: ([MToken]),copy_Syn_ElseIfList :: ElseIfList,elsesExist_Syn_ElseIfList :: Bool,isMultiline_Syn_ElseIfList :: Bool,pos_Syn_ElseIfList :: Region,pretty_Syn_ElseIfList :: Doc} wrap_ElseIfList :: T_ElseIfList -> Inh_ElseIfList -> Syn_ElseIfList wrap_ElseIfList sem (Inh_ElseIfList _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_ElseIfList _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty)) sem_ElseIfList_Cons :: T_MElseIf -> T_ElseIfList -> T_ElseIfList sem_ElseIfList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOelsesExist :: Bool _lhsOpos :: Region _lhsOisMultiline :: Bool _lhsOcopy :: ElseIfList _lhsOcomments :: ([MToken]) _hdOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOcomments :: ([MToken]) _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _hdIcomments :: ([MToken]) _hdIcopy :: MElseIf _hdIisMultiline :: Bool _hdIpos :: Region _hdIpretty :: Doc _tlIcomments :: ([MToken]) _tlIcopy :: ElseIfList _tlIelsesExist :: Bool _tlIisMultiline :: Bool _tlIpos :: Region _tlIpretty :: Doc _lhsOpretty = ({-# LINE 436 "src/GLua/AG/PrettyPrint.ag" #-} indent _lhsIppconf _lhsIindent _hdIpretty $+$ _tlIpretty {-# LINE 2148 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOelsesExist = ({-# LINE 437 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2153 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 438 "src/GLua/AG/PrettyPrint.ag" #-} _hdIpos {-# LINE 2158 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline || _tlIisMultiline {-# LINE 2163 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 2168 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2173 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 2178 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2183 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 2188 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2193 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 2198 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 2203 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2208 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcomments,_hdIcopy,_hdIisMultiline,_hdIpos,_hdIpretty) = hd_ _hdOcomments _hdOindent _hdOppconf ( _tlIcomments,_tlIcopy,_tlIelsesExist,_tlIisMultiline,_tlIpos,_tlIpretty) = tl_ _tlOcomments _tlOindent _tlOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) sem_ElseIfList_Nil :: T_ElseIfList sem_ElseIfList_Nil = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOpos :: Region _lhsOelsesExist :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: ElseIfList _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 439 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 2229 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 440 "src/GLua/AG/PrettyPrint.ag" #-} emptyRg {-# LINE 2234 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOelsesExist = ({-# LINE 293 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2239 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2244 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 2249 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2254 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2259 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) -- Expr -------------------------------------------------------- -- cata sem_Expr :: Expr -> T_Expr sem_Expr (ANil) = (sem_Expr_ANil) sem_Expr (AFalse) = (sem_Expr_AFalse) sem_Expr (ATrue) = (sem_Expr_ATrue) sem_Expr (ANumber _num) = (sem_Expr_ANumber _num) sem_Expr (AString _str) = (sem_Expr_AString _str) sem_Expr (AVarArg) = (sem_Expr_AVarArg) sem_Expr (AnonymousFunc _pars _body) = (sem_Expr_AnonymousFunc _pars (sem_Block _body)) sem_Expr (APrefixExpr _pexpr) = (sem_Expr_APrefixExpr (sem_PrefixExp _pexpr)) sem_Expr (ATableConstructor _fields) = (sem_Expr_ATableConstructor (sem_FieldList _fields)) sem_Expr (BinOpExpr _op _left _right) = (sem_Expr_BinOpExpr (sem_BinOp _op) (sem_MExpr _left) (sem_MExpr _right)) sem_Expr (UnOpExpr _op _right) = (sem_Expr_UnOpExpr (sem_UnOp _op) (sem_MExpr _right)) -- semantic domain type T_Expr = ([MToken]) -> Int -> Bool -> OperatorLevel -> PrettyPrintConfig -> Region -> ( ([MToken]),Expr,Bool,Bool,Bool,OperatorLevel,Doc,Bool) data Inh_Expr = Inh_Expr {comments_Inh_Expr :: ([MToken]),indent_Inh_Expr :: Int,parentOperatorAssociative_Inh_Expr :: Bool,parentOperatorPrecedence_Inh_Expr :: OperatorLevel,ppconf_Inh_Expr :: PrettyPrintConfig,statRegion_Inh_Expr :: Region} data Syn_Expr = Syn_Expr {comments_Syn_Expr :: ([MToken]),copy_Syn_Expr :: Expr,isAssociative_Syn_Expr :: Bool,isLiteral_Syn_Expr :: Bool,isMultiline_Syn_Expr :: Bool,precedence_Syn_Expr :: OperatorLevel,pretty_Syn_Expr :: Doc,wouldBeAmbiguousIfNextStatementIsExprVar_Syn_Expr :: Bool} wrap_Expr :: T_Expr -> Inh_Expr -> Syn_Expr wrap_Expr sem (Inh_Expr _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar) = sem _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion in (Syn_Expr _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOprecedence _lhsOpretty _lhsOwouldBeAmbiguousIfNextStatementIsExprVar)) sem_Expr_ANil :: T_Expr sem_Expr_ANil = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 620 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "nil" {-# LINE 2323 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 621 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2328 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2333 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2338 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2343 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2348 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ANil {-# LINE 2353 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2358 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2363 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_AFalse :: T_Expr sem_Expr_AFalse = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 622 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "false" {-# LINE 2385 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 623 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2390 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2395 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2400 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2405 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2410 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AFalse {-# LINE 2415 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2420 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2425 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_ATrue :: T_Expr sem_Expr_ATrue = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 624 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "true" {-# LINE 2447 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 625 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2452 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2457 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2462 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2467 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2472 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ATrue {-# LINE 2477 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2482 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2487 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_ANumber :: String -> T_Expr sem_Expr_ANumber num_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 626 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText num_ {-# LINE 2510 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 627 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2515 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2520 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2525 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2530 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2535 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ANumber num_ {-# LINE 2540 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2545 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2550 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_AString :: MToken -> T_Expr sem_Expr_AString str_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 628 "src/GLua/AG/PrettyPrint.ag" #-} tok str_ {-# LINE 2573 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 629 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2578 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2583 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2588 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2593 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2598 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AString str_ {-# LINE 2603 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2608 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2613 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_AVarArg :: T_Expr sem_Expr_AVarArg = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 630 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "..." {-# LINE 2635 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 631 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2640 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2645 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2650 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2655 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2660 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AVarArg {-# LINE 2665 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2670 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2675 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_AnonymousFunc :: ([MToken]) -> T_Block -> T_Expr sem_Expr_AnonymousFunc pars_ body_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _bodyOindent :: Int _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisLiteral :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _isMultiline = ({-# LINE 632 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIisMultiline || _bodyIstatementCount > 1 || (_bodyIstatementCount == 1 && not _bodyIhasBreaking) {-# LINE 2709 "src/GLua/AG/PrettyPrint.hs" #-} ) _singleLinePretty = ({-# LINE 633 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "function" <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_) <-> _bodyIpretty <-> zeroWidthText "end" {-# LINE 2714 "src/GLua/AG/PrettyPrint.hs" #-} ) _multilinePretty = ({-# LINE 634 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "function" <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 2719 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 635 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 2724 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyParams = ({-# LINE 636 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null pars_ {-# LINE 2729 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 637 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then _lhsIindent + 1 else 0 {-# LINE 2734 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 638 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then _multilinePretty else _singleLinePretty {-# LINE 2739 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2744 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 246 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2749 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _isMultiline {-# LINE 2754 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2759 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2764 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AnonymousFunc pars_ _bodyIcopy {-# LINE 2769 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2774 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 2779 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2784 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2789 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 2794 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_APrefixExpr :: T_PrefixExp -> T_Expr sem_Expr_APrefixExpr pexpr_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOisAssociative :: Bool _lhsOisLiteral :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _pexprOcomments :: ([MToken]) _pexprOindent :: Int _pexprOparentOperatorAssociative :: Bool _pexprOparentOperatorPrecedence :: OperatorLevel _pexprOppconf :: PrettyPrintConfig _pexprIcomments :: ([MToken]) _pexprIcopy :: PrefixExp _pexprIisAssociative :: Bool _pexprIisLiteral :: Bool _pexprIisMultiline :: Bool _pexprIpotentiallyAmbiguousAsStatement :: Bool _pexprIprecedence :: OperatorLevel _pexprIpretty :: Doc _lhsOpretty = ({-# LINE 639 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIpretty {-# LINE 2832 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 640 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2837 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIisAssociative {-# LINE 2842 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 246 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIisLiteral {-# LINE 2847 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIisMultiline {-# LINE 2852 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIprecedence {-# LINE 2857 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} APrefixExpr _pexprIcopy {-# LINE 2862 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2867 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _pexprIcomments {-# LINE 2872 "src/GLua/AG/PrettyPrint.hs" #-} ) _pexprOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2877 "src/GLua/AG/PrettyPrint.hs" #-} ) _pexprOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 2882 "src/GLua/AG/PrettyPrint.hs" #-} ) _pexprOparentOperatorAssociative = ({-# LINE 243 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorAssociative {-# LINE 2887 "src/GLua/AG/PrettyPrint.hs" #-} ) _pexprOparentOperatorPrecedence = ({-# LINE 242 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorPrecedence {-# LINE 2892 "src/GLua/AG/PrettyPrint.hs" #-} ) _pexprOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 2897 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _pexprIcomments,_pexprIcopy,_pexprIisAssociative,_pexprIisLiteral,_pexprIisMultiline,_pexprIpotentiallyAmbiguousAsStatement,_pexprIprecedence,_pexprIpretty) = pexpr_ _pexprOcomments _pexprOindent _pexprOparentOperatorAssociative _pexprOparentOperatorPrecedence _pexprOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_ATableConstructor :: T_FieldList -> T_Expr sem_Expr_ATableConstructor fields_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOisLiteral :: Bool _fieldsOindent :: Int _lhsOisAssociative :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _fieldsOcomments :: ([MToken]) _fieldsOppconf :: PrettyPrintConfig _fieldsIcanFitOnSameLine :: Bool _fieldsIcomments :: ([MToken]) _fieldsIcopy :: FieldList _fieldsIisMultiline :: Bool _fieldsIisNil :: Bool _fieldsIpretty :: Doc _lhsOpretty = ({-# LINE 642 "src/GLua/AG/PrettyPrint.ag" #-} if _fieldsIisMultiline then _prettyMulti else _prettySingle {-# LINE 2931 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 643 "src/GLua/AG/PrettyPrint.ag" #-} not $ null $ _fieldsIcopy {-# LINE 2936 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 644 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 2941 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyMulti = ({-# LINE 645 "src/GLua/AG/PrettyPrint.ag" #-} zchr '{' $+$ indent _lhsIppconf (_lhsIindent + 1) _fieldsIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}') {-# LINE 2946 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettySingle = ({-# LINE 646 "src/GLua/AG/PrettyPrint.ag" #-} braces _lhsIppconf _emptyContents _fieldsIpretty {-# LINE 2951 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyContents = ({-# LINE 647 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null _fieldsIcopy {-# LINE 2956 "src/GLua/AG/PrettyPrint.hs" #-} ) _fieldsOindent = ({-# LINE 648 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + (if _fieldsIisMultiline then 1 else 0) {-# LINE 2961 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2966 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 2971 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 2976 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ATableConstructor _fieldsIcopy {-# LINE 2981 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 2986 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _fieldsIcomments {-# LINE 2991 "src/GLua/AG/PrettyPrint.hs" #-} ) _fieldsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 2996 "src/GLua/AG/PrettyPrint.hs" #-} ) _fieldsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3001 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _fieldsIcanFitOnSameLine,_fieldsIcomments,_fieldsIcopy,_fieldsIisMultiline,_fieldsIisNil,_fieldsIpretty) = fields_ _fieldsOcomments _fieldsOindent _fieldsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_BinOpExpr :: T_BinOp -> T_MExpr -> T_MExpr -> T_Expr sem_Expr_BinOpExpr op_ left_ right_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _leftOparentOperatorPrecedence :: OperatorLevel _rightOparentOperatorPrecedence :: OperatorLevel _leftOparentOperatorAssociative :: Bool _rightOparentOperatorAssociative :: Bool _lhsOisAssociative :: Bool _lhsOisLiteral :: Bool _lhsOisMultiline :: Bool _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _opOcomments :: ([MToken]) _opOindent :: Int _opOppconf :: PrettyPrintConfig _leftOcomments :: ([MToken]) _leftOindent :: Int _leftOppconf :: PrettyPrintConfig _rightOcomments :: ([MToken]) _rightOindent :: Int _rightOppconf :: PrettyPrintConfig _opIcomments :: ([MToken]) _opIcopy :: BinOp _opIisAssociative :: Bool _opIisMultiline :: Bool _opIprecedence :: OperatorLevel _opIpretty :: Doc _leftIcomments :: ([MToken]) _leftIcopy :: MExpr _leftIisAssociative :: Bool _leftIisLiteral :: Bool _leftIisMultiline :: Bool _leftIpos :: Region _leftIprecedence :: OperatorLevel _leftIpretty :: Doc _leftIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _rightIcomments :: ([MToken]) _rightIcopy :: MExpr _rightIisAssociative :: Bool _rightIisLiteral :: Bool _rightIisMultiline :: Bool _rightIpos :: Region _rightIprecedence :: OperatorLevel _rightIpretty :: Doc _rightIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 649 "src/GLua/AG/PrettyPrint.ag" #-} _leftIpretty <-> _opIpretty <-> _rightIpretty {-# LINE 3065 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 652 "src/GLua/AG/PrettyPrint.ag" #-} min _opIprecedence $ min _leftIprecedence _rightIprecedence {-# LINE 3070 "src/GLua/AG/PrettyPrint.hs" #-} ) _leftOparentOperatorPrecedence = ({-# LINE 653 "src/GLua/AG/PrettyPrint.ag" #-} _opIprecedence {-# LINE 3075 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOparentOperatorPrecedence = ({-# LINE 654 "src/GLua/AG/PrettyPrint.ag" #-} _opIprecedence {-# LINE 3080 "src/GLua/AG/PrettyPrint.hs" #-} ) _leftOparentOperatorAssociative = ({-# LINE 655 "src/GLua/AG/PrettyPrint.ag" #-} _opIisAssociative {-# LINE 3085 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOparentOperatorAssociative = ({-# LINE 656 "src/GLua/AG/PrettyPrint.ag" #-} _opIisAssociative {-# LINE 3090 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _opIisAssociative && _leftIisAssociative && _rightIisAssociative {-# LINE 3095 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 246 "src/GLua/AG/PrettyPrint.ag" #-} ((\_ _ -> False) _leftIisLiteral _rightIisLiteral) {-# LINE 3100 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _opIisMultiline || _leftIisMultiline || _rightIisMultiline {-# LINE 3105 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} _leftIwouldBeAmbiguousIfNextStatementIsExprVar || _rightIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 3110 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} BinOpExpr _opIcopy _leftIcopy _rightIcopy {-# LINE 3115 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3120 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _rightIcomments {-# LINE 3125 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3130 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3135 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3140 "src/GLua/AG/PrettyPrint.hs" #-} ) _leftOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _opIcomments {-# LINE 3145 "src/GLua/AG/PrettyPrint.hs" #-} ) _leftOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3150 "src/GLua/AG/PrettyPrint.hs" #-} ) _leftOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3155 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _leftIcomments {-# LINE 3160 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3165 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3170 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _opIcomments,_opIcopy,_opIisAssociative,_opIisMultiline,_opIprecedence,_opIpretty) = op_ _opOcomments _opOindent _opOppconf ( _leftIcomments,_leftIcopy,_leftIisAssociative,_leftIisLiteral,_leftIisMultiline,_leftIpos,_leftIprecedence,_leftIpretty,_leftIwouldBeAmbiguousIfNextStatementIsExprVar) = left_ _leftOcomments _leftOindent _leftOparentOperatorAssociative _leftOparentOperatorPrecedence _leftOppconf ( _rightIcomments,_rightIcopy,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty,_rightIwouldBeAmbiguousIfNextStatementIsExprVar) = right_ _rightOcomments _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_Expr_UnOpExpr :: T_UnOp -> T_MExpr -> T_Expr sem_Expr_UnOpExpr op_ right_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _rightOparentOperatorPrecedence :: OperatorLevel _lhsOisAssociative :: Bool _lhsOisLiteral :: Bool _lhsOisMultiline :: Bool _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: Expr _lhsOcomments :: ([MToken]) _opOcomments :: ([MToken]) _opOindent :: Int _opOppconf :: PrettyPrintConfig _rightOcomments :: ([MToken]) _rightOindent :: Int _rightOparentOperatorAssociative :: Bool _rightOppconf :: PrettyPrintConfig _opIcomments :: ([MToken]) _opIcopy :: UnOp _opIisMultiline :: Bool _opIpretty :: Doc _rightIcomments :: ([MToken]) _rightIcopy :: MExpr _rightIisAssociative :: Bool _rightIisLiteral :: Bool _rightIisMultiline :: Bool _rightIpos :: Region _rightIprecedence :: OperatorLevel _rightIpretty :: Doc _rightIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 657 "src/GLua/AG/PrettyPrint.ag" #-} _opIpretty <> _rightIpretty {-# LINE 3221 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 658 "src/GLua/AG/PrettyPrint.ag" #-} min _rightIprecedence OperatorLevel7 {-# LINE 3226 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOparentOperatorPrecedence = ({-# LINE 659 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel7 {-# LINE 3231 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _rightIisAssociative {-# LINE 3236 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 246 "src/GLua/AG/PrettyPrint.ag" #-} _rightIisLiteral {-# LINE 3241 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _opIisMultiline || _rightIisMultiline {-# LINE 3246 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} _rightIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 3251 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} UnOpExpr _opIcopy _rightIcopy {-# LINE 3256 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3261 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _rightIcomments {-# LINE 3266 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3271 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3276 "src/GLua/AG/PrettyPrint.hs" #-} ) _opOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3281 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _opIcomments {-# LINE 3286 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3291 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOparentOperatorAssociative = ({-# LINE 243 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorAssociative {-# LINE 3296 "src/GLua/AG/PrettyPrint.hs" #-} ) _rightOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3301 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _opIcomments,_opIcopy,_opIisMultiline,_opIpretty) = op_ _opOcomments _opOindent _opOppconf ( _rightIcomments,_rightIcopy,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty,_rightIwouldBeAmbiguousIfNextStatementIsExprVar) = right_ _rightOcomments _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) -- ExprSuffixList ---------------------------------------------- -- cata sem_ExprSuffixList :: ExprSuffixList -> T_ExprSuffixList sem_ExprSuffixList list = (Prelude.foldr sem_ExprSuffixList_Cons sem_ExprSuffixList_Nil (Prelude.map sem_PFExprSuffix list)) -- semantic domain type T_ExprSuffixList = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),ExprSuffixList,Bool,Bool,OperatorLevel,Doc) data Inh_ExprSuffixList = Inh_ExprSuffixList {comments_Inh_ExprSuffixList :: ([MToken]),indent_Inh_ExprSuffixList :: Int,ppconf_Inh_ExprSuffixList :: PrettyPrintConfig} data Syn_ExprSuffixList = Syn_ExprSuffixList {comments_Syn_ExprSuffixList :: ([MToken]),copy_Syn_ExprSuffixList :: ExprSuffixList,isAssociative_Syn_ExprSuffixList :: Bool,isMultiline_Syn_ExprSuffixList :: Bool,precedence_Syn_ExprSuffixList :: OperatorLevel,pretty_Syn_ExprSuffixList :: Doc} wrap_ExprSuffixList :: T_ExprSuffixList -> Inh_ExprSuffixList -> Syn_ExprSuffixList wrap_ExprSuffixList sem (Inh_ExprSuffixList _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_ExprSuffixList _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty)) sem_ExprSuffixList_Cons :: T_PFExprSuffix -> T_ExprSuffixList -> T_ExprSuffixList sem_ExprSuffixList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: ExprSuffixList _lhsOcomments :: ([MToken]) _hdOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOcomments :: ([MToken]) _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _hdIcomments :: ([MToken]) _hdIcopy :: PFExprSuffix _hdIisAssociative :: Bool _hdIisMultiline :: Bool _hdIprecedence :: OperatorLevel _hdIpretty :: Doc _tlIcomments :: ([MToken]) _tlIcopy :: ExprSuffixList _tlIisAssociative :: Bool _tlIisMultiline :: Bool _tlIprecedence :: OperatorLevel _tlIpretty :: Doc _lhsOpretty = ({-# LINE 456 "src/GLua/AG/PrettyPrint.ag" #-} _hdIpretty <> _tlIpretty {-# LINE 3361 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisAssociative && _tlIisAssociative {-# LINE 3366 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline || _tlIisMultiline {-# LINE 3371 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} (min _hdIprecedence _tlIprecedence) {-# LINE 3376 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 3381 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3386 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 3391 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3396 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3401 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3406 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 3411 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3416 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3421 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcomments,_hdIcopy,_hdIisAssociative,_hdIisMultiline,_hdIprecedence,_hdIpretty) = hd_ _hdOcomments _hdOindent _hdOppconf ( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisMultiline,_tlIprecedence,_tlIpretty) = tl_ _tlOcomments _tlOindent _tlOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_ExprSuffixList_Nil :: T_ExprSuffixList sem_ExprSuffixList_Nil = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: ExprSuffixList _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 457 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 3442 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 3447 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 3452 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 3457 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 3462 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3467 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3472 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) -- Field ------------------------------------------------------- -- cata sem_Field :: Field -> T_Field sem_Field (ExprField _key _value _sep) = (sem_Field_ExprField (sem_MExpr _key) (sem_MExpr _value) (sem_FieldSep _sep)) sem_Field (NamedField _key _value _sep) = (sem_Field_NamedField _key (sem_MExpr _value) (sem_FieldSep _sep)) sem_Field (UnnamedField _value _sep) = (sem_Field_UnnamedField (sem_MExpr _value) (sem_FieldSep _sep)) -- semantic domain type T_Field = ([MToken]) -> Int -> PrettyPrintConfig -> ( Bool,([MToken]),Field,Bool,Bool,Region,Doc) data Inh_Field = Inh_Field {comments_Inh_Field :: ([MToken]),indent_Inh_Field :: Int,ppconf_Inh_Field :: PrettyPrintConfig} data Syn_Field = Syn_Field {canFitOnSameLine_Syn_Field :: Bool,comments_Syn_Field :: ([MToken]),copy_Syn_Field :: Field,isMultiline_Syn_Field :: Bool,isSemiColon_Syn_Field :: Bool,pos_Syn_Field :: Region,pretty_Syn_Field :: Doc} wrap_Field :: T_Field -> Inh_Field -> Syn_Field wrap_Field sem (Inh_Field _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_Field _lhsOcanFitOnSameLine _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOisSemiColon _lhsOpos _lhsOpretty)) sem_Field_ExprField :: T_MExpr -> T_MExpr -> T_FieldSep -> T_Field sem_Field_ExprField key_ value_ sep_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcanFitOnSameLine :: Bool _keyOparentOperatorPrecedence :: OperatorLevel _keyOparentOperatorAssociative :: Bool _valueOparentOperatorPrecedence :: OperatorLevel _valueOparentOperatorAssociative :: Bool _lhsOisSemiColon :: Bool _lhsOcopy :: Field _lhsOcomments :: ([MToken]) _lhsOpos :: Region _keyOcomments :: ([MToken]) _keyOindent :: Int _keyOppconf :: PrettyPrintConfig _valueOcomments :: ([MToken]) _valueOindent :: Int _valueOppconf :: PrettyPrintConfig _sepOindent :: Int _sepOppconf :: PrettyPrintConfig _keyIcomments :: ([MToken]) _keyIcopy :: MExpr _keyIisAssociative :: Bool _keyIisLiteral :: Bool _keyIisMultiline :: Bool _keyIpos :: Region _keyIprecedence :: OperatorLevel _keyIpretty :: Doc _keyIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _valueIcomments :: ([MToken]) _valueIcopy :: MExpr _valueIisAssociative :: Bool _valueIisLiteral :: Bool _valueIisMultiline :: Bool _valueIpos :: Region _valueIprecedence :: OperatorLevel _valueIpretty :: Doc _valueIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _sepIcanFitOnSameLine :: Bool _sepIcopy :: FieldSep _sepIisMultiline :: Bool _sepIisSemiColon :: Bool _sepIpretty :: Doc _lhsOpretty = ({-# LINE 673 "src/GLua/AG/PrettyPrint.ag" #-} brackets _lhsIppconf _keyIpretty <-> zchr '=' <-> _valueIpretty <> _sepIpretty {-# LINE 3551 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 674 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3556 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 675 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 3561 "src/GLua/AG/PrettyPrint.hs" #-} ) _keyOparentOperatorPrecedence = ({-# LINE 676 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 3566 "src/GLua/AG/PrettyPrint.hs" #-} ) _keyOparentOperatorAssociative = ({-# LINE 677 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3571 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorPrecedence = ({-# LINE 678 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 3576 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorAssociative = ({-# LINE 679 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3581 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 280 "src/GLua/AG/PrettyPrint.ag" #-} _sepIisSemiColon {-# LINE 3586 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ExprField _keyIcopy _valueIcopy _sepIcopy {-# LINE 3591 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3596 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _valueIcomments {-# LINE 3601 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-} _valueIpos {-# LINE 3606 "src/GLua/AG/PrettyPrint.hs" #-} ) _keyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3611 "src/GLua/AG/PrettyPrint.hs" #-} ) _keyOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3616 "src/GLua/AG/PrettyPrint.hs" #-} ) _keyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3621 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _keyIcomments {-# LINE 3626 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3631 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3636 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3641 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3646 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _keyIcomments,_keyIcopy,_keyIisAssociative,_keyIisLiteral,_keyIisMultiline,_keyIpos,_keyIprecedence,_keyIpretty,_keyIwouldBeAmbiguousIfNextStatementIsExprVar) = key_ _keyOcomments _keyOindent _keyOparentOperatorAssociative _keyOparentOperatorPrecedence _keyOppconf ( _valueIcomments,_valueIcopy,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty,_valueIwouldBeAmbiguousIfNextStatementIsExprVar) = value_ _valueOcomments _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf ( _sepIcanFitOnSameLine,_sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) = sep_ _sepOindent _sepOppconf in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty))) sem_Field_NamedField :: MToken -> T_MExpr -> T_FieldSep -> T_Field sem_Field_NamedField key_ value_ sep_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcanFitOnSameLine :: Bool _valueOparentOperatorPrecedence :: OperatorLevel _valueOparentOperatorAssociative :: Bool _lhsOisSemiColon :: Bool _lhsOcopy :: Field _lhsOcomments :: ([MToken]) _lhsOpos :: Region _valueOcomments :: ([MToken]) _valueOindent :: Int _valueOppconf :: PrettyPrintConfig _sepOindent :: Int _sepOppconf :: PrettyPrintConfig _valueIcomments :: ([MToken]) _valueIcopy :: MExpr _valueIisAssociative :: Bool _valueIisLiteral :: Bool _valueIisMultiline :: Bool _valueIpos :: Region _valueIprecedence :: OperatorLevel _valueIpretty :: Doc _valueIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _sepIcanFitOnSameLine :: Bool _sepIcopy :: FieldSep _sepIisMultiline :: Bool _sepIisSemiColon :: Bool _sepIpretty :: Doc _lhsOpretty = ({-# LINE 680 "src/GLua/AG/PrettyPrint.ag" #-} tok key_ <-> zchr '=' <-> _valueIpretty <> _sepIpretty {-# LINE 3694 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 681 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3699 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 682 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 3704 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorPrecedence = ({-# LINE 683 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 3709 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorAssociative = ({-# LINE 684 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3714 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 280 "src/GLua/AG/PrettyPrint.ag" #-} _sepIisSemiColon {-# LINE 3719 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} NamedField key_ _valueIcopy _sepIcopy {-# LINE 3724 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3729 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _valueIcomments {-# LINE 3734 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-} _valueIpos {-# LINE 3739 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3744 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3749 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3754 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3759 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3764 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _valueIcomments,_valueIcopy,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty,_valueIwouldBeAmbiguousIfNextStatementIsExprVar) = value_ _valueOcomments _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf ( _sepIcanFitOnSameLine,_sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) = sep_ _sepOindent _sepOppconf in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty))) sem_Field_UnnamedField :: T_MExpr -> T_FieldSep -> T_Field sem_Field_UnnamedField value_ sep_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOcanFitOnSameLine :: Bool _valueOparentOperatorPrecedence :: OperatorLevel _valueOparentOperatorAssociative :: Bool _lhsOisMultiline :: Bool _lhsOisSemiColon :: Bool _lhsOcopy :: Field _lhsOcomments :: ([MToken]) _lhsOpos :: Region _valueOcomments :: ([MToken]) _valueOindent :: Int _valueOppconf :: PrettyPrintConfig _sepOindent :: Int _sepOppconf :: PrettyPrintConfig _valueIcomments :: ([MToken]) _valueIcopy :: MExpr _valueIisAssociative :: Bool _valueIisLiteral :: Bool _valueIisMultiline :: Bool _valueIpos :: Region _valueIprecedence :: OperatorLevel _valueIpretty :: Doc _valueIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _sepIcanFitOnSameLine :: Bool _sepIcopy :: FieldSep _sepIisMultiline :: Bool _sepIisSemiColon :: Bool _sepIpretty :: Doc _lhsOpretty = ({-# LINE 685 "src/GLua/AG/PrettyPrint.ag" #-} _valueIpretty <> _sepIpretty {-# LINE 3809 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 686 "src/GLua/AG/PrettyPrint.ag" #-} _sepIcanFitOnSameLine && not _valueIisMultiline {-# LINE 3814 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorPrecedence = ({-# LINE 687 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 3819 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOparentOperatorAssociative = ({-# LINE 688 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 3824 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _valueIisMultiline || _sepIisMultiline {-# LINE 3829 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 280 "src/GLua/AG/PrettyPrint.ag" #-} _sepIisSemiColon {-# LINE 3834 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} UnnamedField _valueIcopy _sepIcopy {-# LINE 3839 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 3844 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _valueIcomments {-# LINE 3849 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-} _valueIpos {-# LINE 3854 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 3859 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3864 "src/GLua/AG/PrettyPrint.hs" #-} ) _valueOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3869 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 3874 "src/GLua/AG/PrettyPrint.hs" #-} ) _sepOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 3879 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _valueIcomments,_valueIcopy,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty,_valueIwouldBeAmbiguousIfNextStatementIsExprVar) = value_ _valueOcomments _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf ( _sepIcanFitOnSameLine,_sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) = sep_ _sepOindent _sepOppconf in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty))) -- FieldList --------------------------------------------------- -- cata sem_FieldList :: FieldList -> T_FieldList sem_FieldList list = (Prelude.foldr sem_FieldList_Cons sem_FieldList_Nil (Prelude.map sem_Field list)) -- semantic domain type T_FieldList = ([MToken]) -> Int -> PrettyPrintConfig -> ( Bool,([MToken]),FieldList,Bool,Bool,Doc) data Inh_FieldList = Inh_FieldList {comments_Inh_FieldList :: ([MToken]),indent_Inh_FieldList :: Int,ppconf_Inh_FieldList :: PrettyPrintConfig} data Syn_FieldList = Syn_FieldList {canFitOnSameLine_Syn_FieldList :: Bool,comments_Syn_FieldList :: ([MToken]),copy_Syn_FieldList :: FieldList,isMultiline_Syn_FieldList :: Bool,isNil_Syn_FieldList :: Bool,pretty_Syn_FieldList :: Doc} wrap_FieldList :: T_FieldList -> Inh_FieldList -> Syn_FieldList wrap_FieldList sem (Inh_FieldList _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_FieldList _lhsOcanFitOnSameLine _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOisNil _lhsOpretty)) sem_FieldList_Cons :: T_Field -> T_FieldList -> T_FieldList sem_FieldList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOcanFitOnSameLine :: Bool _lhsOisNil :: Bool _hdOcomments :: ([MToken]) _lhsOisMultiline :: Bool _lhsOcopy :: FieldList _lhsOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOcomments :: ([MToken]) _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _hdIcanFitOnSameLine :: Bool _hdIcomments :: ([MToken]) _hdIcopy :: Field _hdIisMultiline :: Bool _hdIisSemiColon :: Bool _hdIpos :: Region _hdIpretty :: Doc _tlIcanFitOnSameLine :: Bool _tlIcomments :: ([MToken]) _tlIcopy :: FieldList _tlIisMultiline :: Bool _tlIisNil :: Bool _tlIpretty :: Doc _lhsOpretty = ({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-} _prettyCommentsBefore $+$ _indentAfterComment (_hdIpretty <-> _prettyCommentsAfter ) `_sep ` _ind _tlIpretty {-# LINE 3940 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 364 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcanFitOnSameLine {-# LINE 3945 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisNil = ({-# LINE 365 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 3950 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 367 "src/GLua/AG/PrettyPrint.ag" #-} snd _commentsAfter {-# LINE 3955 "src/GLua/AG/PrettyPrint.hs" #-} ) _sep = ({-# LINE 369 "src/GLua/AG/PrettyPrint.ag" #-} if _onSameLine then _optionalSpaceAfterSep else ($+$) {-# LINE 3960 "src/GLua/AG/PrettyPrint.hs" #-} ) _ind = ({-# LINE 370 "src/GLua/AG/PrettyPrint.ag" #-} if _onSameLine then id else indent _lhsIppconf _lhsIindent {-# LINE 3965 "src/GLua/AG/PrettyPrint.hs" #-} ) _onSameLine = ({-# LINE 371 "src/GLua/AG/PrettyPrint.ag" #-} (_hdIcanFitOnSameLine || _tlIisNil) && null (fst _commentsAfter ) {-# LINE 3970 "src/GLua/AG/PrettyPrint.hs" #-} ) _optionalSpaceAfterSep = ({-# LINE 373 "src/GLua/AG/PrettyPrint.ag" #-} if spaceAfterComma _lhsIppconf then (<->) else (<>) {-# LINE 3975 "src/GLua/AG/PrettyPrint.hs" #-} ) _indentAfterComment = ({-# LINE 374 "src/GLua/AG/PrettyPrint.ag" #-} if null $ fst _commentsBefore then id else indent _lhsIppconf _lhsIindent {-# LINE 3980 "src/GLua/AG/PrettyPrint.hs" #-} ) _isMultiline = ({-# LINE 376 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline || _tlIisMultiline {-# LINE 3985 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsBefore = ({-# LINE 378 "src/GLua/AG/PrettyPrint.ag" #-} renderSLComments _lhsIppconf _lhsIindent (fst _commentsBefore ) {-# LINE 3990 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsAfter = ({-# LINE 379 "src/GLua/AG/PrettyPrint.ag" #-} renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter ) {-# LINE 3995 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsBefore = ({-# LINE 380 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then span (\(MToken pos _) -> pos `before` _hdIpos) _lhsIcomments else ([], _lhsIcomments) {-# LINE 4003 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsAfter = ({-# LINE 386 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then span (\(MToken pos _) -> pos `beforeOrOnLine` _hdIpos) (snd _commentsBefore ) else _commentsBefore {-# LINE 4011 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _isMultiline {-# LINE 4016 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 4021 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4026 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 4031 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4036 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4041 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 4046 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4051 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4056 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcanFitOnSameLine,_hdIcomments,_hdIcopy,_hdIisMultiline,_hdIisSemiColon,_hdIpos,_hdIpretty) = hd_ _hdOcomments _hdOindent _hdOppconf ( _tlIcanFitOnSameLine,_tlIcomments,_tlIcopy,_tlIisMultiline,_tlIisNil,_tlIpretty) = tl_ _tlOcomments _tlOindent _tlOppconf in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty))) sem_FieldList_Nil :: T_FieldList sem_FieldList_Nil = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisNil :: Bool _lhsOcanFitOnSameLine :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: FieldList _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 391 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 4077 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisNil = ({-# LINE 392 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4082 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 393 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4087 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4092 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 4097 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4102 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4107 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty))) -- FieldSep ---------------------------------------------------- -- cata sem_FieldSep :: FieldSep -> T_FieldSep sem_FieldSep (CommaSep) = (sem_FieldSep_CommaSep) sem_FieldSep (SemicolonSep) = (sem_FieldSep_SemicolonSep) sem_FieldSep (NoSep) = (sem_FieldSep_NoSep) -- semantic domain type T_FieldSep = Int -> PrettyPrintConfig -> ( Bool,FieldSep,Bool,Bool,Doc) data Inh_FieldSep = Inh_FieldSep {indent_Inh_FieldSep :: Int,ppconf_Inh_FieldSep :: PrettyPrintConfig} data Syn_FieldSep = Syn_FieldSep {canFitOnSameLine_Syn_FieldSep :: Bool,copy_Syn_FieldSep :: FieldSep,isMultiline_Syn_FieldSep :: Bool,isSemiColon_Syn_FieldSep :: Bool,pretty_Syn_FieldSep :: Doc} wrap_FieldSep :: T_FieldSep -> Inh_FieldSep -> Syn_FieldSep wrap_FieldSep sem (Inh_FieldSep _lhsIindent _lhsIppconf) = (let ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty) = sem _lhsIindent _lhsIppconf in (Syn_FieldSep _lhsOcanFitOnSameLine _lhsOcopy _lhsOisMultiline _lhsOisSemiColon _lhsOpretty)) sem_FieldSep_CommaSep :: T_FieldSep sem_FieldSep_CommaSep = (\ _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOcanFitOnSameLine :: Bool _lhsOisMultiline :: Bool _lhsOisSemiColon :: Bool _lhsOcopy :: FieldSep _lhsOpretty = ({-# LINE 691 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' {-# LINE 4144 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 692 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4149 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4154 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 280 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4159 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} CommaSep {-# LINE 4164 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4169 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty))) sem_FieldSep_SemicolonSep :: T_FieldSep sem_FieldSep_SemicolonSep = (\ _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisSemiColon :: Bool _lhsOcanFitOnSameLine :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: FieldSep _lhsOpretty = ({-# LINE 693 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ';' {-# LINE 4184 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 694 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4189 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 697 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4194 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 698 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4199 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} SemicolonSep {-# LINE 4204 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4209 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty))) sem_FieldSep_NoSep :: T_FieldSep sem_FieldSep_NoSep = (\ _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOcanFitOnSameLine :: Bool _lhsOisMultiline :: Bool _lhsOisSemiColon :: Bool _lhsOcopy :: FieldSep _lhsOpretty = ({-# LINE 699 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 4224 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcanFitOnSameLine = ({-# LINE 700 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4229 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4234 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisSemiColon = ({-# LINE 280 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4239 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} NoSep {-# LINE 4244 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4249 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty))) -- FuncName ---------------------------------------------------- -- cata sem_FuncName :: FuncName -> T_FuncName sem_FuncName (FuncName _names _meta) = (sem_FuncName_FuncName _names _meta) -- semantic domain type T_FuncName = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),FuncName,Bool,Doc) data Inh_FuncName = Inh_FuncName {comments_Inh_FuncName :: ([MToken]),indent_Inh_FuncName :: Int,ppconf_Inh_FuncName :: PrettyPrintConfig} data Syn_FuncName = Syn_FuncName {comments_Syn_FuncName :: ([MToken]),copy_Syn_FuncName :: FuncName,isMultiline_Syn_FuncName :: Bool,pretty_Syn_FuncName :: Doc} wrap_FuncName :: T_FuncName -> Inh_FuncName -> Syn_FuncName wrap_FuncName sem (Inh_FuncName _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_FuncName _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty)) sem_FuncName_FuncName :: ([MToken]) -> (Maybe MToken) -> T_FuncName sem_FuncName_FuncName names_ meta_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcopy :: FuncName _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 567 "src/GLua/AG/PrettyPrint.ag" #-} printList tok "." names_ <> metaDoc meta_ {-# LINE 4285 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4290 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} FuncName names_ meta_ {-# LINE 4295 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4300 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4305 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) -- MElse ------------------------------------------------------- -- cata sem_MElse :: MElse -> T_MElse sem_MElse (MElse _pos _body) = (sem_MElse_MElse _pos (sem_Block _body)) -- semantic domain type T_MElse = ([MToken]) -> Int -> PrettyPrintConfig -> Region -> ( ([MToken]),MElse,Bool,Bool,Region,Doc) data Inh_MElse = Inh_MElse {comments_Inh_MElse :: ([MToken]),indent_Inh_MElse :: Int,ppconf_Inh_MElse :: PrettyPrintConfig,statRegion_Inh_MElse :: Region} data Syn_MElse = Syn_MElse {comments_Syn_MElse :: ([MToken]),copy_Syn_MElse :: MElse,elsesExist_Syn_MElse :: Bool,isMultiline_Syn_MElse :: Bool,pos_Syn_MElse :: Region,pretty_Syn_MElse :: Doc} wrap_MElse :: T_MElse -> Inh_MElse -> Syn_MElse wrap_MElse sem (Inh_MElse _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion in (Syn_MElse _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty)) sem_MElse_MElse :: Region -> T_Block -> T_MElse sem_MElse_MElse pos_ body_ = (\ _lhsIcomments _lhsIindent _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _bodyOindent :: Int _lhsOpos :: Region _bodyOcomments :: ([MToken]) _lhsOelsesExist :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: MElse _lhsOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOpretty = ({-# LINE 448 "src/GLua/AG/PrettyPrint.ag" #-} indent _lhsIppconf _lhsIindent (zeroWidthText "else") <-> _prettyCommentsAfter $+$ _bodyIpretty {-# LINE 4355 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 449 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 4360 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsAfter = ({-# LINE 450 "src/GLua/AG/PrettyPrint.ag" #-} renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter ) {-# LINE 4365 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsAfter = ({-# LINE 451 "src/GLua/AG/PrettyPrint.ag" #-} span (\(MToken pos _) -> pos `beforeOrOnLine` pos_) _lhsIcomments {-# LINE 4370 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 452 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4375 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 453 "src/GLua/AG/PrettyPrint.ag" #-} snd _commentsAfter {-# LINE 4380 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOelsesExist = ({-# LINE 293 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4385 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIisMultiline {-# LINE 4390 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} MElse pos_ _bodyIcopy {-# LINE 4395 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4400 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 4405 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4410 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 4415 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) -- MElseIf ----------------------------------------------------- -- cata sem_MElseIf :: MElseIf -> T_MElseIf sem_MElseIf (MElseIf _pos _elif) = (sem_MElseIf_MElseIf _pos (sem_ElseIf _elif)) -- semantic domain type T_MElseIf = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),MElseIf,Bool,Region,Doc) data Inh_MElseIf = Inh_MElseIf {comments_Inh_MElseIf :: ([MToken]),indent_Inh_MElseIf :: Int,ppconf_Inh_MElseIf :: PrettyPrintConfig} data Syn_MElseIf = Syn_MElseIf {comments_Syn_MElseIf :: ([MToken]),copy_Syn_MElseIf :: MElseIf,isMultiline_Syn_MElseIf :: Bool,pos_Syn_MElseIf :: Region,pretty_Syn_MElseIf :: Doc} wrap_MElseIf :: T_MElseIf -> Inh_MElseIf -> Syn_MElseIf wrap_MElseIf sem (Inh_MElseIf _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_MElseIf _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpos _lhsOpretty)) sem_MElseIf_MElseIf :: Region -> T_ElseIf -> T_MElseIf sem_MElseIf_MElseIf pos_ elif_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpos :: Region _lhsOisMultiline :: Bool _lhsOcopy :: MElseIf _lhsOcomments :: ([MToken]) _lhsOpretty :: Doc _elifOcomments :: ([MToken]) _elifOindent :: Int _elifOppconf :: PrettyPrintConfig _elifIcomments :: ([MToken]) _elifIcopy :: ElseIf _elifIisMultiline :: Bool _elifIpretty :: Doc _lhsOpos = ({-# LINE 433 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4461 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _elifIisMultiline {-# LINE 4466 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} MElseIf pos_ _elifIcopy {-# LINE 4471 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4476 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _elifIcomments {-# LINE 4481 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 232 "src/GLua/AG/PrettyPrint.ag" #-} _elifIpretty {-# LINE 4486 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4491 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4496 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4501 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _elifIcomments,_elifIcopy,_elifIisMultiline,_elifIpretty) = elif_ _elifOcomments _elifOindent _elifOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty))) -- MExpr ------------------------------------------------------- -- cata sem_MExpr :: MExpr -> T_MExpr sem_MExpr (MExpr _pos _expr) = (sem_MExpr_MExpr _pos (sem_Expr _expr)) -- semantic domain type T_MExpr = ([MToken]) -> Int -> Bool -> OperatorLevel -> PrettyPrintConfig -> ( ([MToken]),MExpr,Bool,Bool,Bool,Region,OperatorLevel,Doc,Bool) data Inh_MExpr = Inh_MExpr {comments_Inh_MExpr :: ([MToken]),indent_Inh_MExpr :: Int,parentOperatorAssociative_Inh_MExpr :: Bool,parentOperatorPrecedence_Inh_MExpr :: OperatorLevel,ppconf_Inh_MExpr :: PrettyPrintConfig} data Syn_MExpr = Syn_MExpr {comments_Syn_MExpr :: ([MToken]),copy_Syn_MExpr :: MExpr,isAssociative_Syn_MExpr :: Bool,isLiteral_Syn_MExpr :: Bool,isMultiline_Syn_MExpr :: Bool,pos_Syn_MExpr :: Region,precedence_Syn_MExpr :: OperatorLevel,pretty_Syn_MExpr :: Doc,wouldBeAmbiguousIfNextStatementIsExprVar_Syn_MExpr :: Bool} wrap_MExpr :: T_MExpr -> Inh_MExpr -> Syn_MExpr wrap_MExpr sem (Inh_MExpr _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar) = sem _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf in (Syn_MExpr _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOpos _lhsOprecedence _lhsOpretty _lhsOwouldBeAmbiguousIfNextStatementIsExprVar)) sem_MExpr_MExpr :: Region -> T_Expr -> T_MExpr sem_MExpr_MExpr pos_ expr_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf -> (let _lhsOpos :: Region _exprOstatRegion :: Region _lhsOisAssociative :: Bool _lhsOisLiteral :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: MExpr _lhsOcomments :: ([MToken]) _lhsOpretty :: Doc _exprOcomments :: ([MToken]) _exprOindent :: Int _exprOparentOperatorAssociative :: Bool _exprOparentOperatorPrecedence :: OperatorLevel _exprOppconf :: PrettyPrintConfig _exprIcomments :: ([MToken]) _exprIcopy :: Expr _exprIisAssociative :: Bool _exprIisLiteral :: Bool _exprIisMultiline :: Bool _exprIprecedence :: OperatorLevel _exprIpretty :: Doc _exprIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpos = ({-# LINE 616 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4562 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOstatRegion = ({-# LINE 617 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4567 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _exprIisAssociative {-# LINE 4572 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 246 "src/GLua/AG/PrettyPrint.ag" #-} _exprIisLiteral {-# LINE 4577 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _exprIisMultiline {-# LINE 4582 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} _exprIprecedence {-# LINE 4587 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} _exprIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 4592 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} MExpr pos_ _exprIcopy {-# LINE 4597 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4602 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _exprIcomments {-# LINE 4607 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 232 "src/GLua/AG/PrettyPrint.ag" #-} _exprIpretty {-# LINE 4612 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4617 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4622 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOparentOperatorAssociative = ({-# LINE 243 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorAssociative {-# LINE 4627 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOparentOperatorPrecedence = ({-# LINE 242 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorPrecedence {-# LINE 4632 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4637 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _exprIcomments,_exprIcopy,_exprIisAssociative,_exprIisLiteral,_exprIisMultiline,_exprIprecedence,_exprIpretty,_exprIwouldBeAmbiguousIfNextStatementIsExprVar) = expr_ _exprOcomments _exprOindent _exprOparentOperatorAssociative _exprOparentOperatorPrecedence _exprOppconf _exprOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) -- MExprList --------------------------------------------------- -- cata sem_MExprList :: MExprList -> T_MExprList sem_MExprList list = (Prelude.foldr sem_MExprList_Cons sem_MExprList_Nil (Prelude.map sem_MExpr list)) -- semantic domain type T_MExprList = ([MToken]) -> Int -> Bool -> PrettyPrintConfig -> ( ([MToken]),MExprList,Bool,Bool,Region,OperatorLevel,Doc) data Inh_MExprList = Inh_MExprList {comments_Inh_MExprList :: ([MToken]),indent_Inh_MExprList :: Int,isHead_Inh_MExprList :: Bool,ppconf_Inh_MExprList :: PrettyPrintConfig} data Syn_MExprList = Syn_MExprList {comments_Syn_MExprList :: ([MToken]),copy_Syn_MExprList :: MExprList,isAssociative_Syn_MExprList :: Bool,isMultiline_Syn_MExprList :: Bool,pos_Syn_MExprList :: Region,precedence_Syn_MExprList :: OperatorLevel,pretty_Syn_MExprList :: Doc} wrap_MExprList :: T_MExprList -> Inh_MExprList -> Syn_MExprList wrap_MExprList sem (Inh_MExprList _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf in (Syn_MExprList _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOpos _lhsOprecedence _lhsOpretty)) sem_MExprList_Cons :: T_MExpr -> T_MExprList -> T_MExprList sem_MExprList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf -> (let _lhsOpretty :: Doc _tlOisHead :: Bool _lhsOpos :: Region _hdOparentOperatorPrecedence :: OperatorLevel _hdOparentOperatorAssociative :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: MExprList _lhsOcomments :: ([MToken]) _hdOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOcomments :: ([MToken]) _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _hdIcomments :: ([MToken]) _hdIcopy :: MExpr _hdIisAssociative :: Bool _hdIisLiteral :: Bool _hdIisMultiline :: Bool _hdIpos :: Region _hdIprecedence :: OperatorLevel _hdIpretty :: Doc _hdIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _tlIcomments :: ([MToken]) _tlIcopy :: MExprList _tlIisAssociative :: Bool _tlIisMultiline :: Bool _tlIpos :: Region _tlIprecedence :: OperatorLevel _tlIpretty :: Doc _lhsOpretty = ({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-} (if _lhsIisHead then empty else _comma ) <> _hdIpretty <> _tlIpretty {-# LINE 4705 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 354 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 4710 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOisHead = ({-# LINE 355 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4715 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 356 "src/GLua/AG/PrettyPrint.ag" #-} _hdIpos {-# LINE 4720 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOparentOperatorPrecedence = ({-# LINE 357 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 4725 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOparentOperatorAssociative = ({-# LINE 358 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 4730 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisAssociative && _tlIisAssociative {-# LINE 4735 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline || _tlIisMultiline {-# LINE 4740 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} (min _hdIprecedence _tlIprecedence) {-# LINE 4745 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 4750 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4755 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 4760 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4765 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4770 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4775 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 4780 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4785 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4790 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcomments,_hdIcopy,_hdIisAssociative,_hdIisLiteral,_hdIisMultiline,_hdIpos,_hdIprecedence,_hdIpretty,_hdIwouldBeAmbiguousIfNextStatementIsExprVar) = hd_ _hdOcomments _hdOindent _hdOparentOperatorAssociative _hdOparentOperatorPrecedence _hdOppconf ( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisMultiline,_tlIpos,_tlIprecedence,_tlIpretty) = tl_ _tlOcomments _tlOindent _tlOisHead _tlOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty))) sem_MExprList_Nil :: T_MExprList sem_MExprList_Nil = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOpos :: Region _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: MExprList _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 359 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 4813 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpos = ({-# LINE 360 "src/GLua/AG/PrettyPrint.ag" #-} emptyRg {-# LINE 4818 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4823 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 4828 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 4833 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 4838 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4843 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4848 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty))) -- MStat ------------------------------------------------------- -- cata sem_MStat :: MStat -> T_MStat sem_MStat (MStat _pos _stat) = (sem_MStat_MStat _pos (sem_Stat _stat)) -- semantic domain type T_MStat = ([MToken]) -> Int -> Bool -> Bool -> PrettyPrintConfig -> ( ([MToken]),MStat,Bool,Bool,Region,Bool,Doc,Int) data Inh_MStat = Inh_MStat {comments_Inh_MStat :: ([MToken]),indent_Inh_MStat :: Int,isLastStatement_Inh_MStat :: Bool,potentiallyAmbiguousAsStatement_Inh_MStat :: Bool,ppconf_Inh_MStat :: PrettyPrintConfig} data Syn_MStat = Syn_MStat {comments_Syn_MStat :: ([MToken]),copy_Syn_MStat :: MStat,hasBreaking_Syn_MStat :: Bool,isMultiline_Syn_MStat :: Bool,pos_Syn_MStat :: Region,potentiallyAmbiguousAsStatement_Syn_MStat :: Bool,pretty_Syn_MStat :: Doc,statementCount_Syn_MStat :: Int} wrap_MStat :: T_MStat -> Inh_MStat -> Syn_MStat wrap_MStat sem (Inh_MStat _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpos,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf in (Syn_MStat _lhsOcomments _lhsOcopy _lhsOhasBreaking _lhsOisMultiline _lhsOpos _lhsOpotentiallyAmbiguousAsStatement _lhsOpretty _lhsOstatementCount)) sem_MStat_MStat :: Region -> T_Stat -> T_MStat sem_MStat_MStat pos_ stat_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf -> (let _lhsOpos :: Region _statOstatRegion :: Region _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOstatementCount :: Int _lhsOcopy :: MStat _lhsOcomments :: ([MToken]) _lhsOpretty :: Doc _statOcomments :: ([MToken]) _statOindent :: Int _statOisLastStatement :: Bool _statOpotentiallyAmbiguousAsStatement :: Bool _statOppconf :: PrettyPrintConfig _statIcomments :: ([MToken]) _statIcopy :: Stat _statIhasBreaking :: Bool _statIisMultiline :: Bool _statIpotentiallyAmbiguousAsStatement :: Bool _statIpretty :: Doc _lhsOpos = ({-# LINE 349 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4904 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOstatRegion = ({-# LINE 350 "src/GLua/AG/PrettyPrint.ag" #-} pos_ {-# LINE 4909 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} _statIhasBreaking {-# LINE 4914 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _statIisMultiline {-# LINE 4919 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} _statIpotentiallyAmbiguousAsStatement {-# LINE 4924 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-} 1 {-# LINE 4929 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} MStat pos_ _statIcopy {-# LINE 4934 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 4939 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _statIcomments {-# LINE 4944 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 232 "src/GLua/AG/PrettyPrint.ag" #-} _statIpretty {-# LINE 4949 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 4954 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 4959 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOisLastStatement = ({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIisLastStatement {-# LINE 4964 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOpotentiallyAmbiguousAsStatement = ({-# LINE 304 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIpotentiallyAmbiguousAsStatement {-# LINE 4969 "src/GLua/AG/PrettyPrint.hs" #-} ) _statOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 4974 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _statIcomments,_statIcopy,_statIhasBreaking,_statIisMultiline,_statIpotentiallyAmbiguousAsStatement,_statIpretty) = stat_ _statOcomments _statOindent _statOisLastStatement _statOpotentiallyAmbiguousAsStatement _statOppconf _statOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpos,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty,_lhsOstatementCount))) -- MStatList --------------------------------------------------- -- cata sem_MStatList :: MStatList -> T_MStatList sem_MStatList list = (Prelude.foldr sem_MStatList_Cons sem_MStatList_Nil (Prelude.map sem_MStat list)) -- semantic domain type T_MStatList = ([MToken]) -> Int -> Bool -> PrettyPrintConfig -> Region -> ( ([MToken]),MStatList,Bool,Bool,Bool,Bool,Doc,Int) data Inh_MStatList = Inh_MStatList {comments_Inh_MStatList :: ([MToken]),indent_Inh_MStatList :: Int,isHead_Inh_MStatList :: Bool,ppconf_Inh_MStatList :: PrettyPrintConfig,statRegion_Inh_MStatList :: Region} data Syn_MStatList = Syn_MStatList {comments_Syn_MStatList :: ([MToken]),copy_Syn_MStatList :: MStatList,hasBreaking_Syn_MStatList :: Bool,isLast_Syn_MStatList :: Bool,isMultiline_Syn_MStatList :: Bool,potentiallyAmbiguousAsStatement_Syn_MStatList :: Bool,pretty_Syn_MStatList :: Doc,statementCount_Syn_MStatList :: Int} wrap_MStatList :: T_MStatList -> Inh_MStatList -> Syn_MStatList wrap_MStatList sem (Inh_MStatList _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisLast,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf _lhsIstatRegion in (Syn_MStatList _lhsOcomments _lhsOcopy _lhsOhasBreaking _lhsOisLast _lhsOisMultiline _lhsOpotentiallyAmbiguousAsStatement _lhsOpretty _lhsOstatementCount)) sem_MStatList_Cons :: T_MStat -> T_MStatList -> T_MStatList sem_MStatList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _hdOcomments :: ([MToken]) _tlOcomments :: ([MToken]) _tlOisHead :: Bool _hdOisLastStatement :: Bool _hdOpotentiallyAmbiguousAsStatement :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOisLast :: Bool _lhsOhasBreaking :: Bool _lhsOstatementCount :: Int _lhsOcopy :: MStatList _lhsOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _tlOstatRegion :: Region _hdIcomments :: ([MToken]) _hdIcopy :: MStat _hdIhasBreaking :: Bool _hdIisMultiline :: Bool _hdIpos :: Region _hdIpotentiallyAmbiguousAsStatement :: Bool _hdIpretty :: Doc _hdIstatementCount :: Int _tlIcomments :: ([MToken]) _tlIcopy :: MStatList _tlIhasBreaking :: Bool _tlIisLast :: Bool _tlIisMultiline :: Bool _tlIpotentiallyAmbiguousAsStatement :: Bool _tlIpretty :: Doc _tlIstatementCount :: Int _lhsOisMultiline = ({-# LINE 314 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline {-# LINE 5046 "src/GLua/AG/PrettyPrint.hs" #-} ) _addNewline = ({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-} if not _tlIisLast && (_hdIisMultiline || _tlIisMultiline) then zchr '\n' else empty {-# LINE 5051 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 316 "src/GLua/AG/PrettyPrint.ag" #-} _prettyCommentsBefore $+$ indent _lhsIppconf _lhsIindent _hdIpretty <-> _prettyCommentsAfter <> _addNewline $+$ _tlIpretty {-# LINE 5059 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsBefore = ({-# LINE 322 "src/GLua/AG/PrettyPrint.ag" #-} renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore ) {-# LINE 5064 "src/GLua/AG/PrettyPrint.hs" #-} ) _prettyCommentsAfter = ({-# LINE 323 "src/GLua/AG/PrettyPrint.ag" #-} renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter ) {-# LINE 5069 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsBefore = ({-# LINE 324 "src/GLua/AG/PrettyPrint.ag" #-} if _hdIisMultiline then span (\(MToken pos' _) -> pos' `beforeOrOnLine` _hdIpos) _lhsIcomments else span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments {-# LINE 5076 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsAfter = ({-# LINE 328 "src/GLua/AG/PrettyPrint.ag" #-} if _hdIisMultiline then span (\(MToken pos' _) -> pos' `beforeOrOnLine` _hdIpos) (snd _commentsBefore ) else span (\(MToken pos' _) -> pos' `beforeEndLine` _hdIpos) (snd _commentsBefore ) {-# LINE 5083 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 332 "src/GLua/AG/PrettyPrint.ag" #-} snd _commentsAfter {-# LINE 5088 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 333 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 5093 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOisHead = ({-# LINE 335 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5098 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOisLastStatement = ({-# LINE 336 "src/GLua/AG/PrettyPrint.ag" #-} _tlIisLast {-# LINE 5103 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOpotentiallyAmbiguousAsStatement = ({-# LINE 337 "src/GLua/AG/PrettyPrint.ag" #-} _tlIpotentiallyAmbiguousAsStatement {-# LINE 5108 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 338 "src/GLua/AG/PrettyPrint.ag" #-} _hdIpotentiallyAmbiguousAsStatement {-# LINE 5113 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLast = ({-# LINE 339 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5118 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} _hdIhasBreaking || _tlIhasBreaking {-# LINE 5123 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-} _hdIstatementCount + _tlIstatementCount {-# LINE 5128 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 5133 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5138 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 5143 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5148 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5153 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5158 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5163 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 5168 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcomments,_hdIcopy,_hdIhasBreaking,_hdIisMultiline,_hdIpos,_hdIpotentiallyAmbiguousAsStatement,_hdIpretty,_hdIstatementCount) = hd_ _hdOcomments _hdOindent _hdOisLastStatement _hdOpotentiallyAmbiguousAsStatement _hdOppconf ( _tlIcomments,_tlIcopy,_tlIhasBreaking,_tlIisLast,_tlIisMultiline,_tlIpotentiallyAmbiguousAsStatement,_tlIpretty,_tlIstatementCount) = tl_ _tlOcomments _tlOindent _tlOisHead _tlOppconf _tlOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisLast,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty,_lhsOstatementCount))) sem_MStatList_Nil :: T_MStatList sem_MStatList_Nil = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOstatementCount :: Int _lhsOcomments :: ([MToken]) _lhsOhasBreaking :: Bool _lhsOisLast :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: MStatList _lhsOpretty = ({-# LINE 340 "src/GLua/AG/PrettyPrint.ag" #-} _renderedComments {-# LINE 5193 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOstatementCount = ({-# LINE 341 "src/GLua/AG/PrettyPrint.ag" #-} 0 {-# LINE 5198 "src/GLua/AG/PrettyPrint.hs" #-} ) _renderedComments = ({-# LINE 342 "src/GLua/AG/PrettyPrint.ag" #-} renderMLComments _lhsIppconf _lhsIindent $ fst _commentsBeforeEnd {-# LINE 5203 "src/GLua/AG/PrettyPrint.hs" #-} ) _commentsBeforeEnd = ({-# LINE 345 "src/GLua/AG/PrettyPrint.ag" #-} if _lhsIisHead then ([], _lhsIcomments) else span (\(MToken pos' _tok) -> pos' `beforeEnd` _lhsIstatRegion) _lhsIcomments {-# LINE 5208 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 346 "src/GLua/AG/PrettyPrint.ag" #-} snd _commentsBeforeEnd {-# LINE 5213 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5218 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLast = ({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 5223 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5228 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5233 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 5238 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5243 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisLast,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty,_lhsOstatementCount))) -- MaybeMExpr -------------------------------------------------- -- cata sem_MaybeMExpr :: MaybeMExpr -> T_MaybeMExpr sem_MaybeMExpr (Prelude.Just x) = (sem_MaybeMExpr_Just (sem_MExpr x)) sem_MaybeMExpr Prelude.Nothing = sem_MaybeMExpr_Nothing -- semantic domain type T_MaybeMExpr = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),MaybeMExpr,Bool,Bool,Bool,OperatorLevel,Doc,Bool) data Inh_MaybeMExpr = Inh_MaybeMExpr {comments_Inh_MaybeMExpr :: ([MToken]),indent_Inh_MaybeMExpr :: Int,ppconf_Inh_MaybeMExpr :: PrettyPrintConfig} data Syn_MaybeMExpr = Syn_MaybeMExpr {comments_Syn_MaybeMExpr :: ([MToken]),copy_Syn_MaybeMExpr :: MaybeMExpr,isAssociative_Syn_MaybeMExpr :: Bool,isDefined_Syn_MaybeMExpr :: Bool,isMultiline_Syn_MaybeMExpr :: Bool,precedence_Syn_MaybeMExpr :: OperatorLevel,pretty_Syn_MaybeMExpr :: Doc,wouldBeAmbiguousIfNextStatementIsExprVar_Syn_MaybeMExpr :: Bool} wrap_MaybeMExpr :: T_MaybeMExpr -> Inh_MaybeMExpr -> Syn_MaybeMExpr wrap_MaybeMExpr sem (Inh_MaybeMExpr _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_MaybeMExpr _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisDefined _lhsOisMultiline _lhsOprecedence _lhsOpretty _lhsOwouldBeAmbiguousIfNextStatementIsExprVar)) sem_MaybeMExpr_Just :: T_MExpr -> T_MaybeMExpr sem_MaybeMExpr_Just just_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisDefined :: Bool _justOparentOperatorPrecedence :: OperatorLevel _justOparentOperatorAssociative :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: MaybeMExpr _lhsOcomments :: ([MToken]) _justOcomments :: ([MToken]) _justOindent :: Int _justOppconf :: PrettyPrintConfig _justIcomments :: ([MToken]) _justIcopy :: MExpr _justIisAssociative :: Bool _justIisLiteral :: Bool _justIisMultiline :: Bool _justIpos :: Region _justIprecedence :: OperatorLevel _justIpretty :: Doc _justIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 397 "src/GLua/AG/PrettyPrint.ag" #-} _justIpretty {-# LINE 5298 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisDefined = ({-# LINE 398 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 5303 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOparentOperatorPrecedence = ({-# LINE 399 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 5308 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOparentOperatorAssociative = ({-# LINE 400 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 5313 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _justIisAssociative {-# LINE 5318 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _justIisMultiline {-# LINE 5323 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} _justIprecedence {-# LINE 5328 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} _justIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 5333 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Just _justIcopy {-# LINE 5338 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5343 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _justIcomments {-# LINE 5348 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5353 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5358 "src/GLua/AG/PrettyPrint.hs" #-} ) _justOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5363 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _justIcomments,_justIcopy,_justIisAssociative,_justIisLiteral,_justIisMultiline,_justIpos,_justIprecedence,_justIpretty,_justIwouldBeAmbiguousIfNextStatementIsExprVar) = just_ _justOcomments _justOindent _justOparentOperatorAssociative _justOparentOperatorPrecedence _justOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_MaybeMExpr_Nothing :: T_MaybeMExpr sem_MaybeMExpr_Nothing = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisDefined :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: MaybeMExpr _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 402 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 5384 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisDefined = ({-# LINE 403 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5389 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5394 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5399 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 5404 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5409 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Nothing {-# LINE 5414 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5419 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5424 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) -- PFExprSuffix ------------------------------------------------ -- cata sem_PFExprSuffix :: PFExprSuffix -> T_PFExprSuffix sem_PFExprSuffix (Call _args) = (sem_PFExprSuffix_Call (sem_Args _args)) sem_PFExprSuffix (MetaCall _fn _args) = (sem_PFExprSuffix_MetaCall _fn (sem_Args _args)) sem_PFExprSuffix (ExprIndex _index) = (sem_PFExprSuffix_ExprIndex (sem_MExpr _index)) sem_PFExprSuffix (DotIndex _index) = (sem_PFExprSuffix_DotIndex _index) -- semantic domain type T_PFExprSuffix = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),PFExprSuffix,Bool,Bool,OperatorLevel,Doc) data Inh_PFExprSuffix = Inh_PFExprSuffix {comments_Inh_PFExprSuffix :: ([MToken]),indent_Inh_PFExprSuffix :: Int,ppconf_Inh_PFExprSuffix :: PrettyPrintConfig} data Syn_PFExprSuffix = Syn_PFExprSuffix {comments_Syn_PFExprSuffix :: ([MToken]),copy_Syn_PFExprSuffix :: PFExprSuffix,isAssociative_Syn_PFExprSuffix :: Bool,isMultiline_Syn_PFExprSuffix :: Bool,precedence_Syn_PFExprSuffix :: OperatorLevel,pretty_Syn_PFExprSuffix :: Doc} wrap_PFExprSuffix :: T_PFExprSuffix -> Inh_PFExprSuffix -> Syn_PFExprSuffix wrap_PFExprSuffix sem (Inh_PFExprSuffix _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_PFExprSuffix _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty)) sem_PFExprSuffix_Call :: T_Args -> T_PFExprSuffix sem_PFExprSuffix_Call args_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: PFExprSuffix _lhsOcomments :: ([MToken]) _argsOcomments :: ([MToken]) _argsOindent :: Int _argsOppconf :: PrettyPrintConfig _argsIcomments :: ([MToken]) _argsIcopy :: Args _argsIisMultiline :: Bool _argsIpretty :: Doc _lhsOpretty = ({-# LINE 608 "src/GLua/AG/PrettyPrint.ag" #-} _argsIpretty {-# LINE 5474 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5479 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _argsIisMultiline {-# LINE 5484 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 5489 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Call _argsIcopy {-# LINE 5494 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5499 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _argsIcomments {-# LINE 5504 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5509 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5514 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5519 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) = args_ _argsOcomments _argsOindent _argsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_PFExprSuffix_MetaCall :: MToken -> T_Args -> T_PFExprSuffix sem_PFExprSuffix_MetaCall fn_ args_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: PFExprSuffix _lhsOcomments :: ([MToken]) _argsOcomments :: ([MToken]) _argsOindent :: Int _argsOppconf :: PrettyPrintConfig _argsIcomments :: ([MToken]) _argsIcopy :: Args _argsIisMultiline :: Bool _argsIpretty :: Doc _lhsOpretty = ({-# LINE 609 "src/GLua/AG/PrettyPrint.ag" #-} zchr ':' <> tok fn_ <> _argsIpretty {-# LINE 5547 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5552 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _argsIisMultiline {-# LINE 5557 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 5562 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} MetaCall fn_ _argsIcopy {-# LINE 5567 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5572 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _argsIcomments {-# LINE 5577 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5582 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5587 "src/GLua/AG/PrettyPrint.hs" #-} ) _argsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5592 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) = args_ _argsOcomments _argsOindent _argsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_PFExprSuffix_ExprIndex :: T_MExpr -> T_PFExprSuffix sem_PFExprSuffix_ExprIndex index_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _indexOparentOperatorPrecedence :: OperatorLevel _indexOparentOperatorAssociative :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: PFExprSuffix _lhsOcomments :: ([MToken]) _indexOcomments :: ([MToken]) _indexOindent :: Int _indexOppconf :: PrettyPrintConfig _indexIcomments :: ([MToken]) _indexIcopy :: MExpr _indexIisAssociative :: Bool _indexIisLiteral :: Bool _indexIisMultiline :: Bool _indexIpos :: Region _indexIprecedence :: OperatorLevel _indexIpretty :: Doc _indexIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 610 "src/GLua/AG/PrettyPrint.ag" #-} brackets _lhsIppconf _indexIpretty {-# LINE 5626 "src/GLua/AG/PrettyPrint.hs" #-} ) _indexOparentOperatorPrecedence = ({-# LINE 611 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 5631 "src/GLua/AG/PrettyPrint.hs" #-} ) _indexOparentOperatorAssociative = ({-# LINE 612 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 5636 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _indexIisAssociative {-# LINE 5641 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _indexIisMultiline {-# LINE 5646 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} _indexIprecedence {-# LINE 5651 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ExprIndex _indexIcopy {-# LINE 5656 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5661 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _indexIcomments {-# LINE 5666 "src/GLua/AG/PrettyPrint.hs" #-} ) _indexOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5671 "src/GLua/AG/PrettyPrint.hs" #-} ) _indexOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5676 "src/GLua/AG/PrettyPrint.hs" #-} ) _indexOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5681 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _indexIcomments,_indexIcopy,_indexIisAssociative,_indexIisLiteral,_indexIisMultiline,_indexIpos,_indexIprecedence,_indexIpretty,_indexIwouldBeAmbiguousIfNextStatementIsExprVar) = index_ _indexOcomments _indexOindent _indexOparentOperatorAssociative _indexOparentOperatorPrecedence _indexOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) sem_PFExprSuffix_DotIndex :: MToken -> T_PFExprSuffix sem_PFExprSuffix_DotIndex index_ = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: PFExprSuffix _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 613 "src/GLua/AG/PrettyPrint.ag" #-} zchr '.' <> tok index_ {-# LINE 5701 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5706 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5711 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} OperatorLevel8 {-# LINE 5716 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} DotIndex index_ {-# LINE 5721 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5726 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5731 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty))) -- PrefixExp --------------------------------------------------- -- cata sem_PrefixExp :: PrefixExp -> T_PrefixExp sem_PrefixExp (PFVar _name _suffixes) = (sem_PrefixExp_PFVar _name (sem_ExprSuffixList _suffixes)) sem_PrefixExp (ExprVar _expr _suffixes) = (sem_PrefixExp_ExprVar (sem_MExpr _expr) (sem_ExprSuffixList _suffixes)) -- semantic domain type T_PrefixExp = ([MToken]) -> Int -> Bool -> OperatorLevel -> PrettyPrintConfig -> ( ([MToken]),PrefixExp,Bool,Bool,Bool,Bool,OperatorLevel,Doc) data Inh_PrefixExp = Inh_PrefixExp {comments_Inh_PrefixExp :: ([MToken]),indent_Inh_PrefixExp :: Int,parentOperatorAssociative_Inh_PrefixExp :: Bool,parentOperatorPrecedence_Inh_PrefixExp :: OperatorLevel,ppconf_Inh_PrefixExp :: PrettyPrintConfig} data Syn_PrefixExp = Syn_PrefixExp {comments_Syn_PrefixExp :: ([MToken]),copy_Syn_PrefixExp :: PrefixExp,isAssociative_Syn_PrefixExp :: Bool,isLiteral_Syn_PrefixExp :: Bool,isMultiline_Syn_PrefixExp :: Bool,potentiallyAmbiguousAsStatement_Syn_PrefixExp :: Bool,precedence_Syn_PrefixExp :: OperatorLevel,pretty_Syn_PrefixExp :: Doc} wrap_PrefixExp :: T_PrefixExp -> Inh_PrefixExp -> Syn_PrefixExp wrap_PrefixExp sem (Inh_PrefixExp _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf in (Syn_PrefixExp _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOpotentiallyAmbiguousAsStatement _lhsOprecedence _lhsOpretty)) sem_PrefixExp_PFVar :: MToken -> T_ExprSuffixList -> T_PrefixExp sem_PrefixExp_PFVar name_ suffixes_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisLiteral :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOprecedence :: OperatorLevel _lhsOcopy :: PrefixExp _lhsOcomments :: ([MToken]) _suffixesOcomments :: ([MToken]) _suffixesOindent :: Int _suffixesOppconf :: PrettyPrintConfig _suffixesIcomments :: ([MToken]) _suffixesIcopy :: ExprSuffixList _suffixesIisAssociative :: Bool _suffixesIisMultiline :: Bool _suffixesIprecedence :: OperatorLevel _suffixesIpretty :: Doc _lhsOpretty = ({-# LINE 570 "src/GLua/AG/PrettyPrint.ag" #-} tok name_ <> _suffixesIpretty {-# LINE 5786 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 571 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5791 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _suffixesIisAssociative {-# LINE 5796 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _suffixesIisMultiline {-# LINE 5801 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5806 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-} _suffixesIprecedence {-# LINE 5811 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} PFVar name_ _suffixesIcopy {-# LINE 5816 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5821 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _suffixesIcomments {-# LINE 5826 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5831 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5836 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5841 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) = suffixes_ _suffixesOcomments _suffixesOindent _suffixesOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOprecedence,_lhsOpretty))) sem_PrefixExp_ExprVar :: T_MExpr -> T_ExprSuffixList -> T_PrefixExp sem_PrefixExp_ExprVar expr_ suffixes_ = (\ _lhsIcomments _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOprecedence :: OperatorLevel _lhsOisLiteral :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOisAssociative :: Bool _lhsOisMultiline :: Bool _lhsOcopy :: PrefixExp _lhsOcomments :: ([MToken]) _exprOcomments :: ([MToken]) _exprOindent :: Int _exprOparentOperatorAssociative :: Bool _exprOparentOperatorPrecedence :: OperatorLevel _exprOppconf :: PrettyPrintConfig _suffixesOcomments :: ([MToken]) _suffixesOindent :: Int _suffixesOppconf :: PrettyPrintConfig _exprIcomments :: ([MToken]) _exprIcopy :: MExpr _exprIisAssociative :: Bool _exprIisLiteral :: Bool _exprIisMultiline :: Bool _exprIpos :: Region _exprIprecedence :: OperatorLevel _exprIpretty :: Doc _exprIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _suffixesIcomments :: ([MToken]) _suffixesIcopy :: ExprSuffixList _suffixesIisAssociative :: Bool _suffixesIisMultiline :: Bool _suffixesIprecedence :: OperatorLevel _suffixesIpretty :: Doc _lhsOpretty = ({-# LINE 572 "src/GLua/AG/PrettyPrint.ag" #-} (if _noparens then _exprIpretty else parens _lhsIppconf NonEmpty _exprIpretty) <> _suffixesIpretty {-# LINE 5889 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOprecedence = ({-# LINE 573 "src/GLua/AG/PrettyPrint.ag" #-} if _noparens then _exprIprecedence else OperatorLevel8 {-# LINE 5894 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLiteral = ({-# LINE 574 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 5899 "src/GLua/AG/PrettyPrint.hs" #-} ) _containsParenthesizedExpr = ({-# LINE 578 "src/GLua/AG/PrettyPrint.ag" #-} case _exprIcopy of MExpr _ (APrefixExpr _) -> True _ -> False {-# LINE 5906 "src/GLua/AG/PrettyPrint.hs" #-} ) _noparens = ({-# LINE 581 "src/GLua/AG/PrettyPrint.ag" #-} (removeRedundantParens _lhsIppconf || minimizeParens _lhsIppconf) && (_containsParenthesizedExpr || (_lhsIparentOperatorPrecedence == TopLevelExpression || _exprIisLiteral) && length _suffixesIcopy == 0) || (minimizeParens _lhsIppconf && length _suffixesIcopy == 0 && ( _lhsIparentOperatorPrecedence < _exprIprecedence || assumeOperatorAssociativity _lhsIppconf && _lhsIparentOperatorPrecedence == _exprIprecedence && _lhsIparentOperatorAssociative ) ) {-# LINE 5918 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 605 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 5923 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisAssociative = ({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-} _exprIisAssociative && _suffixesIisAssociative {-# LINE 5928 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _exprIisMultiline || _suffixesIisMultiline {-# LINE 5933 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ExprVar _exprIcopy _suffixesIcopy {-# LINE 5938 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 5943 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _suffixesIcomments {-# LINE 5948 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 5953 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5958 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOparentOperatorAssociative = ({-# LINE 243 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorAssociative {-# LINE 5963 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOparentOperatorPrecedence = ({-# LINE 242 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIparentOperatorPrecedence {-# LINE 5968 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5973 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _exprIcomments {-# LINE 5978 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 5983 "src/GLua/AG/PrettyPrint.hs" #-} ) _suffixesOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 5988 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _exprIcomments,_exprIcopy,_exprIisAssociative,_exprIisLiteral,_exprIisMultiline,_exprIpos,_exprIprecedence,_exprIpretty,_exprIwouldBeAmbiguousIfNextStatementIsExprVar) = expr_ _exprOcomments _exprOindent _exprOparentOperatorAssociative _exprOparentOperatorPrecedence _exprOppconf ( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) = suffixes_ _suffixesOcomments _suffixesOindent _suffixesOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOprecedence,_lhsOpretty))) -- Stat -------------------------------------------------------- -- cata sem_Stat :: Stat -> T_Stat sem_Stat (Def _vars) = (sem_Stat_Def (sem_VarsList _vars)) sem_Stat (LocDef _vars) = (sem_Stat_LocDef (sem_VarsList _vars)) sem_Stat (AFuncCall _fn) = (sem_Stat_AFuncCall (sem_PrefixExp _fn)) sem_Stat (ALabel _lbl) = (sem_Stat_ALabel _lbl) sem_Stat (ABreak) = (sem_Stat_ABreak) sem_Stat (AContinue) = (sem_Stat_AContinue) sem_Stat (AGoto _lbl) = (sem_Stat_AGoto _lbl) sem_Stat (ADo _body) = (sem_Stat_ADo (sem_Block _body)) sem_Stat (AWhile _cond _body) = (sem_Stat_AWhile (sem_MExpr _cond) (sem_Block _body)) sem_Stat (ARepeat _body _cond) = (sem_Stat_ARepeat (sem_Block _body) (sem_MExpr _cond)) sem_Stat (AIf _cond _body _elifs _els) = (sem_Stat_AIf (sem_MExpr _cond) (sem_Block _body) (sem_ElseIfList _elifs) (sem_Else _els)) sem_Stat (ANFor _var _val _to _step _body) = (sem_Stat_ANFor _var (sem_MExpr _val) (sem_MExpr _to) (sem_MExpr _step) (sem_Block _body)) sem_Stat (AGFor _vars _vals _body) = (sem_Stat_AGFor _vars (sem_MExprList _vals) (sem_Block _body)) sem_Stat (AFunc _name _args _body) = (sem_Stat_AFunc (sem_FuncName _name) _args (sem_Block _body)) sem_Stat (ALocFunc _name _args _body) = (sem_Stat_ALocFunc (sem_FuncName _name) _args (sem_Block _body)) -- semantic domain type T_Stat = ([MToken]) -> Int -> Bool -> Bool -> PrettyPrintConfig -> Region -> ( ([MToken]),Stat,Bool,Bool,Bool,Doc) data Inh_Stat = Inh_Stat {comments_Inh_Stat :: ([MToken]),indent_Inh_Stat :: Int,isLastStatement_Inh_Stat :: Bool,potentiallyAmbiguousAsStatement_Inh_Stat :: Bool,ppconf_Inh_Stat :: PrettyPrintConfig,statRegion_Inh_Stat :: Region} data Syn_Stat = Syn_Stat {comments_Syn_Stat :: ([MToken]),copy_Syn_Stat :: Stat,hasBreaking_Syn_Stat :: Bool,isMultiline_Syn_Stat :: Bool,potentiallyAmbiguousAsStatement_Syn_Stat :: Bool,pretty_Syn_Stat :: Doc} wrap_Stat :: T_Stat -> Inh_Stat -> Syn_Stat wrap_Stat sem (Inh_Stat _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion) = (let ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion in (Syn_Stat _lhsOcomments _lhsOcopy _lhsOhasBreaking _lhsOisMultiline _lhsOpotentiallyAmbiguousAsStatement _lhsOpretty)) sem_Stat_Def :: T_VarsList -> T_Stat sem_Stat_Def vars_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _varsOisHead :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _varsOcomments :: ([MToken]) _varsOindent :: Int _varsOppconf :: PrettyPrintConfig _varsIcomments :: ([MToken]) _varsIcopy :: VarsList _varsIexprPretty :: Doc _varsIisDefined :: Bool _varsIisLastDefinedVar :: Bool _varsIisMultiline :: Bool _varsIpretty :: Doc _varsIvarPretty :: Doc _varsIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 471 "src/GLua/AG/PrettyPrint.ag" #-} _varsIpretty <> _semicolon {-# LINE 6076 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 472 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf || _wouldBeAmbiguous then zchr ';' else empty {-# LINE 6081 "src/GLua/AG/PrettyPrint.hs" #-} ) _wouldBeAmbiguous = ({-# LINE 473 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIpotentiallyAmbiguousAsStatement && _varsIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 6086 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOisHead = ({-# LINE 474 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6091 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6096 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _varsIisMultiline {-# LINE 6101 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6106 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} Def _varsIcopy {-# LINE 6111 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6116 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _varsIcomments {-# LINE 6121 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6126 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 6131 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6136 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _varsIcomments,_varsIcopy,_varsIexprPretty,_varsIisDefined,_varsIisLastDefinedVar,_varsIisMultiline,_varsIpretty,_varsIvarPretty,_varsIwouldBeAmbiguousIfNextStatementIsExprVar) = vars_ _varsOcomments _varsOindent _varsOisHead _varsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_LocDef :: T_VarsList -> T_Stat sem_Stat_LocDef vars_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _varsOisHead :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _varsOcomments :: ([MToken]) _varsOindent :: Int _varsOppconf :: PrettyPrintConfig _varsIcomments :: ([MToken]) _varsIcopy :: VarsList _varsIexprPretty :: Doc _varsIisDefined :: Bool _varsIisLastDefinedVar :: Bool _varsIisMultiline :: Bool _varsIpretty :: Doc _varsIvarPretty :: Doc _varsIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 475 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "local" <-> _varsIpretty <> _semicolon {-# LINE 6172 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 476 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf || _wouldBeAmbiguous then zchr ';' else empty {-# LINE 6177 "src/GLua/AG/PrettyPrint.hs" #-} ) _wouldBeAmbiguous = ({-# LINE 477 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIpotentiallyAmbiguousAsStatement && _varsIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 6182 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOisHead = ({-# LINE 478 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6187 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6192 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _varsIisMultiline {-# LINE 6197 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6202 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} LocDef _varsIcopy {-# LINE 6207 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6212 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _varsIcomments {-# LINE 6217 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6222 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 6227 "src/GLua/AG/PrettyPrint.hs" #-} ) _varsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6232 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _varsIcomments,_varsIcopy,_varsIexprPretty,_varsIisDefined,_varsIisLastDefinedVar,_varsIisMultiline,_varsIpretty,_varsIvarPretty,_varsIwouldBeAmbiguousIfNextStatementIsExprVar) = vars_ _varsOcomments _varsOindent _varsOisHead _varsOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AFuncCall :: T_PrefixExp -> T_Stat sem_Stat_AFuncCall fn_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _fnOparentOperatorPrecedence :: OperatorLevel _fnOparentOperatorAssociative :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _fnOcomments :: ([MToken]) _fnOindent :: Int _fnOppconf :: PrettyPrintConfig _fnIcomments :: ([MToken]) _fnIcopy :: PrefixExp _fnIisAssociative :: Bool _fnIisLiteral :: Bool _fnIisMultiline :: Bool _fnIpotentiallyAmbiguousAsStatement :: Bool _fnIprecedence :: OperatorLevel _fnIpretty :: Doc _lhsOpretty = ({-# LINE 479 "src/GLua/AG/PrettyPrint.ag" #-} _fnIpretty <> _semicolon {-# LINE 6268 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 480 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf || _lhsIpotentiallyAmbiguousAsStatement then zchr ';' else empty {-# LINE 6273 "src/GLua/AG/PrettyPrint.hs" #-} ) _fnOparentOperatorPrecedence = ({-# LINE 481 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 6278 "src/GLua/AG/PrettyPrint.hs" #-} ) _fnOparentOperatorAssociative = ({-# LINE 482 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6283 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6288 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _fnIisMultiline {-# LINE 6293 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} _fnIpotentiallyAmbiguousAsStatement {-# LINE 6298 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AFuncCall _fnIcopy {-# LINE 6303 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6308 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _fnIcomments {-# LINE 6313 "src/GLua/AG/PrettyPrint.hs" #-} ) _fnOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6318 "src/GLua/AG/PrettyPrint.hs" #-} ) _fnOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 6323 "src/GLua/AG/PrettyPrint.hs" #-} ) _fnOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6328 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _fnIcomments,_fnIcopy,_fnIisAssociative,_fnIisLiteral,_fnIisMultiline,_fnIpotentiallyAmbiguousAsStatement,_fnIprecedence,_fnIpretty) = fn_ _fnOcomments _fnOindent _fnOparentOperatorAssociative _fnOparentOperatorPrecedence _fnOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ALabel :: MToken -> T_Stat sem_Stat_ALabel lbl_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 483 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "::" <> _whitespace <> tok lbl_ <> _whitespace <> zeroWidthText "::" {-# LINE 6351 "src/GLua/AG/PrettyPrint.hs" #-} ) _whitespace = ({-# LINE 484 "src/GLua/AG/PrettyPrint.ag" #-} if spaceAfterLabel _lhsIppconf then zeroWidthText " " else empty {-# LINE 6356 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6361 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6366 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6371 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ALabel lbl_ {-# LINE 6376 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6381 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6386 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ABreak :: T_Stat sem_Stat_ABreak = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 485 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "break" <> _semicolon {-# LINE 6406 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 486 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf then zchr ';' else empty {-# LINE 6411 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 487 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6416 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6421 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6426 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ABreak {-# LINE 6431 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6436 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6441 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AContinue :: T_Stat sem_Stat_AContinue = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 488 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "continue" <> _semicolon {-# LINE 6461 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 489 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf then zchr ';' else empty {-# LINE 6466 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 490 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6471 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6476 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6481 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AContinue {-# LINE 6486 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6491 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6496 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AGoto :: MToken -> T_Stat sem_Stat_AGoto lbl_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 491 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "goto" <-> tok lbl_ <> _semicolon {-# LINE 6517 "src/GLua/AG/PrettyPrint.hs" #-} ) _semicolon = ({-# LINE 492 "src/GLua/AG/PrettyPrint.ag" #-} if semicolons _lhsIppconf then zchr ';' else empty {-# LINE 6522 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6527 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6532 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6537 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AGoto lbl_ {-# LINE 6542 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6547 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6552 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ADo :: T_Block -> T_Stat sem_Stat_ADo body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _bodyOindent :: Int _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 494 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6583 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 495 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 6588 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 496 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 6593 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 497 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6598 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6603 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ADo _bodyIcopy {-# LINE 6608 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6613 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 6618 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6623 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6628 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 6633 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AWhile :: T_MExpr -> T_Block -> T_Stat sem_Stat_AWhile cond_ body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _condOparentOperatorPrecedence :: OperatorLevel _condOparentOperatorAssociative :: Bool _lhsOpretty :: Doc _bodyOindent :: Int _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _condOcomments :: ([MToken]) _condOindent :: Int _condOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _condIcomments :: ([MToken]) _condIcopy :: MExpr _condIisAssociative :: Bool _condIisLiteral :: Bool _condIisMultiline :: Bool _condIpos :: Region _condIprecedence :: OperatorLevel _condIpretty :: Doc _condIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 498 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6681 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorPrecedence = ({-# LINE 499 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 6686 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorAssociative = ({-# LINE 500 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6691 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 501 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "while" <-> _condIpretty <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 6696 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 502 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 6701 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 503 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6706 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6711 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AWhile _condIcopy _bodyIcopy {-# LINE 6716 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6721 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 6726 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6731 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 6736 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6741 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _condIcomments {-# LINE 6746 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6751 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 6756 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _condIcomments,_condIcopy,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty,_condIwouldBeAmbiguousIfNextStatementIsExprVar) = cond_ _condOcomments _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ARepeat :: T_Block -> T_MExpr -> T_Stat sem_Stat_ARepeat body_ cond_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOpretty :: Doc _bodyOindent :: Int _condOparentOperatorPrecedence :: OperatorLevel _condOparentOperatorAssociative :: Bool _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _condOcomments :: ([MToken]) _condOindent :: Int _condOppconf :: PrettyPrintConfig _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _condIcomments :: ([MToken]) _condIcopy :: MExpr _condIisAssociative :: Bool _condIisLiteral :: Bool _condIisMultiline :: Bool _condIpos :: Region _condIprecedence :: OperatorLevel _condIpretty :: Doc _condIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 504 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "repeat" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "until" <-> _condIpretty) {-# LINE 6806 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 505 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 6811 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorPrecedence = ({-# LINE 506 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 6816 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorAssociative = ({-# LINE 507 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6821 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 508 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6826 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIisMultiline || _condIisMultiline {-# LINE 6831 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6836 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ARepeat _bodyIcopy _condIcopy {-# LINE 6841 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 6846 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _condIcomments {-# LINE 6851 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 6856 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6861 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 6866 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 6871 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 6876 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 6881 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion ( _condIcomments,_condIcopy,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty,_condIwouldBeAmbiguousIfNextStatementIsExprVar) = cond_ _condOcomments _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AIf :: T_MExpr -> T_Block -> T_ElseIfList -> T_Else -> T_Stat sem_Stat_AIf cond_ body_ elifs_ els_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _condOparentOperatorPrecedence :: OperatorLevel _condOparentOperatorAssociative :: Bool _bodyOindent :: Int _bodyOstatRegion :: Region _lhsOpretty :: Doc _lhsOhasBreaking :: Bool _lhsOisMultiline :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _condOcomments :: ([MToken]) _condOindent :: Int _condOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _elifsOcomments :: ([MToken]) _elifsOindent :: Int _elifsOppconf :: PrettyPrintConfig _elsOcomments :: ([MToken]) _elsOindent :: Int _elsOppconf :: PrettyPrintConfig _elsOstatRegion :: Region _condIcomments :: ([MToken]) _condIcopy :: MExpr _condIisAssociative :: Bool _condIisLiteral :: Bool _condIisMultiline :: Bool _condIpos :: Region _condIprecedence :: OperatorLevel _condIpretty :: Doc _condIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _elifsIcomments :: ([MToken]) _elifsIcopy :: ElseIfList _elifsIelsesExist :: Bool _elifsIisMultiline :: Bool _elifsIpos :: Region _elifsIpretty :: Doc _elsIcomments :: ([MToken]) _elsIcopy :: Else _elsIelsesExist :: Bool _elsIisMultiline :: Bool _elsIpos :: Region _elsIpretty :: Doc _isMultiline = ({-# LINE 509 "src/GLua/AG/PrettyPrint.ag" #-} _condIisMultiline || _bodyIisMultiline || _bodyIstatementCount > 1 || _bodyIstatementCount == 1 && not _bodyIhasBreaking || _elifsIelsesExist || _elsIelsesExist {-# LINE 6952 "src/GLua/AG/PrettyPrint.hs" #-} ) _singleLinePretty = ({-# LINE 510 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "if" <-> _condIpretty <-> zeroWidthText "then" <-> _bodyIpretty <-> zeroWidthText "end" {-# LINE 6957 "src/GLua/AG/PrettyPrint.hs" #-} ) _multilinePretty = ({-# LINE 511 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "if" <-> _condIpretty <-> zeroWidthText "then" $+$ _bodyIpretty $+$ _elifsIpretty $+$ _elsIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 6962 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorPrecedence = ({-# LINE 512 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 6967 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOparentOperatorAssociative = ({-# LINE 513 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 6972 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 514 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then _lhsIindent + 1 else 0 {-# LINE 6977 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 515 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion `upto` _elifsIpos `upto` _elsIpos {-# LINE 6982 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 516 "src/GLua/AG/PrettyPrint.ag" #-} if _isMultiline then _multilinePretty else _singleLinePretty {-# LINE 6987 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 517 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 6992 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _isMultiline {-# LINE 6997 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7002 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AIf _condIcopy _bodyIcopy _elifsIcopy _elsIcopy {-# LINE 7007 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7012 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _elsIcomments {-# LINE 7017 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7022 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7027 "src/GLua/AG/PrettyPrint.hs" #-} ) _condOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7032 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _condIcomments {-# LINE 7037 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7042 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 7047 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7052 "src/GLua/AG/PrettyPrint.hs" #-} ) _elifsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7057 "src/GLua/AG/PrettyPrint.hs" #-} ) _elsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _elifsIcomments {-# LINE 7062 "src/GLua/AG/PrettyPrint.hs" #-} ) _elsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7067 "src/GLua/AG/PrettyPrint.hs" #-} ) _elsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7072 "src/GLua/AG/PrettyPrint.hs" #-} ) _elsOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 7077 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _condIcomments,_condIcopy,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty,_condIwouldBeAmbiguousIfNextStatementIsExprVar) = cond_ _condOcomments _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion ( _elifsIcomments,_elifsIcopy,_elifsIelsesExist,_elifsIisMultiline,_elifsIpos,_elifsIpretty) = elifs_ _elifsOcomments _elifsOindent _elifsOppconf ( _elsIcomments,_elsIcopy,_elsIelsesExist,_elsIisMultiline,_elsIpos,_elsIpretty) = els_ _elsOcomments _elsOindent _elsOppconf _elsOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ANFor :: MToken -> T_MExpr -> T_MExpr -> T_MExpr -> T_Block -> T_Stat sem_Stat_ANFor var_ val_ to_ step_ body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _valOparentOperatorPrecedence :: OperatorLevel _valOparentOperatorAssociative :: Bool _toOparentOperatorPrecedence :: OperatorLevel _toOparentOperatorAssociative :: Bool _stepOparentOperatorPrecedence :: OperatorLevel _stepOparentOperatorAssociative :: Bool _bodyOindent :: Int _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _valOcomments :: ([MToken]) _valOindent :: Int _valOppconf :: PrettyPrintConfig _toOcomments :: ([MToken]) _toOindent :: Int _toOppconf :: PrettyPrintConfig _stepOcomments :: ([MToken]) _stepOindent :: Int _stepOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _valIcomments :: ([MToken]) _valIcopy :: MExpr _valIisAssociative :: Bool _valIisLiteral :: Bool _valIisMultiline :: Bool _valIpos :: Region _valIprecedence :: OperatorLevel _valIpretty :: Doc _valIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _toIcomments :: ([MToken]) _toIcopy :: MExpr _toIisAssociative :: Bool _toIisLiteral :: Bool _toIisMultiline :: Bool _toIpos :: Region _toIprecedence :: OperatorLevel _toIpretty :: Doc _toIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _stepIcomments :: ([MToken]) _stepIcopy :: MExpr _stepIisAssociative :: Bool _stepIisLiteral :: Bool _stepIisMultiline :: Bool _stepIpos :: Region _stepIprecedence :: OperatorLevel _stepIpretty :: Doc _stepIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 518 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7162 "src/GLua/AG/PrettyPrint.hs" #-} ) _step = ({-# LINE 519 "src/GLua/AG/PrettyPrint.ag" #-} case _stepIcopy of MExpr _ (ANumber "1") -> empty _ -> _comma <> _stepIpretty {-# LINE 7169 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 522 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "for" <-> tok var_ <-> zchr '=' <-> _valIpretty <> _comma <> _toIpretty <> _step <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 7174 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 523 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 7179 "src/GLua/AG/PrettyPrint.hs" #-} ) _valOparentOperatorPrecedence = ({-# LINE 524 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 7184 "src/GLua/AG/PrettyPrint.hs" #-} ) _valOparentOperatorAssociative = ({-# LINE 525 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7189 "src/GLua/AG/PrettyPrint.hs" #-} ) _toOparentOperatorPrecedence = ({-# LINE 526 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 7194 "src/GLua/AG/PrettyPrint.hs" #-} ) _toOparentOperatorAssociative = ({-# LINE 527 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7199 "src/GLua/AG/PrettyPrint.hs" #-} ) _stepOparentOperatorPrecedence = ({-# LINE 528 "src/GLua/AG/PrettyPrint.ag" #-} TopLevelExpression {-# LINE 7204 "src/GLua/AG/PrettyPrint.hs" #-} ) _stepOparentOperatorAssociative = ({-# LINE 529 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7209 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 530 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 7214 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 531 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7219 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7224 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ANFor var_ _valIcopy _toIcopy _stepIcopy _bodyIcopy {-# LINE 7229 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7234 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 7239 "src/GLua/AG/PrettyPrint.hs" #-} ) _valOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7244 "src/GLua/AG/PrettyPrint.hs" #-} ) _valOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7249 "src/GLua/AG/PrettyPrint.hs" #-} ) _valOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7254 "src/GLua/AG/PrettyPrint.hs" #-} ) _toOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _valIcomments {-# LINE 7259 "src/GLua/AG/PrettyPrint.hs" #-} ) _toOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7264 "src/GLua/AG/PrettyPrint.hs" #-} ) _toOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7269 "src/GLua/AG/PrettyPrint.hs" #-} ) _stepOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _toIcomments {-# LINE 7274 "src/GLua/AG/PrettyPrint.hs" #-} ) _stepOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7279 "src/GLua/AG/PrettyPrint.hs" #-} ) _stepOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7284 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _stepIcomments {-# LINE 7289 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7294 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 7299 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _valIcomments,_valIcopy,_valIisAssociative,_valIisLiteral,_valIisMultiline,_valIpos,_valIprecedence,_valIpretty,_valIwouldBeAmbiguousIfNextStatementIsExprVar) = val_ _valOcomments _valOindent _valOparentOperatorAssociative _valOparentOperatorPrecedence _valOppconf ( _toIcomments,_toIcopy,_toIisAssociative,_toIisLiteral,_toIisMultiline,_toIpos,_toIprecedence,_toIpretty,_toIwouldBeAmbiguousIfNextStatementIsExprVar) = to_ _toOcomments _toOindent _toOparentOperatorAssociative _toOparentOperatorPrecedence _toOppconf ( _stepIcomments,_stepIcopy,_stepIisAssociative,_stepIisLiteral,_stepIisMultiline,_stepIpos,_stepIprecedence,_stepIpretty,_stepIwouldBeAmbiguousIfNextStatementIsExprVar) = step_ _stepOcomments _stepOindent _stepOparentOperatorAssociative _stepOparentOperatorPrecedence _stepOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AGFor :: ([MToken]) -> T_MExprList -> T_Block -> T_Stat sem_Stat_AGFor vars_ vals_ body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _bodyOindent :: Int _valsOisHead :: Bool _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _valsOcomments :: ([MToken]) _valsOindent :: Int _valsOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _valsIcomments :: ([MToken]) _valsIcopy :: MExprList _valsIisAssociative :: Bool _valsIisMultiline :: Bool _valsIpos :: Region _valsIprecedence :: OperatorLevel _valsIpretty :: Doc _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 532 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7351 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 533 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "for" <-> printList tok (render _comma ) vars_ <-> zeroWidthText "in" <-> _valsIpretty <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 7356 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 534 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 7361 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 535 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 7366 "src/GLua/AG/PrettyPrint.hs" #-} ) _valsOisHead = ({-# LINE 536 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7371 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 537 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7376 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7381 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AGFor vars_ _valsIcopy _bodyIcopy {-# LINE 7386 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7391 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 7396 "src/GLua/AG/PrettyPrint.hs" #-} ) _valsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7401 "src/GLua/AG/PrettyPrint.hs" #-} ) _valsOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7406 "src/GLua/AG/PrettyPrint.hs" #-} ) _valsOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7411 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _valsIcomments {-# LINE 7416 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7421 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 7426 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _valsIcomments,_valsIcopy,_valsIisAssociative,_valsIisMultiline,_valsIpos,_valsIprecedence,_valsIpretty) = vals_ _valsOcomments _valsOindent _valsOisHead _valsOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_AFunc :: T_FuncName -> ([MToken]) -> T_Block -> T_Stat sem_Stat_AFunc name_ args_ body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _bodyOindent :: Int _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _nameOcomments :: ([MToken]) _nameOindent :: Int _nameOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _nameIcomments :: ([MToken]) _nameIcopy :: FuncName _nameIisMultiline :: Bool _nameIpretty :: Doc _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 538 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7470 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 539 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "function" <-> _nameIpretty <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 7475 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyParams = ({-# LINE 540 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null args_ {-# LINE 7480 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 541 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 7485 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 542 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 7490 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 543 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7495 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7500 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AFunc _nameIcopy args_ _bodyIcopy {-# LINE 7505 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7510 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 7515 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7520 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7525 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7530 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _nameIcomments {-# LINE 7535 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7540 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 7545 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpretty) = name_ _nameOcomments _nameOindent _nameOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) sem_Stat_ALocFunc :: T_FuncName -> ([MToken]) -> T_Block -> T_Stat sem_Stat_ALocFunc name_ args_ body_ = (\ _lhsIcomments _lhsIindent _lhsIisLastStatement _lhsIpotentiallyAmbiguousAsStatement _lhsIppconf _lhsIstatRegion -> (let _lhsOisMultiline :: Bool _lhsOpretty :: Doc _bodyOindent :: Int _lhsOhasBreaking :: Bool _lhsOpotentiallyAmbiguousAsStatement :: Bool _lhsOcopy :: Stat _lhsOcomments :: ([MToken]) _nameOcomments :: ([MToken]) _nameOindent :: Int _nameOppconf :: PrettyPrintConfig _bodyOcomments :: ([MToken]) _bodyOppconf :: PrettyPrintConfig _bodyOstatRegion :: Region _nameIcomments :: ([MToken]) _nameIcopy :: FuncName _nameIisMultiline :: Bool _nameIpretty :: Doc _bodyIcomments :: ([MToken]) _bodyIcopy :: Block _bodyIhasBreaking :: Bool _bodyIisMultiline :: Bool _bodyIpretty :: Doc _bodyIstatementCount :: Int _lhsOisMultiline = ({-# LINE 544 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7589 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpretty = ({-# LINE 545 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "local function" <-> _nameIpretty <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end") {-# LINE 7594 "src/GLua/AG/PrettyPrint.hs" #-} ) _emptyParams = ({-# LINE 546 "src/GLua/AG/PrettyPrint.ag" #-} toEmpty $ null args_ {-# LINE 7599 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 547 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 7604 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOindent = ({-# LINE 548 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent + 1 {-# LINE 7609 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOhasBreaking = ({-# LINE 549 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7614 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOpotentiallyAmbiguousAsStatement = ({-# LINE 301 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7619 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ALocFunc _nameIcopy args_ _bodyIcopy {-# LINE 7624 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7629 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _bodyIcomments {-# LINE 7634 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7639 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7644 "src/GLua/AG/PrettyPrint.hs" #-} ) _nameOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7649 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _nameIcomments {-# LINE 7654 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7659 "src/GLua/AG/PrettyPrint.hs" #-} ) _bodyOstatRegion = ({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIstatRegion {-# LINE 7664 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpretty) = name_ _nameOcomments _nameOindent _nameOppconf ( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) = body_ _bodyOcomments _bodyOindent _bodyOppconf _bodyOstatRegion in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpotentiallyAmbiguousAsStatement,_lhsOpretty))) -- UnOp -------------------------------------------------------- -- cata sem_UnOp :: UnOp -> T_UnOp sem_UnOp (UnMinus) = (sem_UnOp_UnMinus) sem_UnOp (ANot) = (sem_UnOp_ANot) sem_UnOp (AHash) = (sem_UnOp_AHash) -- semantic domain type T_UnOp = ([MToken]) -> Int -> PrettyPrintConfig -> ( ([MToken]),UnOp,Bool,Doc) data Inh_UnOp = Inh_UnOp {comments_Inh_UnOp :: ([MToken]),indent_Inh_UnOp :: Int,ppconf_Inh_UnOp :: PrettyPrintConfig} data Syn_UnOp = Syn_UnOp {comments_Syn_UnOp :: ([MToken]),copy_Syn_UnOp :: UnOp,isMultiline_Syn_UnOp :: Bool,pretty_Syn_UnOp :: Doc} wrap_UnOp :: T_UnOp -> Inh_UnOp -> Syn_UnOp wrap_UnOp sem (Inh_UnOp _lhsIcomments _lhsIindent _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf in (Syn_UnOp _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty)) sem_UnOp_UnMinus :: T_UnOp sem_UnOp_UnMinus = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcopy :: UnOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 750 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "-" {-# LINE 7706 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7711 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} UnMinus {-# LINE 7716 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7721 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7726 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) sem_UnOp_ANot :: T_UnOp sem_UnOp_ANot = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcopy :: UnOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 751 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText (if cStyle _lhsIppconf then "!" else "not ") {-# LINE 7741 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7746 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} ANot {-# LINE 7751 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7756 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7761 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) sem_UnOp_AHash :: T_UnOp sem_UnOp_AHash = (\ _lhsIcomments _lhsIindent _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisMultiline :: Bool _lhsOcopy :: UnOp _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 752 "src/GLua/AG/PrettyPrint.ag" #-} zeroWidthText "#" {-# LINE 7776 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7781 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} AHash {-# LINE 7786 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7791 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7796 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty))) -- VarsList ---------------------------------------------------- -- cata sem_VarsList :: VarsList -> T_VarsList sem_VarsList list = (Prelude.foldr sem_VarsList_Cons sem_VarsList_Nil (Prelude.map sem_Declaration list)) -- semantic domain type T_VarsList = ([MToken]) -> Int -> Bool -> PrettyPrintConfig -> ( ([MToken]),VarsList,Doc,Bool,Bool,Bool,Doc,Doc,Bool) data Inh_VarsList = Inh_VarsList {comments_Inh_VarsList :: ([MToken]),indent_Inh_VarsList :: Int,isHead_Inh_VarsList :: Bool,ppconf_Inh_VarsList :: PrettyPrintConfig} data Syn_VarsList = Syn_VarsList {comments_Syn_VarsList :: ([MToken]),copy_Syn_VarsList :: VarsList,exprPretty_Syn_VarsList :: Doc,isDefined_Syn_VarsList :: Bool,isLastDefinedVar_Syn_VarsList :: Bool,isMultiline_Syn_VarsList :: Bool,pretty_Syn_VarsList :: Doc,varPretty_Syn_VarsList :: Doc,wouldBeAmbiguousIfNextStatementIsExprVar_Syn_VarsList :: Bool} wrap_VarsList :: T_VarsList -> Inh_VarsList -> Syn_VarsList wrap_VarsList sem (Inh_VarsList _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf) = (let ( _lhsOcomments,_lhsOcopy,_lhsOexprPretty,_lhsOisDefined,_lhsOisLastDefinedVar,_lhsOisMultiline,_lhsOpretty,_lhsOvarPretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar) = sem _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf in (Syn_VarsList _lhsOcomments _lhsOcopy _lhsOexprPretty _lhsOisDefined _lhsOisLastDefinedVar _lhsOisMultiline _lhsOpretty _lhsOvarPretty _lhsOwouldBeAmbiguousIfNextStatementIsExprVar)) sem_VarsList_Cons :: T_Declaration -> T_VarsList -> T_VarsList sem_VarsList_Cons hd_ tl_ = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf -> (let _lhsOpretty :: Doc _tlOisHead :: Bool _lhsOisLastDefinedVar :: Bool _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOexprPretty :: Doc _lhsOisDefined :: Bool _lhsOisMultiline :: Bool _lhsOvarPretty :: Doc _lhsOcopy :: VarsList _lhsOcomments :: ([MToken]) _hdOcomments :: ([MToken]) _hdOindent :: Int _hdOppconf :: PrettyPrintConfig _tlOcomments :: ([MToken]) _tlOindent :: Int _tlOppconf :: PrettyPrintConfig _hdIcomments :: ([MToken]) _hdIcopy :: Declaration _hdIexprPretty :: Doc _hdIisDefined :: Bool _hdIisMultiline :: Bool _hdIpretty :: Doc _hdIvarPretty :: Doc _hdIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _tlIcomments :: ([MToken]) _tlIcopy :: VarsList _tlIexprPretty :: Doc _tlIisDefined :: Bool _tlIisLastDefinedVar :: Bool _tlIisMultiline :: Bool _tlIpretty :: Doc _tlIvarPretty :: Doc _tlIwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOpretty = ({-# LINE 412 "src/GLua/AG/PrettyPrint.ag" #-} _varPretty <-> if _isDefined then zchr '=' <-> _exprPretty else empty {-# LINE 7863 "src/GLua/AG/PrettyPrint.hs" #-} ) _isDefined = ({-# LINE 413 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisDefined || _tlIisDefined {-# LINE 7868 "src/GLua/AG/PrettyPrint.hs" #-} ) _varPretty = ({-# LINE 414 "src/GLua/AG/PrettyPrint.ag" #-} (if _lhsIisHead then empty else _comma ) <> _hdIvarPretty <> _tlIvarPretty {-# LINE 7873 "src/GLua/AG/PrettyPrint.hs" #-} ) _exprPretty = ({-# LINE 415 "src/GLua/AG/PrettyPrint.ag" #-} (if _lhsIisHead || not _hdIisDefined then empty else _comma ) <> _hdIexprPretty <> _tlIexprPretty {-# LINE 7878 "src/GLua/AG/PrettyPrint.hs" #-} ) _comma = ({-# LINE 416 "src/GLua/AG/PrettyPrint.ag" #-} (if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty) {-# LINE 7883 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOisHead = ({-# LINE 417 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 7888 "src/GLua/AG/PrettyPrint.hs" #-} ) _isLastDefinedVar = ({-# LINE 418 "src/GLua/AG/PrettyPrint.ag" #-} _tlIisLastDefinedVar {-# LINE 7893 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLastDefinedVar = ({-# LINE 419 "src/GLua/AG/PrettyPrint.ag" #-} _isLastDefinedVar && not _hdIisDefined {-# LINE 7898 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 420 "src/GLua/AG/PrettyPrint.ag" #-} _tlIwouldBeAmbiguousIfNextStatementIsExprVar || _isLastDefinedVar && _hdIwouldBeAmbiguousIfNextStatementIsExprVar {-# LINE 7903 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOexprPretty = ({-# LINE 256 "src/GLua/AG/PrettyPrint.ag" #-} _exprPretty {-# LINE 7908 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisDefined = ({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-} _isDefined {-# LINE 7913 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} _hdIisMultiline || _tlIisMultiline {-# LINE 7918 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOvarPretty = ({-# LINE 255 "src/GLua/AG/PrettyPrint.ag" #-} _varPretty {-# LINE 7923 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} (:) _hdIcopy _tlIcopy {-# LINE 7928 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 7933 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _tlIcomments {-# LINE 7938 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 7943 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7948 "src/GLua/AG/PrettyPrint.hs" #-} ) _hdOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7953 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _hdIcomments {-# LINE 7958 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOindent = ({-# LINE 233 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIindent {-# LINE 7963 "src/GLua/AG/PrettyPrint.hs" #-} ) _tlOppconf = ({-# LINE 235 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIppconf {-# LINE 7968 "src/GLua/AG/PrettyPrint.hs" #-} ) ( _hdIcomments,_hdIcopy,_hdIexprPretty,_hdIisDefined,_hdIisMultiline,_hdIpretty,_hdIvarPretty,_hdIwouldBeAmbiguousIfNextStatementIsExprVar) = hd_ _hdOcomments _hdOindent _hdOppconf ( _tlIcomments,_tlIcopy,_tlIexprPretty,_tlIisDefined,_tlIisLastDefinedVar,_tlIisMultiline,_tlIpretty,_tlIvarPretty,_tlIwouldBeAmbiguousIfNextStatementIsExprVar) = tl_ _tlOcomments _tlOindent _tlOisHead _tlOppconf in ( _lhsOcomments,_lhsOcopy,_lhsOexprPretty,_lhsOisDefined,_lhsOisLastDefinedVar,_lhsOisMultiline,_lhsOpretty,_lhsOvarPretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar))) sem_VarsList_Nil :: T_VarsList sem_VarsList_Nil = (\ _lhsIcomments _lhsIindent _lhsIisHead _lhsIppconf -> (let _lhsOpretty :: Doc _lhsOisLastDefinedVar :: Bool _lhsOexprPretty :: Doc _lhsOisDefined :: Bool _lhsOisMultiline :: Bool _lhsOvarPretty :: Doc _lhsOwouldBeAmbiguousIfNextStatementIsExprVar :: Bool _lhsOcopy :: VarsList _lhsOcomments :: ([MToken]) _lhsOpretty = ({-# LINE 422 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 7993 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisLastDefinedVar = ({-# LINE 423 "src/GLua/AG/PrettyPrint.ag" #-} True {-# LINE 7998 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOexprPretty = ({-# LINE 256 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 8003 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisDefined = ({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 8008 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOisMultiline = ({-# LINE 234 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 8013 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOvarPretty = ({-# LINE 255 "src/GLua/AG/PrettyPrint.ag" #-} empty {-# LINE 8018 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOwouldBeAmbiguousIfNextStatementIsExprVar = ({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-} False {-# LINE 8023 "src/GLua/AG/PrettyPrint.hs" #-} ) _copy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} [] {-# LINE 8028 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcopy = ({-# LINE 236 "src/GLua/AG/PrettyPrint.ag" #-} _copy {-# LINE 8033 "src/GLua/AG/PrettyPrint.hs" #-} ) _lhsOcomments = ({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-} _lhsIcomments {-# LINE 8038 "src/GLua/AG/PrettyPrint.hs" #-} ) in ( _lhsOcomments,_lhsOcopy,_lhsOexprPretty,_lhsOisDefined,_lhsOisLastDefinedVar,_lhsOisMultiline,_lhsOpretty,_lhsOvarPretty,_lhsOwouldBeAmbiguousIfNextStatementIsExprVar)))