{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
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', isInfixOf)
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 = "<unknown>"
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
renderMLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc
renderMLComments conf ind toks = foldl' ($+$) empty . map (indent conf ind . tok . convertComment conf) $ toks
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
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'
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 (<>)
zchr :: Char -> Doc
zchr c = zeroWidthText [c]
infixl 6 <->
(<->) :: Doc -> Doc -> Doc
a <-> b | a == empty = b
| b == empty = a
| otherwise = a <> zchr ' ' <> b
data OperatorLevel
= TopLevelExpression
| OperatorLevel1
| OperatorLevel2
| OperatorLevel3
| OperatorLevel4
| OperatorLevel5
| OperatorLevel6
| OperatorLevel7
| OperatorLevel8
deriving (Eq, Ord)
commentsForceMultiline :: [MToken] -> Bool
commentsForceMultiline commentTokens = any containsFormatMultiline commentTokens
where
containsFormatMultiline :: MToken -> Bool
containsFormatMultiline (MToken _pos t) = case t of
DashComment comment -> stringForcesFormat comment
DashBlockComment _ comment -> stringForcesFormat comment
SlashComment comment -> stringForcesFormat comment
SlashBlockComment comment -> stringForcesFormat comment
_ -> False
stringForcesFormat :: String -> Bool
stringForcesFormat s = "format: multiline" `isInfixOf` s
{-# LINE 256 "src/GLua/AG/PrettyPrint.hs" #-}
{-# LINE 881 "src/GLua/AG/PrettyPrint.ag" #-}
pp_block :: Block -> Int -> Doc
pp_block p i = pretty_Syn_Block (wrap_Block (sem_Block p) (emptyInh_Block {indent_Inh_Block = i}))
pp_mstat :: MStat -> Int -> Doc
pp_mstat p i = pretty_Syn_MStat (wrap_MStat (sem_MStat p) emptyInh_MStat {indent_Inh_MStat = i})
pp_prefixexp :: PrefixExp -> Doc
pp_prefixexp p = pretty_Syn_PrefixExp (wrap_PrefixExp (sem_PrefixExp p) emptyInh_PrefixExp)
pp_pfexprsuffix :: PFExprSuffix -> Doc
pp_pfexprsuffix p = pretty_Syn_PFExprSuffix (wrap_PFExprSuffix (sem_PFExprSuffix p) emptyInh_PFExprSuffix)
pp_field :: Field -> Doc
pp_field p = pretty_Syn_Field (wrap_Field (sem_Field p) emptyInh_Field)
pp_mexpr :: MExpr -> Doc
pp_mexpr p = pretty_Syn_MExpr (wrap_MExpr (sem_MExpr p) emptyInh_MExpr)
prettyprint :: AST -> String
prettyprint p = render $ pretty_Syn_AST (wrap_AST (sem_AST p) emptyInh_AST)
prettyprintConf :: PrettyPrintConfig -> AST -> String
prettyprintConf conf p = render $ pretty_Syn_AST (wrap_AST (sem_AST p) emptyInh_AST {ppconf_Inh_AST = conf})
renderBlock :: Block -> String
renderBlock p = render $ pretty_Syn_Block (wrap_Block (sem_Block p) emptyInh_Block)
renderStat :: Stat -> String
renderStat p = render $ pretty_Syn_Stat (wrap_Stat (sem_Stat p) emptyInh_Stat)
renderMStat :: MStat -> String
renderMStat p = render $ pretty_Syn_MStat (wrap_MStat (sem_MStat p) emptyInh_MStat)
renderAReturn :: AReturn -> String
renderAReturn p = render $ pretty_Syn_AReturn (wrap_AReturn (sem_AReturn p) emptyInh_AReturn)
renderFuncName :: FuncName -> String
renderFuncName p = render $ pretty_Syn_FuncName (wrap_FuncName (sem_FuncName p) emptyInh_FuncName)
renderPrefixExp :: PrefixExp -> String
renderPrefixExp p = render $ pretty_Syn_PrefixExp (wrap_PrefixExp (sem_PrefixExp p) emptyInh_PrefixExp)
renderExpr :: Expr -> String
renderExpr p = render $ pretty_Syn_Expr (wrap_Expr (sem_Expr p) emptyInh_Expr)
renderMExpr :: MExpr -> String
renderMExpr p = render $ pretty_Syn_MExpr (wrap_MExpr (sem_MExpr p) emptyInh_MExpr)
renderArgs :: Args -> String
renderArgs p = render $ pretty_Syn_Args (wrap_Args (sem_Args p) emptyInh_Args)
renderField :: Field -> String
renderField p = render $ pretty_Syn_Field (wrap_Field (sem_Field p) emptyInh_Field)
emptyInh_Field :: Inh_Field
emptyInh_Field =
Inh_Field
{ comments_Inh_Field = []
, forceMultiline_Inh_Field = False
, indent_Inh_Field = 0
, ppconf_Inh_Field = defaultPPConfig
}
emptyInh_Args :: Inh_Args
emptyInh_Args =
Inh_Args
{ comments_Inh_Args = []
, forceMultiline_Inh_Args = False
, indent_Inh_Args = 0
, ppconf_Inh_Args = defaultPPConfig
}
emptyInh_MExpr :: Inh_MExpr
emptyInh_MExpr =
Inh_MExpr
{ comments_Inh_MExpr = []
, forceMultiline_Inh_MExpr = False
, indent_Inh_MExpr = 0
, parentOperatorAssociative_Inh_MExpr = True
, parentOperatorPrecedence_Inh_MExpr = TopLevelExpression
, ppconf_Inh_MExpr = defaultPPConfig
}
emptyInh_Expr :: Inh_Expr
emptyInh_Expr =
Inh_Expr
{ comments_Inh_Expr = []
, forceMultiline_Inh_Expr = False
, indent_Inh_Expr = 0
, parentOperatorAssociative_Inh_Expr = True
, parentOperatorPrecedence_Inh_Expr = TopLevelExpression
, ppconf_Inh_Expr = defaultPPConfig
, statRegion_Inh_Expr = emptyRg
}
emptyInh_PrefixExp :: Inh_PrefixExp
emptyInh_PrefixExp =
Inh_PrefixExp
{ comments_Inh_PrefixExp = []
, forceMultiline_Inh_PrefixExp = False
, indent_Inh_PrefixExp = 0
, parentOperatorAssociative_Inh_PrefixExp = True
, parentOperatorPrecedence_Inh_PrefixExp = TopLevelExpression
, ppconf_Inh_PrefixExp = defaultPPConfig
}
emptyInh_FuncName :: Inh_FuncName
emptyInh_FuncName =
Inh_FuncName
{ comments_Inh_FuncName = []
, indent_Inh_FuncName = 0
, ppconf_Inh_FuncName = defaultPPConfig
}
emptyInh_AReturn :: Inh_AReturn
emptyInh_AReturn =
Inh_AReturn
{ comments_Inh_AReturn = []
, forceMultiline_Inh_AReturn = False
, indent_Inh_AReturn = 0
, ppconf_Inh_AReturn = defaultPPConfig
}
emptyInh_MStat :: Inh_MStat
emptyInh_MStat =
Inh_MStat
{ comments_Inh_MStat = []
, forceMultiline_Inh_MStat = False
, indent_Inh_MStat = 0
, isLastStatement_Inh_MStat = False
, ppconf_Inh_MStat = defaultPPConfig
, wouldBeAmbiguousWithoutSemicolon_Inh_MStat = False
}
emptyInh_Stat :: Inh_Stat
emptyInh_Stat =
Inh_Stat
{ comments_Inh_Stat = []
, forceMultiline_Inh_Stat = False
, indent_Inh_Stat = 0
, isLastStatement_Inh_Stat = False
, ppconf_Inh_Stat = defaultPPConfig
, statRegion_Inh_Stat = emptyRg
, wouldBeAmbiguousWithoutSemicolon_Inh_Stat = False
}
emptyInh_Block :: Inh_Block
emptyInh_Block =
Inh_Block
{ comments_Inh_Block = []
, forceMultiline_Inh_Block = False
, indent_Inh_Block = 0
, ppconf_Inh_Block = defaultPPConfig
, statRegion_Inh_Block = emptyRg
}
emptyInh_AST :: Inh_AST
emptyInh_AST =
Inh_AST
{ indent_Inh_AST = 0
, ppconf_Inh_AST = defaultPPConfig
}
emptyInh_PFExprSuffix :: Inh_PFExprSuffix
emptyInh_PFExprSuffix =
Inh_PFExprSuffix
{ comments_Inh_PFExprSuffix = []
, forceMultiline_Inh_PFExprSuffix = False
, indent_Inh_PFExprSuffix = 0
, ppconf_Inh_PFExprSuffix = defaultPPConfig
}
{-# LINE 433 "src/GLua/AG/PrettyPrint.hs" #-}
sem_AReturn :: AReturn ->
T_AReturn
sem_AReturn :: AReturn -> T_AReturn
sem_AReturn (AReturn Region
_pos [MExpr]
_values) =
(Region -> T_MExprList -> T_AReturn
sem_AReturn_AReturn Region
_pos ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_values))
sem_AReturn (AReturn
NoReturn) =
(T_AReturn
sem_AReturn_NoReturn)
type T_AReturn = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),AReturn,Bool,Bool,Doc,Int)
data Inh_AReturn = Inh_AReturn { :: ([MToken]),Inh_AReturn -> Bool
forceMultiline_Inh_AReturn :: Bool,Inh_AReturn -> Int
indent_Inh_AReturn :: Int,Inh_AReturn -> PrettyPrintConfig
ppconf_Inh_AReturn :: PrettyPrintConfig}
data Syn_AReturn = Syn_AReturn { :: ([MToken]),Syn_AReturn -> AReturn
copy_Syn_AReturn :: AReturn,Syn_AReturn -> Bool
hasBreaking_Syn_AReturn :: Bool,Syn_AReturn -> Bool
isMultiline_Syn_AReturn :: Bool,Syn_AReturn -> Doc
pretty_Syn_AReturn :: Doc,Syn_AReturn -> Int
statementCount_Syn_AReturn :: Int}
wrap_AReturn :: T_AReturn ->
Inh_AReturn ->
Syn_AReturn
wrap_AReturn :: T_AReturn -> Inh_AReturn -> Syn_AReturn
wrap_AReturn T_AReturn
sem (Inh_AReturn [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,AReturn
_lhsOcopy,Bool
_lhsOhasBreaking,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Int
_lhsOstatementCount) = T_AReturn
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> AReturn -> Bool -> Bool -> Doc -> Int -> Syn_AReturn
Syn_AReturn [MToken]
_lhsOcomments AReturn
_lhsOcopy Bool
_lhsOhasBreaking Bool
_lhsOisMultiline Doc
_lhsOpretty Int
_lhsOstatementCount))
sem_AReturn_AReturn :: Region ->
T_MExprList ->
T_AReturn
sem_AReturn_AReturn :: Region -> T_MExprList -> T_AReturn
sem_AReturn_AReturn Region
pos_ T_MExprList
values_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_valuesOcomments :: ([MToken])
_lhsOcomments :: ([MToken])
_valuesOisHead :: Bool
_valuesOforceMultiline :: 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 :: Doc
_lhsOpretty =
({-# LINE 654 "src/GLua/AG/PrettyPrint.ag" #-}
_prettyCommentsBefore $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "return") <-> _valuesIpretty <> _semicolon <-> _prettyCommentsAfter
{-# LINE 485 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 655 "src/GLua/AG/PrettyPrint.ag" #-}
_valuesIisMultiline
{-# LINE 490 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 656 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 495 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsBefore =
({-# LINE 657 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
{-# LINE 500 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 658 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 505 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 659 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then span (\(MToken pos _) -> pos `before` pos_) _lhsIcomments else ([], _lhsIcomments)
{-# LINE 510 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 660 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then span (\(MToken pos _) -> pos `beforeOrOnLine` (rgOr _valuesIpos pos_)) (snd _commentsBefore ) else ([], snd _commentsBefore )
{-# LINE 515 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOcomments =
({-# LINE 661 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 520 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 662 "src/GLua/AG/PrettyPrint.ag" #-}
_valuesIcomments
{-# LINE 525 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOisHead =
({-# LINE 663 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 530 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOforceMultiline =
({-# LINE 667 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 535 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 668 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 540 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 545 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 303 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 550 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AReturn pos_ _valuesIcopy
{-# LINE 555 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 560 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 565 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 570 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valuesIcomments,_valuesIcopy,_valuesIisAssociative,_valuesIisMultiline,_valuesIpos,_valuesIprecedence,_valuesIpretty) =
values_ _valuesOcomments _valuesOforceMultiline _valuesOindent _valuesOisHead _valuesOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_AReturn_NoReturn :: T_AReturn
sem_AReturn_NoReturn :: T_AReturn
sem_AReturn_NoReturn =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: AReturn
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 669 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 670 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
NoReturn
{-# LINE 610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 615 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 620 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_AST :: AST ->
T_AST
sem_AST :: AST -> T_AST
sem_AST (AST [MToken]
_comments Block
_chunk) =
([MToken] -> T_Block -> T_AST
sem_AST_AST [MToken]
_comments (Block -> T_Block
sem_Block Block
_chunk))
type T_AST = Int ->
PrettyPrintConfig ->
( AST,Bool,Doc)
data Inh_AST = Inh_AST {Inh_AST -> Int
indent_Inh_AST :: Int,Inh_AST -> PrettyPrintConfig
ppconf_Inh_AST :: PrettyPrintConfig}
data Syn_AST = Syn_AST {Syn_AST -> AST
copy_Syn_AST :: AST,Syn_AST -> Bool
isMultiline_Syn_AST :: Bool,Syn_AST -> Doc
pretty_Syn_AST :: Doc}
wrap_AST :: T_AST ->
Inh_AST ->
Syn_AST
wrap_AST :: T_AST -> Inh_AST -> Syn_AST
wrap_AST T_AST
sem (Inh_AST Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( AST
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_AST
sem Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (AST -> Bool -> Doc -> Syn_AST
Syn_AST AST
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_AST_AST :: ([MToken]) ->
T_Block ->
T_AST
sem_AST_AST :: [MToken] -> T_Block -> T_AST
sem_AST_AST [MToken]
comments_ T_Block
chunk_ =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_chunkOcomments :: ([MToken])
_chunkOstatRegion :: Region
_chunkOforceMultiline :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: AST
_chunkOindent :: Int
_chunkOppconf :: PrettyPrintConfig
_chunkIcomments :: ([MToken])
_chunkIcopy :: Block
_chunkIhasBreaking :: Bool
_chunkIisMultiline :: Bool
_chunkIpretty :: Doc
_chunkIstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 530 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIpretty $+$ _prettyComments
{-# LINE 664 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyComments =
({-# LINE 531 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent _chunkIcomments
{-# LINE 669 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOcomments =
({-# LINE 532 "src/GLua/AG/PrettyPrint.ag" #-}
comments_
{-# LINE 674 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOstatRegion =
({-# LINE 533 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOforceMultiline =
({-# LINE 534 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIisMultiline
{-# LINE 689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AST comments_ _chunkIcopy
{-# LINE 694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 709 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _chunkIcomments,_chunkIcopy,_chunkIhasBreaking,_chunkIisMultiline,_chunkIpretty,_chunkIstatementCount) =
chunk_ _chunkOcomments _chunkOforceMultiline _chunkOindent _chunkOppconf _chunkOstatRegion
in ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args :: Args ->
T_Args
sem_Args :: Args -> T_Args
sem_Args (ListArgs [MExpr]
_args) =
(T_MExprList -> T_Args
sem_Args_ListArgs ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_args))
sem_Args (TableArg FieldList
_arg) =
(T_FieldList -> T_Args
sem_Args_TableArg (FieldList -> T_FieldList
sem_FieldList FieldList
_arg))
sem_Args (StringArg MToken
_arg) =
(MToken -> T_Args
sem_Args_StringArg MToken
_arg)
type T_Args = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Args,Bool,Doc)
data Inh_Args = Inh_Args { :: ([MToken]),Inh_Args -> Bool
forceMultiline_Inh_Args :: Bool,Inh_Args -> Int
indent_Inh_Args :: Int,Inh_Args -> PrettyPrintConfig
ppconf_Inh_Args :: PrettyPrintConfig}
data Syn_Args = Syn_Args { :: ([MToken]),Syn_Args -> Args
copy_Syn_Args :: Args,Syn_Args -> Bool
isMultiline_Syn_Args :: Bool,Syn_Args -> Doc
pretty_Syn_Args :: Doc}
wrap_Args :: T_Args ->
Inh_Args ->
Syn_Args
wrap_Args :: T_Args -> Inh_Args -> Syn_Args
wrap_Args T_Args
sem (Inh_Args [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,Args
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_Args
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> Args -> Bool -> Doc -> Syn_Args
Syn_Args [MToken]
_lhsOcomments Args
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_Args_ListArgs :: T_MExprList ->
T_Args
sem_Args_ListArgs :: T_MExprList -> T_Args
sem_Args_ListArgs T_MExprList
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_argsOisHead :: Bool
_argsOindent :: Int
_lhsOisMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: MExprList
_argsIisAssociative :: Bool
_argsIisMultiline :: Bool
_argsIpos :: Region
_argsIprecedence :: OperatorLevel
_argsIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 782 "src/GLua/AG/PrettyPrint.ag" #-}
if _argsIisMultiline then
zchr '(' $+$
indent _lhsIppconf (_lhsIindent + 1) _argsIpretty $+$
indent _lhsIppconf _lhsIindent (zchr ')')
else
parens _lhsIppconf _emptyParams _argsIpretty
{-# LINE 769 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 789 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argsIcopy
{-# LINE 774 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOisHead =
({-# LINE 790 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 779 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 791 "src/GLua/AG/PrettyPrint.ag" #-}
if _argsIisMultiline then _lhsIindent + 1 else 0
{-# LINE 784 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 789 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ListArgs _argsIcopy
{-# LINE 794 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 799 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 804 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 809 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 814 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 819 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisAssociative,_argsIisMultiline,_argsIpos,_argsIprecedence,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOisHead _argsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args_TableArg :: T_FieldList ->
T_Args
sem_Args_TableArg :: T_FieldList -> T_Args
sem_Args_TableArg T_FieldList
arg_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_argOindent :: Int
_lhsOisMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_argOcomments :: ([MToken])
_argOforceMultiline :: Bool
_argOppconf :: PrettyPrintConfig
_argIcanFitOnSameLine :: Bool
_argIcomments :: ([MToken])
_argIcopy :: FieldList
_argIisMultiline :: Bool
_argIisNil :: Bool
_argIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 792 "src/GLua/AG/PrettyPrint.ag" #-}
if _argIisMultiline then _prettyMulti else _prettySingle
{-# LINE 848 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 793 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ indent _lhsIppconf (_lhsIindent + 1) _argIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 853 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 794 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _argIpretty
{-# LINE 858 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 795 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argIcopy
{-# LINE 863 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOindent =
({-# LINE 796 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _argIisMultiline then 1 else 0)
{-# LINE 868 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_argIisMultiline
{-# LINE 873 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
TableArg _argIcopy
{-# LINE 878 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 883 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_argIcomments
{-# LINE 888 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 893 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 898 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 903 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argIcanFitOnSameLine,_argIcomments,_argIcopy,_argIisMultiline,_argIisNil,_argIpretty) =
arg_ _argOcomments _argOforceMultiline _argOindent _argOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args_StringArg :: MToken ->
T_Args
sem_Args_StringArg :: MToken -> T_Args
sem_Args_StringArg MToken
arg_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 797 "src/GLua/AG/PrettyPrint.ag" #-}
tok arg_
{-# LINE 922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
StringArg arg_
{-# LINE 932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 942 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_BinOp :: BinOp ->
T_BinOp
sem_BinOp :: BinOp -> T_BinOp
sem_BinOp (BinOp
AOr) =
(T_BinOp
sem_BinOp_AOr)
sem_BinOp (BinOp
AAnd) =
(T_BinOp
sem_BinOp_AAnd)
sem_BinOp (BinOp
ALT) =
(T_BinOp
sem_BinOp_ALT)
sem_BinOp (BinOp
AGT) =
(T_BinOp
sem_BinOp_AGT)
sem_BinOp (BinOp
ALEQ) =
(T_BinOp
sem_BinOp_ALEQ)
sem_BinOp (BinOp
AGEQ) =
(T_BinOp
sem_BinOp_AGEQ)
sem_BinOp (BinOp
ANEq) =
(T_BinOp
sem_BinOp_ANEq)
sem_BinOp (BinOp
AEq) =
(T_BinOp
sem_BinOp_AEq)
sem_BinOp (BinOp
AConcatenate) =
(T_BinOp
sem_BinOp_AConcatenate)
sem_BinOp (BinOp
APlus) =
(T_BinOp
sem_BinOp_APlus)
sem_BinOp (BinOp
BinMinus) =
(T_BinOp
sem_BinOp_BinMinus)
sem_BinOp (BinOp
AMultiply) =
(T_BinOp
sem_BinOp_AMultiply)
sem_BinOp (BinOp
ADivide) =
(T_BinOp
sem_BinOp_ADivide)
sem_BinOp (BinOp
AModulus) =
(T_BinOp
sem_BinOp_AModulus)
sem_BinOp (BinOp
APower) =
(T_BinOp
sem_BinOp_APower)
type T_BinOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),BinOp,Bool,Bool,OperatorLevel,Doc)
data Inh_BinOp = Inh_BinOp { :: ([MToken]),Inh_BinOp -> Int
indent_Inh_BinOp :: Int,Inh_BinOp -> PrettyPrintConfig
ppconf_Inh_BinOp :: PrettyPrintConfig}
data Syn_BinOp = Syn_BinOp { :: ([MToken]),Syn_BinOp -> BinOp
copy_Syn_BinOp :: BinOp,Syn_BinOp -> Bool
isAssociative_Syn_BinOp :: Bool,Syn_BinOp -> Bool
isMultiline_Syn_BinOp :: Bool,Syn_BinOp -> OperatorLevel
precedence_Syn_BinOp :: OperatorLevel,Syn_BinOp -> Doc
pretty_Syn_BinOp :: Doc}
wrap_BinOp :: T_BinOp ->
Inh_BinOp ->
Syn_BinOp
wrap_BinOp :: T_BinOp -> Inh_BinOp -> Syn_BinOp
wrap_BinOp T_BinOp
sem (Inh_BinOp [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,BinOp
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_BinOp
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> BinOp -> Bool -> Bool -> OperatorLevel -> Doc -> Syn_BinOp
Syn_BinOp [MToken]
_lhsOcomments BinOp
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_BinOp_AOr :: T_BinOp
sem_BinOp_AOr :: T_BinOp
sem_BinOp_AOr =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 872 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "||" else "or")
{-# LINE 1006 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 873 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel1
{-# LINE 1011 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 874 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1016 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1021 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AOr
{-# LINE 1026 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1031 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1036 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AAnd :: T_BinOp
sem_BinOp_AAnd :: T_BinOp
sem_BinOp_AAnd =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 869 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "&&" else "and")
{-# LINE 1053 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 870 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel2
{-# LINE 1058 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 871 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1063 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1068 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AAnd
{-# LINE 1073 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1078 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1083 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALT :: T_BinOp
sem_BinOp_ALT :: T_BinOp
sem_BinOp_ALT =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 851 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<"
{-# LINE 1100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 852 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 853 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ALT
{-# LINE 1120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1130 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGT :: T_BinOp
sem_BinOp_AGT :: T_BinOp
sem_BinOp_AGT =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 857 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">"
{-# LINE 1147 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 858 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1152 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 859 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1157 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1162 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AGT
{-# LINE 1167 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1172 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1177 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALEQ :: T_BinOp
sem_BinOp_ALEQ :: T_BinOp
sem_BinOp_ALEQ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 854 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<="
{-# LINE 1194 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 855 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1199 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 856 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1204 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1209 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ALEQ
{-# LINE 1214 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1219 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1224 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGEQ :: T_BinOp
sem_BinOp_AGEQ :: T_BinOp
sem_BinOp_AGEQ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 860 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">="
{-# LINE 1241 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 861 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 862 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AGEQ
{-# LINE 1261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1271 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ANEq :: T_BinOp
sem_BinOp_ANEq :: T_BinOp
sem_BinOp_ANEq =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 866 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!=" else "~=")
{-# LINE 1288 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 867 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1293 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 868 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1298 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1303 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ANEq
{-# LINE 1308 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1313 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1318 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AEq :: T_BinOp
sem_BinOp_AEq :: T_BinOp
sem_BinOp_AEq =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 863 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "=="
{-# LINE 1335 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 864 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 865 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AEq
{-# LINE 1355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1365 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AConcatenate :: T_BinOp
sem_BinOp_AConcatenate :: T_BinOp
sem_BinOp_AConcatenate =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 848 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ".."
{-# LINE 1382 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 849 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel4
{-# LINE 1387 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 850 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1392 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1397 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AConcatenate
{-# LINE 1402 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1412 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APlus :: T_BinOp
sem_BinOp_APlus :: T_BinOp
sem_BinOp_APlus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 830 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "+"
{-# LINE 1429 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 831 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1434 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 832 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1439 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1444 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
APlus
{-# LINE 1449 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1454 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1459 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_BinMinus :: T_BinOp
sem_BinOp_BinMinus :: T_BinOp
sem_BinOp_BinMinus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 833 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 1476 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 834 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1481 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 835 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1486 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1491 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
BinMinus
{-# LINE 1496 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1501 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1506 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AMultiply :: T_BinOp
sem_BinOp_AMultiply :: T_BinOp
sem_BinOp_AMultiply =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 836 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "*"
{-# LINE 1523 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 837 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1528 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 838 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1533 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1538 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AMultiply
{-# LINE 1543 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1548 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1553 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ADivide :: T_BinOp
sem_BinOp_ADivide :: T_BinOp
sem_BinOp_ADivide =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 839 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "/"
{-# LINE 1570 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 840 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1575 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 841 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1580 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ADivide
{-# LINE 1590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1600 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AModulus :: T_BinOp
sem_BinOp_AModulus :: T_BinOp
sem_BinOp_AModulus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 842 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "%"
{-# LINE 1617 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 843 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1622 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 844 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1627 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1632 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AModulus
{-# LINE 1637 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1642 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1647 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APower :: T_BinOp
sem_BinOp_APower :: T_BinOp
sem_BinOp_APower =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 845 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "^"
{-# LINE 1664 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 846 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 1669 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 847 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1674 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
APower
{-# LINE 1684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1694 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Block :: Block ->
T_Block
sem_Block :: Block -> T_Block
sem_Block (Block [MStat]
_stats AReturn
_ret) =
(T_MStatList -> T_AReturn -> T_Block
sem_Block_Block ([MStat] -> T_MStatList
sem_MStatList [MStat]
_stats) (AReturn -> T_AReturn
sem_AReturn AReturn
_ret))
type T_Block = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Block,Bool,Bool,Doc,Int)
data Inh_Block = Inh_Block { :: ([MToken]),Inh_Block -> Bool
forceMultiline_Inh_Block :: Bool,Inh_Block -> Int
indent_Inh_Block :: Int,Inh_Block -> PrettyPrintConfig
ppconf_Inh_Block :: PrettyPrintConfig,Inh_Block -> Region
statRegion_Inh_Block :: Region}
data Syn_Block = Syn_Block { :: ([MToken]),Syn_Block -> Block
copy_Syn_Block :: Block,Syn_Block -> Bool
hasBreaking_Syn_Block :: Bool,Syn_Block -> Bool
isMultiline_Syn_Block :: Bool,Syn_Block -> Doc
pretty_Syn_Block :: Doc,Syn_Block -> Int
statementCount_Syn_Block :: Int}
wrap_Block :: T_Block ->
Inh_Block ->
Syn_Block
wrap_Block :: T_Block -> Inh_Block -> Syn_Block
wrap_Block T_Block
sem (Inh_Block [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Block
_lhsOcopy,Bool
_lhsOhasBreaking,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Int
_lhsOstatementCount) = T_Block
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken] -> Block -> Bool -> Bool -> Doc -> Int -> Syn_Block
Syn_Block [MToken]
_lhsOcomments Block
_lhsOcopy Bool
_lhsOhasBreaking Bool
_lhsOisMultiline Doc
_lhsOpretty Int
_lhsOstatementCount))
sem_Block_Block :: T_MStatList ->
T_AReturn ->
T_Block
sem_Block_Block :: T_MStatList -> T_AReturn -> T_Block
sem_Block_Block T_MStatList
stats_ T_AReturn
ret_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_statsOisHead :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOstatementCount :: Int
_lhsOcopy :: Block
_lhsOcomments :: ([MToken])
_statsOcomments :: ([MToken])
_statsOforceMultiline :: Bool
_statsOindent :: Int
_statsOppconf :: PrettyPrintConfig
_statsOstatRegion :: Region
_retOcomments :: ([MToken])
_retOforceMultiline :: Bool
_retOindent :: Int
_retOppconf :: PrettyPrintConfig
_statsIcomments :: ([MToken])
_statsIcopy :: MStatList
_statsIhasBreaking :: Bool
_statsIisLast :: Bool
_statsIisMultiline :: Bool
_statsIpretty :: Doc
_statsIstartsWithExprPrefixExpression :: Bool
_statsIstatementCount :: Int
_retIcomments :: ([MToken])
_retIcopy :: AReturn
_retIhasBreaking :: Bool
_retIisMultiline :: Bool
_retIpretty :: Doc
_retIstatementCount :: Int
_newl :: Doc
_newl =
({-# LINE 537 "src/GLua/AG/PrettyPrint.ag" #-}
if _statsIstatementCount > 0 && _retIhasBreaking then zchr '\n' else empty
{-# LINE 1760 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 538 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIpretty <> _newl $+$ _retIpretty
{-# LINE 1765 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOisHead =
({-# LINE 539 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1770 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIhasBreaking || _retIhasBreaking
{-# LINE 1775 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIisMultiline || _retIisMultiline
{-# LINE 1780 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 303 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIstatementCount + _retIstatementCount
{-# LINE 1785 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Block _statsIcopy _retIcopy
{-# LINE 1790 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1795 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_retIcomments
{-# LINE 1800 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1805 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1810 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1815 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1820 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 1825 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIcomments
{-# LINE 1830 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1835 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1840 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1845 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _statsIcomments,_statsIcopy,_statsIhasBreaking,_statsIisLast,_statsIisMultiline,_statsIpretty,_statsIstartsWithExprPrefixExpression,_statsIstatementCount) =
stats_ _statsOcomments _statsOforceMultiline _statsOindent _statsOisHead _statsOppconf _statsOstatRegion
( _retIcomments,_retIcopy,_retIhasBreaking,_retIisMultiline,_retIpretty,_retIstatementCount) =
ret_ _retOcomments _retOforceMultiline _retOindent _retOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_Declaration :: Declaration ->
T_Declaration
sem_Declaration :: (PrefixExp, Maybe MExpr) -> T_Declaration
sem_Declaration ( PrefixExp
x1,Maybe MExpr
x2) =
(T_PrefixExp -> T_MaybeMExpr -> T_Declaration
sem_Declaration_Tuple (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
x1) (Maybe MExpr -> T_MaybeMExpr
sem_MaybeMExpr Maybe MExpr
x2))
type T_Declaration = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Declaration,Bool,Doc,Bool,Bool,Doc,Bool,Doc)
data Inh_Declaration = Inh_Declaration { :: ([MToken]),Inh_Declaration -> Bool
forceMultiline_Inh_Declaration :: Bool,Inh_Declaration -> Int
indent_Inh_Declaration :: Int,Inh_Declaration -> PrettyPrintConfig
ppconf_Inh_Declaration :: PrettyPrintConfig}
data Syn_Declaration = Syn_Declaration { :: ([MToken]),Syn_Declaration -> (PrefixExp, Maybe MExpr)
copy_Syn_Declaration :: Declaration,Syn_Declaration -> Bool
endsWithPrefixExpression_Syn_Declaration :: Bool,Syn_Declaration -> Doc
exprPretty_Syn_Declaration :: Doc,Syn_Declaration -> Bool
isDefined_Syn_Declaration :: Bool,Syn_Declaration -> Bool
isMultiline_Syn_Declaration :: Bool,Syn_Declaration -> Doc
pretty_Syn_Declaration :: Doc,Syn_Declaration -> Bool
startsWithExprPrefixExpression_Syn_Declaration :: Bool,Syn_Declaration -> Doc
varPretty_Syn_Declaration :: Doc}
wrap_Declaration :: T_Declaration ->
Inh_Declaration ->
Syn_Declaration
wrap_Declaration :: T_Declaration -> Inh_Declaration -> Syn_Declaration
wrap_Declaration T_Declaration
sem (Inh_Declaration [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,(PrefixExp, Maybe MExpr)
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Doc
_lhsOexprPretty,Bool
_lhsOisDefined,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Doc
_lhsOvarPretty) = T_Declaration
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> (PrefixExp, Maybe MExpr)
-> Bool
-> Doc
-> Bool
-> Bool
-> Doc
-> Bool
-> Doc
-> Syn_Declaration
Syn_Declaration [MToken]
_lhsOcomments (PrefixExp, Maybe MExpr)
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Doc
_lhsOexprPretty Bool
_lhsOisDefined Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Doc
_lhsOvarPretty))
sem_Declaration_Tuple :: T_PrefixExp ->
T_MaybeMExpr ->
T_Declaration
sem_Declaration_Tuple :: T_PrefixExp -> T_MaybeMExpr -> T_Declaration
sem_Declaration_Tuple T_PrefixExp
x1_ T_MaybeMExpr
x2_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOvarPretty :: Doc
_lhsOexprPretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_x1OparentOperatorPrecedence :: OperatorLevel
_x1OparentOperatorAssociative :: Bool
_lhsOisDefined :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Declaration
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_x1Ocomments :: ([MToken])
_x1OforceMultiline :: Bool
_x1Oindent :: Int
_x1Oppconf :: PrettyPrintConfig
_x2Ocomments :: ([MToken])
_x2OforceMultiline :: Bool
_x2Oindent :: Int
_x2Oppconf :: PrettyPrintConfig
_x1Icomments :: ([MToken])
_x1Icopy :: PrefixExp
_x1IisAssociative :: Bool
_x1IisLiteral :: Bool
_x1IisMultiline :: Bool
_x1Iprecedence :: OperatorLevel
_x1Ipretty :: Doc
_x1IstartsWithExprPrefixExpression :: Bool
_x2Icomments :: ([MToken])
_x2Icopy :: MaybeMExpr
_x2IendsWithPrefixExpression :: Bool
_x2IisAssociative :: Bool
_x2IisDefined :: Bool
_x2IisMultiline :: Bool
_x2Iprecedence :: OperatorLevel
_x2Ipretty :: Doc
_lhsOvarPretty :: Doc
_lhsOvarPretty =
({-# LINE 468 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Ipretty
{-# LINE 1918 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 469 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1923 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 470 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IstartsWithExprPrefixExpression
{-# LINE 1928 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 471 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IendsWithPrefixExpression
{-# LINE 1933 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 472 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 1938 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 473 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1943 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IisDefined
{-# LINE 1948 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 1953 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 1958 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1963 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 1968 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 248 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1973 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1978 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1983 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1988 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1993 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 1998 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2003 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2008 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2013 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _x1Icomments,_x1Icopy,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Iprecedence,_x1Ipretty,_x1IstartsWithExprPrefixExpression) =
x1_ _x1Ocomments _x1OforceMultiline _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf
( _x2Icomments,_x2Icopy,_x2IendsWithPrefixExpression,_x2IisAssociative,_x2IisDefined,_x2IisMultiline,_x2Iprecedence,_x2Ipretty) =
x2_ _x2Ocomments _x2OforceMultiline _x2Oindent _x2Oppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))
sem_Else :: Else ->
T_Else
sem_Else :: Maybe MElse -> T_Else
sem_Else (Prelude.Just MElse
x) =
(T_MElse -> T_Else
sem_Else_Just (MElse -> T_MElse
sem_MElse MElse
x))
sem_Else Maybe MElse
Prelude.Nothing =
T_Else
sem_Else_Nothing
type T_Else = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Else,Bool,Bool,Region,Doc)
data Inh_Else = Inh_Else { :: ([MToken]),Inh_Else -> Bool
forceMultiline_Inh_Else :: Bool,Inh_Else -> Int
indent_Inh_Else :: Int,Inh_Else -> PrettyPrintConfig
ppconf_Inh_Else :: PrettyPrintConfig,Inh_Else -> Region
statRegion_Inh_Else :: Region}
data Syn_Else = Syn_Else { :: ([MToken]),Syn_Else -> Maybe MElse
copy_Syn_Else :: Else,Syn_Else -> Bool
elsesExist_Syn_Else :: Bool,Syn_Else -> Bool
isMultiline_Syn_Else :: Bool,Syn_Else -> Region
pos_Syn_Else :: Region,Syn_Else -> Doc
pretty_Syn_Else :: Doc}
wrap_Else :: T_Else ->
Inh_Else ->
Syn_Else
wrap_Else :: T_Else -> Inh_Else -> Syn_Else
wrap_Else T_Else
sem (Inh_Else [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Maybe MElse
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_Else
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> Maybe MElse -> Bool -> Bool -> Region -> Doc -> Syn_Else
Syn_Else [MToken]
_lhsOcomments Maybe MElse
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_Else_Just :: T_MElse ->
T_Else
sem_Else_Just :: T_MElse -> T_Else
sem_Else_Just T_MElse
just_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOelsesExist :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Else
_lhsOcomments :: ([MToken])
_lhsOpos :: Region
_lhsOpretty :: Doc
_justOcomments :: ([MToken])
_justOforceMultiline :: Bool
_justOindent :: Int
_justOppconf :: PrettyPrintConfig
_justOstatRegion :: Region
_justIcomments :: ([MToken])
_justIcopy :: MElse
_justIelsesExist :: Bool
_justIisMultiline :: Bool
_justIpos :: Region
_justIpretty :: Doc
_lhsOelsesExist :: Bool
_lhsOelsesExist =
({-# LINE 513 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2071 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 2076 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 2081 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2086 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 2091 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpos
{-# LINE 2096 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 248 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 2101 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2106 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2111 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2116 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2121 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 2126 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _justIcomments,_justIcopy,_justIelsesExist,_justIisMultiline,_justIpos,_justIpretty) =
just_ _justOcomments _justOforceMultiline _justOindent _justOppconf _justOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_Else_Nothing :: T_Else
sem_Else_Nothing :: T_Else
sem_Else_Nothing =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOelsesExist :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Else
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 514 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2147 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 515 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2152 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 309 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2157 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2162 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 2167 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2172 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2177 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_ElseIf :: ElseIf ->
T_ElseIf
sem_ElseIf :: (MExpr, Block) -> T_ElseIf
sem_ElseIf ( MExpr
x1,Block
x2) =
(T_MExpr -> T_Block -> T_ElseIf
sem_ElseIf_Tuple (MExpr -> T_MExpr
sem_MExpr MExpr
x1) (Block -> T_Block
sem_Block Block
x2))
type T_ElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIf,Bool,Doc)
data Inh_ElseIf = Inh_ElseIf { :: ([MToken]),Inh_ElseIf -> Bool
forceMultiline_Inh_ElseIf :: Bool,Inh_ElseIf -> Int
indent_Inh_ElseIf :: Int,Inh_ElseIf -> PrettyPrintConfig
ppconf_Inh_ElseIf :: PrettyPrintConfig}
data Syn_ElseIf = Syn_ElseIf { :: ([MToken]),Syn_ElseIf -> (MExpr, Block)
copy_Syn_ElseIf :: ElseIf,Syn_ElseIf -> Bool
isMultiline_Syn_ElseIf :: Bool,Syn_ElseIf -> Doc
pretty_Syn_ElseIf :: Doc}
wrap_ElseIf :: T_ElseIf ->
Inh_ElseIf ->
Syn_ElseIf
wrap_ElseIf :: T_ElseIf -> Inh_ElseIf -> Syn_ElseIf
wrap_ElseIf T_ElseIf
sem (Inh_ElseIf [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,(MExpr, Block)
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_ElseIf
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> (MExpr, Block) -> Bool -> Doc -> Syn_ElseIf
Syn_ElseIf [MToken]
_lhsOcomments (MExpr, Block)
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_ElseIf_Tuple :: T_MExpr ->
T_Block ->
T_ElseIf
sem_ElseIf_Tuple :: T_MExpr -> T_Block -> T_ElseIf
sem_ElseIf_Tuple T_MExpr
x1_ T_Block
x2_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_x2Oindent :: Int
_x2OstatRegion :: Region
_x1OparentOperatorPrecedence :: OperatorLevel
_x1OparentOperatorAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: ElseIf
_lhsOcomments :: ([MToken])
_x1Ocomments :: ([MToken])
_x1OforceMultiline :: Bool
_x1Oindent :: Int
_x1Oppconf :: PrettyPrintConfig
_x2Ocomments :: ([MToken])
_x2OforceMultiline :: Bool
_x2Oppconf :: PrettyPrintConfig
_x1Icomments :: ([MToken])
_x1Icopy :: MExpr
_x1IendsWithPrefixExpression :: Bool
_x1IisAssociative :: Bool
_x1IisLiteral :: Bool
_x1IisMultiline :: Bool
_x1Ipos :: Region
_x1Iprecedence :: OperatorLevel
_x1Ipretty :: Doc
_x2Icomments :: ([MToken])
_x2Icopy :: Block
_x2IhasBreaking :: Bool
_x2IisMultiline :: Bool
_x2Ipretty :: Doc
_x2IstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 496 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "elseif" <-> _x1Ipretty <-> zeroWidthText "then" $+$ _x2Ipretty
{-# LINE 2241 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 497 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 2246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OstatRegion =
({-# LINE 498 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 499 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 2256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 500 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 2266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 2271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2276 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 2281 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2286 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2291 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2296 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2301 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 2306 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2311 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2316 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _x1Icomments,_x1Icopy,_x1IendsWithPrefixExpression,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Ipos,_x1Iprecedence,_x1Ipretty) =
x1_ _x1Ocomments _x1OforceMultiline _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf
( _x2Icomments,_x2Icopy,_x2IhasBreaking,_x2IisMultiline,_x2Ipretty,_x2IstatementCount) =
x2_ _x2Ocomments _x2OforceMultiline _x2Oindent _x2Oppconf _x2OstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_ElseIfList :: ElseIfList ->
T_ElseIfList
sem_ElseIfList :: [MElseIf] -> T_ElseIfList
sem_ElseIfList [MElseIf]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MElseIf -> T_ElseIfList -> T_ElseIfList
sem_ElseIfList_Cons T_ElseIfList
sem_ElseIfList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MElseIf -> T_MElseIf
sem_MElseIf [MElseIf]
list))
type T_ElseIfList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIfList,Bool,Bool,Region,Doc)
data Inh_ElseIfList = Inh_ElseIfList { :: ([MToken]),Inh_ElseIfList -> Bool
forceMultiline_Inh_ElseIfList :: Bool,Inh_ElseIfList -> Int
indent_Inh_ElseIfList :: Int,Inh_ElseIfList -> PrettyPrintConfig
ppconf_Inh_ElseIfList :: PrettyPrintConfig}
data Syn_ElseIfList = Syn_ElseIfList { :: ([MToken]),Syn_ElseIfList -> [MElseIf]
copy_Syn_ElseIfList :: ElseIfList,Syn_ElseIfList -> Bool
elsesExist_Syn_ElseIfList :: Bool,Syn_ElseIfList -> Bool
isMultiline_Syn_ElseIfList :: Bool,Syn_ElseIfList -> Region
pos_Syn_ElseIfList :: Region,Syn_ElseIfList -> Doc
pretty_Syn_ElseIfList :: Doc}
wrap_ElseIfList :: T_ElseIfList ->
Inh_ElseIfList ->
Syn_ElseIfList
wrap_ElseIfList :: T_ElseIfList -> Inh_ElseIfList -> Syn_ElseIfList
wrap_ElseIfList T_ElseIfList
sem (Inh_ElseIfList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,[MElseIf]
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_ElseIfList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> [MElseIf] -> Bool -> Bool -> Region -> Doc -> Syn_ElseIfList
Syn_ElseIfList [MToken]
_lhsOcomments [MElseIf]
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_ElseIfList_Cons :: T_MElseIf ->
T_ElseIfList ->
T_ElseIfList
sem_ElseIfList_Cons :: T_MElseIf -> T_ElseIfList -> T_ElseIfList
sem_ElseIfList_Cons T_MElseIf
hd_ T_ElseIfList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOelsesExist :: Bool
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOcopy :: ElseIfList
_lhsOcomments :: ([MToken])
_hdOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 506 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent _hdIpretty $+$ _tlIpretty
{-# LINE 2379 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 507 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2384 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 508 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 2389 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 2394 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 2399 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2404 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 2409 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2414 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2419 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2424 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2429 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 2434 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2439 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2444 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2449 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIisMultiline,_hdIpos,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIelsesExist,_tlIisMultiline,_tlIpos,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_ElseIfList_Nil :: T_ElseIfList
sem_ElseIfList_Nil :: T_ElseIfList
sem_ElseIfList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOelsesExist :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: ElseIfList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 509 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2471 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 510 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2476 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 309 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2481 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2486 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 2491 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2496 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2501 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_Expr :: Expr ->
T_Expr
sem_Expr :: Expr -> T_Expr
sem_Expr (Expr
ANil) =
(T_Expr
sem_Expr_ANil)
sem_Expr (Expr
AFalse) =
(T_Expr
sem_Expr_AFalse)
sem_Expr (Expr
ATrue) =
(T_Expr
sem_Expr_ATrue)
sem_Expr (ANumber String
_num) =
(String -> T_Expr
sem_Expr_ANumber String
_num)
sem_Expr (AString MToken
_str) =
(MToken -> T_Expr
sem_Expr_AString MToken
_str)
sem_Expr (Expr
AVarArg) =
(T_Expr
sem_Expr_AVarArg)
sem_Expr (AnonymousFunc [MToken]
_pars Block
_body) =
([MToken] -> T_Block -> T_Expr
sem_Expr_AnonymousFunc [MToken]
_pars (Block -> T_Block
sem_Block Block
_body))
sem_Expr (APrefixExpr PrefixExp
_pexpr) =
(T_PrefixExp -> T_Expr
sem_Expr_APrefixExpr (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
_pexpr))
sem_Expr (ATableConstructor FieldList
_fields) =
(T_FieldList -> T_Expr
sem_Expr_ATableConstructor (FieldList -> T_FieldList
sem_FieldList FieldList
_fields))
sem_Expr (BinOpExpr BinOp
_op MExpr
_left MExpr
_right) =
(T_BinOp -> T_MExpr -> T_MExpr -> T_Expr
sem_Expr_BinOpExpr (BinOp -> T_BinOp
sem_BinOp BinOp
_op) (MExpr -> T_MExpr
sem_MExpr MExpr
_left) (MExpr -> T_MExpr
sem_MExpr MExpr
_right))
sem_Expr (UnOpExpr UnOp
_op MExpr
_right) =
(T_UnOp -> T_MExpr -> T_Expr
sem_Expr_UnOpExpr (UnOp -> T_UnOp
sem_UnOp UnOp
_op) (MExpr -> T_MExpr
sem_MExpr MExpr
_right))
type T_Expr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Expr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_Expr = Inh_Expr { :: ([MToken]),Inh_Expr -> Bool
forceMultiline_Inh_Expr :: Bool,Inh_Expr -> Int
indent_Inh_Expr :: Int,Inh_Expr -> Bool
parentOperatorAssociative_Inh_Expr :: Bool,Inh_Expr -> OperatorLevel
parentOperatorPrecedence_Inh_Expr :: OperatorLevel,Inh_Expr -> PrettyPrintConfig
ppconf_Inh_Expr :: PrettyPrintConfig,Inh_Expr -> Region
statRegion_Inh_Expr :: Region}
data Syn_Expr = Syn_Expr { :: ([MToken]),Syn_Expr -> Expr
copy_Syn_Expr :: Expr,Syn_Expr -> Bool
endsWithPrefixExpression_Syn_Expr :: Bool,Syn_Expr -> Bool
isAssociative_Syn_Expr :: Bool,Syn_Expr -> Bool
isLiteral_Syn_Expr :: Bool,Syn_Expr -> Bool
isMultiline_Syn_Expr :: Bool,Syn_Expr -> OperatorLevel
precedence_Syn_Expr :: OperatorLevel,Syn_Expr -> Doc
pretty_Syn_Expr :: Doc}
wrap_Expr :: T_Expr ->
Inh_Expr ->
Syn_Expr
wrap_Expr :: T_Expr -> Inh_Expr -> Syn_Expr
wrap_Expr T_Expr
sem (Inh_Expr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Expr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_Expr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> Expr
-> Bool
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_Expr
Syn_Expr [MToken]
_lhsOcomments Expr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_Expr_ANil :: T_Expr
sem_Expr_ANil :: T_Expr
sem_Expr_ANil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 730 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "nil"
{-# LINE 2567 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 731 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2572 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 732 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2577 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2582 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2587 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2592 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ANil
{-# LINE 2597 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2602 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2607 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AFalse :: T_Expr
sem_Expr_AFalse :: T_Expr
sem_Expr_AFalse =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 733 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "false"
{-# LINE 2630 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 734 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2635 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 735 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2640 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2645 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2650 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2655 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AFalse
{-# LINE 2660 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2665 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2670 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ATrue :: T_Expr
sem_Expr_ATrue :: T_Expr
sem_Expr_ATrue =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 736 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "true"
{-# LINE 2693 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 737 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2698 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 738 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2703 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2708 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2713 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2718 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ATrue
{-# LINE 2723 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2728 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2733 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ANumber :: String ->
T_Expr
sem_Expr_ANumber :: String -> T_Expr
sem_Expr_ANumber String
num_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 739 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText num_
{-# LINE 2757 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 740 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2762 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 741 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2767 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2772 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2777 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2782 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ANumber num_
{-# LINE 2787 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2792 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2797 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AString :: MToken ->
T_Expr
sem_Expr_AString :: MToken -> T_Expr
sem_Expr_AString MToken
str_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 742 "src/GLua/AG/PrettyPrint.ag" #-}
tok str_
{-# LINE 2821 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 743 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2826 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 744 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2831 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2836 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2841 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2846 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AString str_
{-# LINE 2851 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2856 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2861 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AVarArg :: T_Expr
sem_Expr_AVarArg :: T_Expr
sem_Expr_AVarArg =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 745 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "..."
{-# LINE 2884 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 746 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2889 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 747 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2894 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2899 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2904 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2909 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AVarArg
{-# LINE 2914 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2919 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2924 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AnonymousFunc :: ([MToken]) ->
T_Block ->
T_Expr
sem_Expr_AnonymousFunc :: [MToken] -> T_Block -> T_Expr
sem_Expr_AnonymousFunc [MToken]
pars_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_isMultiline :: Bool
_isMultiline =
({-# LINE 748 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _bodyIisMultiline || _bodyIstatementCount > 1 || (_bodyIstatementCount == 1 && not _bodyIhasBreaking)
{-# LINE 2960 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 749 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2965 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 750 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function" <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_) <-> _bodyIpretty <-> zeroWidthText "end"
{-# LINE 2970 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 751 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function" <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 2975 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 752 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 2980 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 753 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null pars_
{-# LINE 2985 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 754 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 2990 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 755 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 2995 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3000 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 262 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3005 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3010 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3015 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AnonymousFunc pars_ _bodyIcopy
{-# LINE 3020 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3025 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 3030 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3035 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3040 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3045 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 3050 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_APrefixExpr :: T_PrefixExp ->
T_Expr
sem_Expr_APrefixExpr :: T_PrefixExp -> T_Expr
sem_Expr_APrefixExpr T_PrefixExp
pexpr_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_pexprOcomments :: ([MToken])
_pexprOforceMultiline :: Bool
_pexprOindent :: Int
_pexprOparentOperatorAssociative :: Bool
_pexprOparentOperatorPrecedence :: OperatorLevel
_pexprOppconf :: PrettyPrintConfig
_pexprIcomments :: ([MToken])
_pexprIcopy :: PrefixExp
_pexprIisAssociative :: Bool
_pexprIisLiteral :: Bool
_pexprIisMultiline :: Bool
_pexprIprecedence :: OperatorLevel
_pexprIpretty :: Doc
_pexprIstartsWithExprPrefixExpression :: Bool
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 756 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIpretty
{-# LINE 3090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 757 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisAssociative
{-# LINE 3100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 262 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisLiteral
{-# LINE 3105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisMultiline
{-# LINE 3110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIprecedence
{-# LINE 3115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
APrefixExpr _pexprIcopy
{-# LINE 3120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIcomments
{-# LINE 3130 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3135 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3140 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3145 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorAssociative =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3150 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorPrecedence =
({-# LINE 258 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 3155 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3160 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _pexprIcomments,_pexprIcopy,_pexprIisAssociative,_pexprIisLiteral,_pexprIisMultiline,_pexprIprecedence,_pexprIpretty,_pexprIstartsWithExprPrefixExpression) =
pexpr_ _pexprOcomments _pexprOforceMultiline _pexprOindent _pexprOparentOperatorAssociative _pexprOparentOperatorPrecedence _pexprOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ATableConstructor :: T_FieldList ->
T_Expr
sem_Expr_ATableConstructor :: T_FieldList -> T_Expr
sem_Expr_ATableConstructor T_FieldList
fields_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_fieldsOindent :: Int
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_fieldsOcomments :: ([MToken])
_fieldsOforceMultiline :: Bool
_fieldsOppconf :: PrettyPrintConfig
_fieldsIcanFitOnSameLine :: Bool
_fieldsIcomments :: ([MToken])
_fieldsIcopy :: FieldList
_fieldsIisMultiline :: Bool
_fieldsIisNil :: Bool
_fieldsIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 759 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _prettyMulti else _prettySingle
{-# LINE 3196 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 760 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _fieldsIisMultiline
{-# LINE 3201 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 761 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3206 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 762 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 763 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ indent _lhsIppconf (_lhsIindent + 1) _fieldsIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 3216 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 764 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _fieldsIpretty
{-# LINE 3221 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 765 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _fieldsIcopy
{-# LINE 3226 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOindent =
({-# LINE 766 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _fieldsIisMultiline then 1 else 0)
{-# LINE 3231 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3236 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3241 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ATableConstructor _fieldsIcopy
{-# LINE 3251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_fieldsIcomments
{-# LINE 3261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3276 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _fieldsIcanFitOnSameLine,_fieldsIcomments,_fieldsIcopy,_fieldsIisMultiline,_fieldsIisNil,_fieldsIpretty) =
fields_ _fieldsOcomments _fieldsOforceMultiline _fieldsOindent _fieldsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_BinOpExpr :: T_BinOp ->
T_MExpr ->
T_MExpr ->
T_Expr
sem_Expr_BinOpExpr :: T_BinOp -> T_MExpr -> T_MExpr -> T_Expr
sem_Expr_BinOpExpr T_BinOp
op_ T_MExpr
left_ T_MExpr
right_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_lhsOprecedence :: OperatorLevel
_leftOparentOperatorPrecedence :: OperatorLevel
_rightOparentOperatorPrecedence :: OperatorLevel
_leftOparentOperatorAssociative :: Bool
_rightOparentOperatorAssociative :: Bool
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_opOcomments :: ([MToken])
_opOindent :: Int
_opOppconf :: PrettyPrintConfig
_leftOcomments :: ([MToken])
_leftOforceMultiline :: Bool
_leftOindent :: Int
_leftOppconf :: PrettyPrintConfig
_rightOcomments :: ([MToken])
_rightOforceMultiline :: Bool
_rightOindent :: Int
_rightOppconf :: PrettyPrintConfig
_opIcomments :: ([MToken])
_opIcopy :: BinOp
_opIisAssociative :: Bool
_opIisMultiline :: Bool
_opIprecedence :: OperatorLevel
_opIpretty :: Doc
_leftIcomments :: ([MToken])
_leftIcopy :: MExpr
_leftIendsWithPrefixExpression :: Bool
_leftIisAssociative :: Bool
_leftIisLiteral :: Bool
_leftIisMultiline :: Bool
_leftIpos :: Region
_leftIprecedence :: OperatorLevel
_leftIpretty :: Doc
_rightIcomments :: ([MToken])
_rightIcopy :: MExpr
_rightIendsWithPrefixExpression :: Bool
_rightIisAssociative :: Bool
_rightIisLiteral :: Bool
_rightIisMultiline :: Bool
_rightIpos :: Region
_rightIprecedence :: OperatorLevel
_rightIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 767 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIpretty <-> _opIpretty <-> _rightIpretty
{-# LINE 3343 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 768 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3348 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 771 "src/GLua/AG/PrettyPrint.ag" #-}
min _opIprecedence $ min _leftIprecedence _rightIprecedence
{-# LINE 3353 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorPrecedence =
({-# LINE 772 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3358 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 773 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3363 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorAssociative =
({-# LINE 774 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3368 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 775 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3373 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative && _leftIisAssociative && _rightIisAssociative
{-# LINE 3378 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 262 "src/GLua/AG/PrettyPrint.ag" #-}
((\_ _ -> False) _leftIisLiteral _rightIisLiteral)
{-# LINE 3383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisMultiline || _leftIisMultiline || _rightIisMultiline
{-# LINE 3388 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
BinOpExpr _opIcopy _leftIcopy _rightIcopy
{-# LINE 3393 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3398 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3403 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3408 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3413 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3418 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3423 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3428 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3433 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3438 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIcomments
{-# LINE 3443 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3448 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3453 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3458 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _opIcomments,_opIcopy,_opIisAssociative,_opIisMultiline,_opIprecedence,_opIpretty) =
op_ _opOcomments _opOindent _opOppconf
( _leftIcomments,_leftIcopy,_leftIendsWithPrefixExpression,_leftIisAssociative,_leftIisLiteral,_leftIisMultiline,_leftIpos,_leftIprecedence,_leftIpretty) =
left_ _leftOcomments _leftOforceMultiline _leftOindent _leftOparentOperatorAssociative _leftOparentOperatorPrecedence _leftOppconf
( _rightIcomments,_rightIcopy,_rightIendsWithPrefixExpression,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty) =
right_ _rightOcomments _rightOforceMultiline _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_UnOpExpr :: T_UnOp ->
T_MExpr ->
T_Expr
sem_Expr_UnOpExpr :: T_UnOp -> T_MExpr -> T_Expr
sem_Expr_UnOpExpr T_UnOp
op_ T_MExpr
right_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOendsWithPrefixExpression :: Bool
_rightOparentOperatorPrecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_opOcomments :: ([MToken])
_opOindent :: Int
_opOppconf :: PrettyPrintConfig
_rightOcomments :: ([MToken])
_rightOforceMultiline :: Bool
_rightOindent :: Int
_rightOparentOperatorAssociative :: Bool
_rightOppconf :: PrettyPrintConfig
_opIcomments :: ([MToken])
_opIcopy :: UnOp
_opIisMultiline :: Bool
_opIpretty :: Doc
_rightIcomments :: ([MToken])
_rightIcopy :: MExpr
_rightIendsWithPrefixExpression :: Bool
_rightIisAssociative :: Bool
_rightIisLiteral :: Bool
_rightIisMultiline :: Bool
_rightIpos :: Region
_rightIprecedence :: OperatorLevel
_rightIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 776 "src/GLua/AG/PrettyPrint.ag" #-}
_opIpretty <> _rightIpretty
{-# LINE 3511 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 777 "src/GLua/AG/PrettyPrint.ag" #-}
min _rightIprecedence OperatorLevel7
{-# LINE 3516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 778 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3521 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 779 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel7
{-# LINE 3526 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisAssociative
{-# LINE 3531 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 262 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisLiteral
{-# LINE 3536 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisMultiline || _rightIisMultiline
{-# LINE 3541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
UnOpExpr _opIcopy _rightIcopy
{-# LINE 3546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3556 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3561 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3566 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3571 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3576 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3581 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3586 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3591 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3596 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _opIcomments,_opIcopy,_opIisMultiline,_opIpretty) =
op_ _opOcomments _opOindent _opOppconf
( _rightIcomments,_rightIcopy,_rightIendsWithPrefixExpression,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty) =
right_ _rightOcomments _rightOforceMultiline _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_ExprSuffixList :: ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList :: ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_PFExprSuffix -> T_ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList_Cons T_ExprSuffixList
sem_ExprSuffixList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map PFExprSuffix -> T_PFExprSuffix
sem_PFExprSuffix ExprSuffixList
list))
type T_ExprSuffixList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ExprSuffixList,Bool,Bool,OperatorLevel,Doc)
data Inh_ExprSuffixList = Inh_ExprSuffixList { :: ([MToken]),Inh_ExprSuffixList -> Bool
forceMultiline_Inh_ExprSuffixList :: Bool,Inh_ExprSuffixList -> Int
indent_Inh_ExprSuffixList :: Int,Inh_ExprSuffixList -> PrettyPrintConfig
ppconf_Inh_ExprSuffixList :: PrettyPrintConfig}
data Syn_ExprSuffixList = Syn_ExprSuffixList { :: ([MToken]),Syn_ExprSuffixList -> ExprSuffixList
copy_Syn_ExprSuffixList :: ExprSuffixList,Syn_ExprSuffixList -> Bool
isAssociative_Syn_ExprSuffixList :: Bool,Syn_ExprSuffixList -> Bool
isMultiline_Syn_ExprSuffixList :: Bool,Syn_ExprSuffixList -> OperatorLevel
precedence_Syn_ExprSuffixList :: OperatorLevel,Syn_ExprSuffixList -> Doc
pretty_Syn_ExprSuffixList :: Doc}
wrap_ExprSuffixList :: T_ExprSuffixList ->
Inh_ExprSuffixList ->
Syn_ExprSuffixList
wrap_ExprSuffixList :: T_ExprSuffixList -> Inh_ExprSuffixList -> Syn_ExprSuffixList
wrap_ExprSuffixList T_ExprSuffixList
sem (Inh_ExprSuffixList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,ExprSuffixList
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_ExprSuffixList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> ExprSuffixList
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_ExprSuffixList
Syn_ExprSuffixList [MToken]
_lhsOcomments ExprSuffixList
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_ExprSuffixList_Cons :: T_PFExprSuffix ->
T_ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList_Cons :: T_PFExprSuffix -> T_ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList_Cons T_PFExprSuffix
hd_ T_ExprSuffixList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: ExprSuffixList
_lhsOcomments :: ([MToken])
_hdOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 526 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpretty <> _tlIpretty
{-# LINE 3660 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 3665 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 3670 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 3675 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 3680 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3685 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 3690 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3695 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3700 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3705 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3710 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 3715 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3720 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3725 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3730 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIisAssociative,_hdIisMultiline,_hdIprecedence,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisMultiline,_tlIprecedence,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_ExprSuffixList_Nil :: T_ExprSuffixList
sem_ExprSuffixList_Nil :: T_ExprSuffixList
sem_ExprSuffixList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: ExprSuffixList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 527 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 3752 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3757 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3762 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3767 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 3772 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3777 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3782 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Field :: Field ->
T_Field
sem_Field :: Field -> T_Field
sem_Field (ExprField MExpr
_key MExpr
_value FieldSep
_sep) =
(T_MExpr -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_ExprField (MExpr -> T_MExpr
sem_MExpr MExpr
_key) (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
sem_Field (NamedField MToken
_key MExpr
_value FieldSep
_sep) =
(MToken -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_NamedField MToken
_key (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
sem_Field (UnnamedField MExpr
_value FieldSep
_sep) =
(T_MExpr -> T_FieldSep -> T_Field
sem_Field_UnnamedField (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
type T_Field = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( Bool,([MToken]),Field,Bool,Bool,Region,Doc)
data Inh_Field = Inh_Field { :: ([MToken]),Inh_Field -> Bool
forceMultiline_Inh_Field :: Bool,Inh_Field -> Int
indent_Inh_Field :: Int,Inh_Field -> PrettyPrintConfig
ppconf_Inh_Field :: PrettyPrintConfig}
data Syn_Field = Syn_Field {Syn_Field -> Bool
canFitOnSameLine_Syn_Field :: Bool, :: ([MToken]),Syn_Field -> Field
copy_Syn_Field :: Field,Syn_Field -> Bool
isMultiline_Syn_Field :: Bool,Syn_Field -> Bool
isSemiColon_Syn_Field :: Bool,Syn_Field -> Region
pos_Syn_Field :: Region,Syn_Field -> Doc
pretty_Syn_Field :: Doc}
wrap_Field :: T_Field ->
Inh_Field ->
Syn_Field
wrap_Field :: T_Field -> Inh_Field -> Syn_Field
wrap_Field T_Field
sem (Inh_Field [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( Bool
_lhsOcanFitOnSameLine,[MToken]
_lhsOcomments,Field
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisSemiColon,Region
_lhsOpos,Doc
_lhsOpretty) = T_Field
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (Bool
-> [MToken] -> Field -> Bool -> Bool -> Region -> Doc -> Syn_Field
Syn_Field Bool
_lhsOcanFitOnSameLine [MToken]
_lhsOcomments Field
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisSemiColon Region
_lhsOpos Doc
_lhsOpretty))
sem_Field_ExprField :: T_MExpr ->
T_MExpr ->
T_FieldSep ->
T_Field
sem_Field_ExprField :: T_MExpr -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_ExprField T_MExpr
key_ T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_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])
_keyOforceMultiline :: Bool
_keyOindent :: Int
_keyOppconf :: PrettyPrintConfig
_valueOcomments :: ([MToken])
_valueOforceMultiline :: Bool
_valueOindent :: Int
_valueOppconf :: PrettyPrintConfig
_sepOindent :: Int
_sepOppconf :: PrettyPrintConfig
_keyIcomments :: ([MToken])
_keyIcopy :: MExpr
_keyIendsWithPrefixExpression :: Bool
_keyIisAssociative :: Bool
_keyIisLiteral :: Bool
_keyIisMultiline :: Bool
_keyIpos :: Region
_keyIprecedence :: OperatorLevel
_keyIpretty :: Doc
_valueIcomments :: ([MToken])
_valueIcopy :: MExpr
_valueIendsWithPrefixExpression :: Bool
_valueIisAssociative :: Bool
_valueIisLiteral :: Bool
_valueIisMultiline :: Bool
_valueIpos :: Region
_valueIprecedence :: OperatorLevel
_valueIpretty :: Doc
_sepIcanFitOnSameLine :: Bool
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 800 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _keyIpretty <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 3865 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 801 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3870 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 802 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3875 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorPrecedence =
({-# LINE 803 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3880 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorAssociative =
({-# LINE 804 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3885 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 805 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3890 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 806 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3895 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 3900 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ExprField _keyIcopy _valueIcopy _sepIcopy
{-# LINE 3905 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3910 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 3915 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 3920 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3925 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3930 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3935 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3940 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_keyIcomments
{-# LINE 3945 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3950 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3955 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3960 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3965 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3970 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _keyIcomments,_keyIcopy,_keyIendsWithPrefixExpression,_keyIisAssociative,_keyIisLiteral,_keyIisMultiline,_keyIpos,_keyIprecedence,_keyIpretty) =
key_ _keyOcomments _keyOforceMultiline _keyOindent _keyOparentOperatorAssociative _keyOparentOperatorPrecedence _keyOppconf
( _valueIcomments,_valueIcopy,_valueIendsWithPrefixExpression,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty) =
value_ _valueOcomments _valueOforceMultiline _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 :: MToken -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_NamedField MToken
key_ T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcanFitOnSameLine :: Bool
_valueOparentOperatorPrecedence :: OperatorLevel
_valueOparentOperatorAssociative :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: Field
_lhsOcomments :: ([MToken])
_lhsOpos :: Region
_valueOcomments :: ([MToken])
_valueOforceMultiline :: Bool
_valueOindent :: Int
_valueOppconf :: PrettyPrintConfig
_sepOindent :: Int
_sepOppconf :: PrettyPrintConfig
_valueIcomments :: ([MToken])
_valueIcopy :: MExpr
_valueIendsWithPrefixExpression :: Bool
_valueIisAssociative :: Bool
_valueIisLiteral :: Bool
_valueIisMultiline :: Bool
_valueIpos :: Region
_valueIprecedence :: OperatorLevel
_valueIpretty :: Doc
_sepIcanFitOnSameLine :: Bool
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 807 "src/GLua/AG/PrettyPrint.ag" #-}
tok key_ <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 4020 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 808 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4025 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 809 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4030 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 810 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4035 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 811 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4040 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4045 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
NamedField key_ _valueIcopy _sepIcopy
{-# LINE 4050 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4055 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4060 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4065 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4070 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4075 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4080 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4085 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4095 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valueIcomments,_valueIcopy,_valueIendsWithPrefixExpression,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty) =
value_ _valueOcomments _valueOforceMultiline _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 :: T_MExpr -> T_FieldSep -> T_Field
sem_Field_UnnamedField T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOcanFitOnSameLine :: Bool
_valueOparentOperatorPrecedence :: OperatorLevel
_valueOparentOperatorAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: Field
_lhsOcomments :: ([MToken])
_lhsOpos :: Region
_valueOcomments :: ([MToken])
_valueOforceMultiline :: Bool
_valueOindent :: Int
_valueOppconf :: PrettyPrintConfig
_sepOindent :: Int
_sepOppconf :: PrettyPrintConfig
_valueIcomments :: ([MToken])
_valueIcopy :: MExpr
_valueIendsWithPrefixExpression :: Bool
_valueIisAssociative :: Bool
_valueIisLiteral :: Bool
_valueIisMultiline :: Bool
_valueIpos :: Region
_valueIprecedence :: OperatorLevel
_valueIpretty :: Doc
_sepIcanFitOnSameLine :: Bool
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 812 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpretty <> _sepIpretty
{-# LINE 4142 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 813 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIcanFitOnSameLine && not _valueIisMultiline
{-# LINE 4147 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 814 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4152 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 815 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4157 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIisMultiline || _sepIisMultiline
{-# LINE 4162 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4167 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
UnnamedField _valueIcopy _sepIcopy
{-# LINE 4172 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4177 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4182 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4187 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4192 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4197 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4202 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4207 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4212 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4217 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valueIcomments,_valueIcopy,_valueIendsWithPrefixExpression,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty) =
value_ _valueOcomments _valueOforceMultiline _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf
( _sepIcanFitOnSameLine,_sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) =
sep_ _sepOindent _sepOppconf
in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty)))
sem_FieldList :: FieldList ->
T_FieldList
sem_FieldList :: FieldList -> T_FieldList
sem_FieldList FieldList
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Field -> T_FieldList -> T_FieldList
sem_FieldList_Cons T_FieldList
sem_FieldList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map Field -> T_Field
sem_Field FieldList
list))
type T_FieldList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( Bool,([MToken]),FieldList,Bool,Bool,Doc)
data Inh_FieldList = Inh_FieldList { :: ([MToken]),Inh_FieldList -> Bool
forceMultiline_Inh_FieldList :: Bool,Inh_FieldList -> Int
indent_Inh_FieldList :: Int,Inh_FieldList -> PrettyPrintConfig
ppconf_Inh_FieldList :: PrettyPrintConfig}
data Syn_FieldList = Syn_FieldList {Syn_FieldList -> Bool
canFitOnSameLine_Syn_FieldList :: Bool, :: ([MToken]),Syn_FieldList -> FieldList
copy_Syn_FieldList :: FieldList,Syn_FieldList -> Bool
isMultiline_Syn_FieldList :: Bool,Syn_FieldList -> Bool
isNil_Syn_FieldList :: Bool,Syn_FieldList -> Doc
pretty_Syn_FieldList :: Doc}
wrap_FieldList :: T_FieldList ->
Inh_FieldList ->
Syn_FieldList
wrap_FieldList :: T_FieldList -> Inh_FieldList -> Syn_FieldList
wrap_FieldList T_FieldList
sem (Inh_FieldList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( Bool
_lhsOcanFitOnSameLine,[MToken]
_lhsOcomments,FieldList
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisNil,Doc
_lhsOpretty) = T_FieldList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (Bool
-> [MToken] -> FieldList -> Bool -> Bool -> Doc -> Syn_FieldList
Syn_FieldList Bool
_lhsOcanFitOnSameLine [MToken]
_lhsOcomments FieldList
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisNil Doc
_lhsOpretty))
sem_FieldList_Cons :: T_Field ->
T_FieldList ->
T_FieldList
sem_FieldList_Cons :: T_Field -> T_FieldList -> T_FieldList
sem_FieldList_Cons T_Field
hd_ T_FieldList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOcanFitOnSameLine :: Bool
_lhsOisNil :: Bool
_hdOcomments :: ([MToken])
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldList
_lhsOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 423 "src/GLua/AG/PrettyPrint.ag" #-}
_prettyCommentsBefore $+$ _indentAfterComment (_hdIpretty <-> _prettyCommentsAfter ) `_sep ` _ind _tlIpretty
{-# LINE 4282 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 424 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcanFitOnSameLine
{-# LINE 4287 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 425 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4292 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 427 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4297 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sep =
({-# LINE 429 "src/GLua/AG/PrettyPrint.ag" #-}
if _onSameLine then _optionalSpaceAfterSep else ($+$)
{-# LINE 4302 "src/GLua/AG/PrettyPrint.hs" #-}
)
_ind =
({-# LINE 430 "src/GLua/AG/PrettyPrint.ag" #-}
if _onSameLine then id else indent _lhsIppconf _lhsIindent
{-# LINE 4307 "src/GLua/AG/PrettyPrint.hs" #-}
)
_onSameLine =
({-# LINE 431 "src/GLua/AG/PrettyPrint.ag" #-}
(_hdIcanFitOnSameLine && null (fst _commentsAfter ) && not _isMultiline ) || _tlIisNil
{-# LINE 4312 "src/GLua/AG/PrettyPrint.hs" #-}
)
_optionalSpaceAfterSep =
({-# LINE 433 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterComma _lhsIppconf then (<->) else (<>)
{-# LINE 4317 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indentAfterComment =
({-# LINE 434 "src/GLua/AG/PrettyPrint.ag" #-}
if null $ fst _commentsBefore then id else indent _lhsIppconf _lhsIindent
{-# LINE 4322 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 436 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _hdIisMultiline || _tlIisMultiline
{-# LINE 4327 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsBefore =
({-# LINE 438 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
{-# LINE 4332 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 439 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 4337 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 440 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then
span (\(MToken pos _) -> pos `before` _hdIpos) _lhsIcomments
else
([], _lhsIcomments)
{-# LINE 4345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 446 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then
span (\(MToken pos _) -> pos `beforeOrOnLine` _hdIpos) (snd _commentsBefore )
else
_commentsBefore
{-# LINE 4353 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 4358 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 4363 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4368 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 4373 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4378 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4388 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 4393 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4398 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4403 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4408 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcanFitOnSameLine,_hdIcomments,_hdIcopy,_hdIisMultiline,_hdIisSemiColon,_hdIpos,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcanFitOnSameLine,_tlIcomments,_tlIcopy,_tlIisMultiline,_tlIisNil,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty)))
sem_FieldList_Nil :: T_FieldList
sem_FieldList_Nil :: T_FieldList
sem_FieldList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisNil :: Bool
_lhsOcanFitOnSameLine :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 451 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4430 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 452 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4435 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 453 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4440 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4445 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 4450 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4455 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4460 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcanFitOnSameLine,_lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty)))
sem_FieldSep :: FieldSep ->
T_FieldSep
sem_FieldSep :: FieldSep -> T_FieldSep
sem_FieldSep (FieldSep
CommaSep) =
(T_FieldSep
sem_FieldSep_CommaSep)
sem_FieldSep (FieldSep
SemicolonSep) =
(T_FieldSep
sem_FieldSep_SemicolonSep)
sem_FieldSep (FieldSep
NoSep) =
(T_FieldSep
sem_FieldSep_NoSep)
type T_FieldSep = Int ->
PrettyPrintConfig ->
( Bool,FieldSep,Bool,Bool,Doc)
data Inh_FieldSep = Inh_FieldSep {Inh_FieldSep -> Int
indent_Inh_FieldSep :: Int,Inh_FieldSep -> PrettyPrintConfig
ppconf_Inh_FieldSep :: PrettyPrintConfig}
data Syn_FieldSep = Syn_FieldSep {Syn_FieldSep -> Bool
canFitOnSameLine_Syn_FieldSep :: Bool,Syn_FieldSep -> FieldSep
copy_Syn_FieldSep :: FieldSep,Syn_FieldSep -> Bool
isMultiline_Syn_FieldSep :: Bool,Syn_FieldSep -> Bool
isSemiColon_Syn_FieldSep :: Bool,Syn_FieldSep -> Doc
pretty_Syn_FieldSep :: Doc}
wrap_FieldSep :: T_FieldSep ->
Inh_FieldSep ->
Syn_FieldSep
wrap_FieldSep :: T_FieldSep -> Inh_FieldSep -> Syn_FieldSep
wrap_FieldSep T_FieldSep
sem (Inh_FieldSep Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( Bool
_lhsOcanFitOnSameLine,FieldSep
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisSemiColon,Doc
_lhsOpretty) = T_FieldSep
sem Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (Bool -> FieldSep -> Bool -> Bool -> Doc -> Syn_FieldSep
Syn_FieldSep Bool
_lhsOcanFitOnSameLine FieldSep
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisSemiColon Doc
_lhsOpretty))
sem_FieldSep_CommaSep :: T_FieldSep
sem_FieldSep_CommaSep :: T_FieldSep
sem_FieldSep_CommaSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOcanFitOnSameLine :: Bool
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 818 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ','
{-# LINE 4497 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 819 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4502 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4507 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4512 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
CommaSep
{-# LINE 4517 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4522 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_SemicolonSep :: T_FieldSep
sem_FieldSep_SemicolonSep :: T_FieldSep
sem_FieldSep_SemicolonSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisSemiColon :: Bool
_lhsOcanFitOnSameLine :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 820 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ';'
{-# LINE 4537 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 821 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4542 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 824 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4547 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 825 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4552 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
SemicolonSep
{-# LINE 4557 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4562 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_NoSep :: T_FieldSep
sem_FieldSep_NoSep :: T_FieldSep
sem_FieldSep_NoSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOcanFitOnSameLine :: Bool
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 826 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4577 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcanFitOnSameLine =
({-# LINE 827 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4582 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4587 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 296 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4592 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
NoSep
{-# LINE 4597 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4602 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcanFitOnSameLine,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FuncName :: FuncName ->
T_FuncName
sem_FuncName :: FuncName -> T_FuncName
sem_FuncName (FuncName [MToken]
_names Maybe MToken
_meta) =
([MToken] -> Maybe MToken -> T_FuncName
sem_FuncName_FuncName [MToken]
_names Maybe MToken
_meta)
type T_FuncName = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),FuncName,Bool,Doc)
data Inh_FuncName = Inh_FuncName { :: ([MToken]),Inh_FuncName -> Int
indent_Inh_FuncName :: Int,Inh_FuncName -> PrettyPrintConfig
ppconf_Inh_FuncName :: PrettyPrintConfig}
data Syn_FuncName = Syn_FuncName { :: ([MToken]),Syn_FuncName -> FuncName
copy_Syn_FuncName :: FuncName,Syn_FuncName -> Bool
isMultiline_Syn_FuncName :: Bool,Syn_FuncName -> Doc
pretty_Syn_FuncName :: Doc}
wrap_FuncName :: T_FuncName ->
Inh_FuncName ->
Syn_FuncName
wrap_FuncName :: T_FuncName -> Inh_FuncName -> Syn_FuncName
wrap_FuncName T_FuncName
sem (Inh_FuncName [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,FuncName
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_FuncName
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> FuncName -> Bool -> Doc -> Syn_FuncName
Syn_FuncName [MToken]
_lhsOcomments FuncName
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_FuncName_FuncName :: ([MToken]) ->
(Maybe MToken) ->
T_FuncName
sem_FuncName_FuncName :: [MToken] -> Maybe MToken -> T_FuncName
sem_FuncName_FuncName [MToken]
names_ Maybe MToken
meta_ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: FuncName
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 673 "src/GLua/AG/PrettyPrint.ag" #-}
printList tok "." names_ <> metaDoc meta_
{-# LINE 4638 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4643 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
FuncName names_ meta_
{-# LINE 4648 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4653 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4658 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_MElse :: MElse ->
T_MElse
sem_MElse :: MElse -> T_MElse
sem_MElse (MElse Region
_pos Block
_body) =
(Region -> T_Block -> T_MElse
sem_MElse_MElse Region
_pos (Block -> T_Block
sem_Block Block
_body))
type T_MElse = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MElse,Bool,Bool,Region,Doc)
data Inh_MElse = Inh_MElse { :: ([MToken]),Inh_MElse -> Bool
forceMultiline_Inh_MElse :: Bool,Inh_MElse -> Int
indent_Inh_MElse :: Int,Inh_MElse -> PrettyPrintConfig
ppconf_Inh_MElse :: PrettyPrintConfig,Inh_MElse -> Region
statRegion_Inh_MElse :: Region}
data Syn_MElse = Syn_MElse { :: ([MToken]),Syn_MElse -> MElse
copy_Syn_MElse :: MElse,Syn_MElse -> Bool
elsesExist_Syn_MElse :: Bool,Syn_MElse -> Bool
isMultiline_Syn_MElse :: Bool,Syn_MElse -> Region
pos_Syn_MElse :: Region,Syn_MElse -> Doc
pretty_Syn_MElse :: Doc}
wrap_MElse :: T_MElse ->
Inh_MElse ->
Syn_MElse
wrap_MElse :: T_MElse -> Inh_MElse -> Syn_MElse
wrap_MElse T_MElse
sem (Inh_MElse [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,MElse
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_MElse
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken] -> MElse -> Bool -> Bool -> Region -> Doc -> Syn_MElse
Syn_MElse [MToken]
_lhsOcomments MElse
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_MElse_MElse :: Region ->
T_Block ->
T_MElse
sem_MElse_MElse :: Region -> T_Block -> T_MElse
sem_MElse_MElse Region
pos_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_bodyOindent :: Int
_lhsOpos :: Region
_bodyOcomments :: ([MToken])
_lhsOelsesExist :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: MElse
_lhsOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 518 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent (zeroWidthText "else") <-> _prettyCommentsAfter $+$ _bodyIpretty
{-# LINE 4711 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 519 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 4716 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 520 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 4721 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 521 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` pos_) _lhsIcomments
{-# LINE 4726 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 522 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4731 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 523 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4736 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 309 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4741 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIisMultiline
{-# LINE 4746 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
MElse pos_ _bodyIcopy
{-# LINE 4751 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4756 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 4761 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4766 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4771 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 4776 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_MElseIf :: MElseIf ->
T_MElseIf
sem_MElseIf :: MElseIf -> T_MElseIf
sem_MElseIf (MElseIf Region
_pos (MExpr, Block)
_elif) =
(Region -> T_ElseIf -> T_MElseIf
sem_MElseIf_MElseIf Region
_pos ((MExpr, Block) -> T_ElseIf
sem_ElseIf (MExpr, Block)
_elif))
type T_MElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MElseIf,Bool,Region,Doc)
data Inh_MElseIf = Inh_MElseIf { :: ([MToken]),Inh_MElseIf -> Bool
forceMultiline_Inh_MElseIf :: Bool,Inh_MElseIf -> Int
indent_Inh_MElseIf :: Int,Inh_MElseIf -> PrettyPrintConfig
ppconf_Inh_MElseIf :: PrettyPrintConfig}
data Syn_MElseIf = Syn_MElseIf { :: ([MToken]),Syn_MElseIf -> MElseIf
copy_Syn_MElseIf :: MElseIf,Syn_MElseIf -> Bool
isMultiline_Syn_MElseIf :: Bool,Syn_MElseIf -> Region
pos_Syn_MElseIf :: Region,Syn_MElseIf -> Doc
pretty_Syn_MElseIf :: Doc}
wrap_MElseIf :: T_MElseIf ->
Inh_MElseIf ->
Syn_MElseIf
wrap_MElseIf :: T_MElseIf -> Inh_MElseIf -> Syn_MElseIf
wrap_MElseIf T_MElseIf
sem (Inh_MElseIf [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,MElseIf
_lhsOcopy,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_MElseIf
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> MElseIf -> Bool -> Region -> Doc -> Syn_MElseIf
Syn_MElseIf [MToken]
_lhsOcomments MElseIf
_lhsOcopy Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_MElseIf_MElseIf :: Region ->
T_ElseIf ->
T_MElseIf
sem_MElseIf_MElseIf :: Region -> T_ElseIf -> T_MElseIf
sem_MElseIf_MElseIf Region
pos_ T_ElseIf
elif_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOcopy :: MElseIf
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_elifOcomments :: ([MToken])
_elifOforceMultiline :: Bool
_elifOindent :: Int
_elifOppconf :: PrettyPrintConfig
_elifIcomments :: ([MToken])
_elifIcopy :: ElseIf
_elifIisMultiline :: Bool
_elifIpretty :: Doc
_lhsOpos :: Region
_lhsOpos =
({-# LINE 503 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4825 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIisMultiline
{-# LINE 4830 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
MElseIf pos_ _elifIcopy
{-# LINE 4835 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4840 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIcomments
{-# LINE 4845 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 248 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIpretty
{-# LINE 4850 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4855 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4860 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4865 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4870 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _elifIcomments,_elifIcopy,_elifIisMultiline,_elifIpretty) =
elif_ _elifOcomments _elifOforceMultiline _elifOindent _elifOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_MExpr :: MExpr ->
T_MExpr
sem_MExpr :: MExpr -> T_MExpr
sem_MExpr (MExpr Region
_pos Expr
_expr) =
(Region -> T_Expr -> T_MExpr
sem_MExpr_MExpr Region
_pos (Expr -> T_Expr
sem_Expr Expr
_expr))
type T_MExpr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),MExpr,Bool,Bool,Bool,Bool,Region,OperatorLevel,Doc)
data Inh_MExpr = Inh_MExpr { :: ([MToken]),Inh_MExpr -> Bool
forceMultiline_Inh_MExpr :: Bool,Inh_MExpr -> Int
indent_Inh_MExpr :: Int,Inh_MExpr -> Bool
parentOperatorAssociative_Inh_MExpr :: Bool,Inh_MExpr -> OperatorLevel
parentOperatorPrecedence_Inh_MExpr :: OperatorLevel,Inh_MExpr -> PrettyPrintConfig
ppconf_Inh_MExpr :: PrettyPrintConfig}
data Syn_MExpr = Syn_MExpr { :: ([MToken]),Syn_MExpr -> MExpr
copy_Syn_MExpr :: MExpr,Syn_MExpr -> Bool
endsWithPrefixExpression_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isAssociative_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isLiteral_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isMultiline_Syn_MExpr :: Bool,Syn_MExpr -> Region
pos_Syn_MExpr :: Region,Syn_MExpr -> OperatorLevel
precedence_Syn_MExpr :: OperatorLevel,Syn_MExpr -> Doc
pretty_Syn_MExpr :: Doc}
wrap_MExpr :: T_MExpr ->
Inh_MExpr ->
Syn_MExpr
wrap_MExpr :: T_MExpr -> Inh_MExpr -> Syn_MExpr
wrap_MExpr T_MExpr
sem (Inh_MExpr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,MExpr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,Region
_lhsOpos,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MExpr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> MExpr
-> Bool
-> Bool
-> Bool
-> Bool
-> Region
-> OperatorLevel
-> Doc
-> Syn_MExpr
Syn_MExpr [MToken]
_lhsOcomments MExpr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline Region
_lhsOpos OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MExpr_MExpr :: Region ->
T_Expr ->
T_MExpr
sem_MExpr_MExpr :: Region -> T_Expr -> T_MExpr
sem_MExpr_MExpr Region
pos_ T_Expr
expr_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpos :: Region
_lhsOendsWithPrefixExpression :: Bool
_exprOstatRegion :: Region
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExpr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_exprOcomments :: ([MToken])
_exprOforceMultiline :: Bool
_exprOindent :: Int
_exprOparentOperatorAssociative :: Bool
_exprOparentOperatorPrecedence :: OperatorLevel
_exprOppconf :: PrettyPrintConfig
_exprIcomments :: ([MToken])
_exprIcopy :: Expr
_exprIendsWithPrefixExpression :: Bool
_exprIisAssociative :: Bool
_exprIisLiteral :: Bool
_exprIisMultiline :: Bool
_exprIprecedence :: OperatorLevel
_exprIpretty :: Doc
_lhsOpos :: Region
_lhsOpos =
({-# LINE 725 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4934 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 726 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIendsWithPrefixExpression
{-# LINE 4939 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOstatRegion =
({-# LINE 727 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4944 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative
{-# LINE 4949 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 262 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisLiteral
{-# LINE 4954 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline
{-# LINE 4959 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIprecedence
{-# LINE 4964 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
MExpr pos_ _exprIcopy
{-# LINE 4969 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4974 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 4979 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 248 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIpretty
{-# LINE 4984 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4989 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4994 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4999 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 5004 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 258 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 5009 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5014 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _exprIcomments,_exprIcopy,_exprIendsWithPrefixExpression,_exprIisAssociative,_exprIisLiteral,_exprIisMultiline,_exprIprecedence,_exprIpretty) =
expr_ _exprOcomments _exprOforceMultiline _exprOindent _exprOparentOperatorAssociative _exprOparentOperatorPrecedence _exprOppconf _exprOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty)))
sem_MExprList :: MExprList ->
T_MExprList
sem_MExprList :: [MExpr] -> T_MExprList
sem_MExprList [MExpr]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MExpr -> T_MExprList -> T_MExprList
sem_MExprList_Cons T_MExprList
sem_MExprList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MExpr -> T_MExpr
sem_MExpr [MExpr]
list))
type T_MExprList = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
( ([MToken]),MExprList,Bool,Bool,Region,OperatorLevel,Doc)
data Inh_MExprList = Inh_MExprList { :: ([MToken]),Inh_MExprList -> Bool
forceMultiline_Inh_MExprList :: Bool,Inh_MExprList -> Int
indent_Inh_MExprList :: Int,Inh_MExprList -> Bool
isHead_Inh_MExprList :: Bool,Inh_MExprList -> PrettyPrintConfig
ppconf_Inh_MExprList :: PrettyPrintConfig}
data Syn_MExprList = Syn_MExprList { :: ([MToken]),Syn_MExprList -> [MExpr]
copy_Syn_MExprList :: MExprList,Syn_MExprList -> Bool
isAssociative_Syn_MExprList :: Bool,Syn_MExprList -> Bool
isMultiline_Syn_MExprList :: Bool,Syn_MExprList -> Region
pos_Syn_MExprList :: Region,Syn_MExprList -> OperatorLevel
precedence_Syn_MExprList :: OperatorLevel,Syn_MExprList -> Doc
pretty_Syn_MExprList :: Doc}
wrap_MExprList :: T_MExprList ->
Inh_MExprList ->
Syn_MExprList
wrap_MExprList :: T_MExprList -> Inh_MExprList -> Syn_MExprList
wrap_MExprList T_MExprList
sem (Inh_MExprList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,[MExpr]
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,Region
_lhsOpos,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MExprList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> [MExpr]
-> Bool
-> Bool
-> Region
-> OperatorLevel
-> Doc
-> Syn_MExprList
Syn_MExprList [MToken]
_lhsOcomments [MExpr]
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline Region
_lhsOpos OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MExprList_Cons :: T_MExpr ->
T_MExprList ->
T_MExprList
sem_MExprList_Cons :: T_MExpr -> T_MExprList -> T_MExprList
sem_MExprList_Cons T_MExpr
hd_ T_MExprList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_tlOisHead :: Bool
_lhsOpos :: Region
_hdOparentOperatorPrecedence :: OperatorLevel
_hdOparentOperatorAssociative :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExprList
_lhsOcomments :: ([MToken])
_hdOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_hdIcomments :: ([MToken])
_hdIcopy :: MExpr
_hdIendsWithPrefixExpression :: Bool
_hdIisAssociative :: Bool
_hdIisLiteral :: Bool
_hdIisMultiline :: Bool
_hdIpos :: Region
_hdIprecedence :: OperatorLevel
_hdIpretty :: Doc
_tlIcomments :: ([MToken])
_tlIcopy :: MExprList
_tlIisAssociative :: Bool
_tlIisMultiline :: Bool
_tlIpos :: Region
_tlIprecedence :: OperatorLevel
_tlIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 398 "src/GLua/AG/PrettyPrint.ag" #-}
if _lhsIisHead then
_hdIpretty <> _tlIpretty
else
if _isMultiline then _prettyMultiLine else _prettySingleLine
{-# LINE 5089 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingleLine =
({-# LINE 403 "src/GLua/AG/PrettyPrint.ag" #-}
_comma <>
(if spaceAfterComma _lhsIppconf then zchr ' ' else empty) <>
_hdIpretty <>
_tlIpretty
{-# LINE 5097 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMultiLine =
({-# LINE 408 "src/GLua/AG/PrettyPrint.ag" #-}
_comma $+$
indent _lhsIppconf _lhsIindent _hdIpretty <>
_tlIpretty
{-# LINE 5104 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 412 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ','
{-# LINE 5109 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOisHead =
({-# LINE 414 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5114 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 415 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 5119 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorPrecedence =
({-# LINE 416 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5124 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorAssociative =
({-# LINE 417 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5129 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 418 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _hdIisMultiline || _tlIisMultiline
{-# LINE 5134 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 5139 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 5144 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 5149 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5154 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5159 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5164 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5169 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5174 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5179 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5184 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 5189 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5194 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5199 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5204 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIisAssociative,_hdIisLiteral,_hdIisMultiline,_hdIpos,_hdIprecedence,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOparentOperatorAssociative _hdOparentOperatorPrecedence _hdOppconf
( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisMultiline,_tlIpos,_tlIprecedence,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOisHead _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty)))
sem_MExprList_Nil :: T_MExprList
sem_MExprList_Nil :: T_MExprList
sem_MExprList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExprList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 419 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5228 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 420 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 5233 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5238 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5243 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5248 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5253 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5258 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5263 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty)))
sem_MStat :: MStat ->
T_MStat
sem_MStat :: MStat -> T_MStat
sem_MStat (MStat Region
_pos Stat
_stat) =
(Region -> T_Stat -> T_MStat
sem_MStat_MStat Region
_pos (Stat -> T_Stat
sem_Stat Stat
_stat))
type T_MStat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),MStat,Bool,Bool,Bool,Region,Doc,Bool,Int)
data Inh_MStat = Inh_MStat { :: ([MToken]),Inh_MStat -> Bool
forceMultiline_Inh_MStat :: Bool,Inh_MStat -> Int
indent_Inh_MStat :: Int,Inh_MStat -> Bool
isLastStatement_Inh_MStat :: Bool,Inh_MStat -> PrettyPrintConfig
ppconf_Inh_MStat :: PrettyPrintConfig,Inh_MStat -> Bool
wouldBeAmbiguousWithoutSemicolon_Inh_MStat :: Bool}
data Syn_MStat = Syn_MStat { :: ([MToken]),Syn_MStat -> MStat
copy_Syn_MStat :: MStat,Syn_MStat -> Bool
endsWithPrefixExpression_Syn_MStat :: Bool,Syn_MStat -> Bool
hasBreaking_Syn_MStat :: Bool,Syn_MStat -> Bool
isMultiline_Syn_MStat :: Bool,Syn_MStat -> Region
pos_Syn_MStat :: Region,Syn_MStat -> Doc
pretty_Syn_MStat :: Doc,Syn_MStat -> Bool
startsWithExprPrefixExpression_Syn_MStat :: Bool,Syn_MStat -> Int
statementCount_Syn_MStat :: Int}
wrap_MStat :: T_MStat ->
Inh_MStat ->
Syn_MStat
wrap_MStat :: T_MStat -> Inh_MStat -> Syn_MStat
wrap_MStat T_MStat
sem (Inh_MStat [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Bool
_lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( [MToken]
_lhsOcomments,MStat
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOhasBreaking,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Int
_lhsOstatementCount) = T_MStat
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Bool
_lhsIwouldBeAmbiguousWithoutSemicolon
in ([MToken]
-> MStat
-> Bool
-> Bool
-> Bool
-> Region
-> Doc
-> Bool
-> Int
-> Syn_MStat
Syn_MStat [MToken]
_lhsOcomments MStat
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOhasBreaking Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Int
_lhsOstatementCount))
sem_MStat_MStat :: Region ->
T_Stat ->
T_MStat
sem_MStat_MStat :: Region -> T_Stat -> T_MStat
sem_MStat_MStat Region
pos_ T_Stat
stat_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpos :: Region
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_statOstatRegion :: Region
_statOwouldBeAmbiguousWithoutSemicolon :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOstatementCount :: Int
_lhsOcopy :: MStat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_statOcomments :: ([MToken])
_statOforceMultiline :: Bool
_statOindent :: Int
_statOisLastStatement :: Bool
_statOppconf :: PrettyPrintConfig
_statIcomments :: ([MToken])
_statIcopy :: Stat
_statIendsWithPrefixExpression :: Bool
_statIhasBreaking :: Bool
_statIisMultiline :: Bool
_statIpretty :: Doc
_statIstartsWithExprPrefixExpression :: Bool
_lhsOpos :: Region
_lhsOpos =
({-# LINE 391 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5324 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 392 "src/GLua/AG/PrettyPrint.ag" #-}
_statIstartsWithExprPrefixExpression
{-# LINE 5329 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 393 "src/GLua/AG/PrettyPrint.ag" #-}
_statIendsWithPrefixExpression
{-# LINE 5334 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOstatRegion =
({-# LINE 394 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5339 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 395 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIwouldBeAmbiguousWithoutSemicolon
{-# LINE 5344 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
_statIhasBreaking
{-# LINE 5349 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_statIisMultiline
{-# LINE 5354 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 303 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 5359 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
MStat pos_ _statIcopy
{-# LINE 5364 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5369 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_statIcomments
{-# LINE 5374 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 248 "src/GLua/AG/PrettyPrint.ag" #-}
_statIpretty
{-# LINE 5379 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5384 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5389 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5394 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOisLastStatement =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIisLastStatement
{-# LINE 5399 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5404 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _statIcomments,_statIcopy,_statIendsWithPrefixExpression,_statIhasBreaking,_statIisMultiline,_statIpretty,_statIstartsWithExprPrefixExpression) =
stat_ _statOcomments _statOforceMultiline _statOindent _statOisLastStatement _statOppconf _statOstatRegion _statOwouldBeAmbiguousWithoutSemicolon
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpos,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
sem_MStatList :: MStatList ->
T_MStatList
sem_MStatList :: [MStat] -> T_MStatList
sem_MStatList [MStat]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MStat -> T_MStatList -> T_MStatList
sem_MStatList_Cons T_MStatList
sem_MStatList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MStat -> T_MStat
sem_MStat [MStat]
list))
type T_MStatList = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MStatList,Bool,Bool,Bool,Doc,Bool,Int)
data Inh_MStatList = Inh_MStatList { :: ([MToken]),Inh_MStatList -> Bool
forceMultiline_Inh_MStatList :: Bool,Inh_MStatList -> Int
indent_Inh_MStatList :: Int,Inh_MStatList -> Bool
isHead_Inh_MStatList :: Bool,Inh_MStatList -> PrettyPrintConfig
ppconf_Inh_MStatList :: PrettyPrintConfig,Inh_MStatList -> Region
statRegion_Inh_MStatList :: Region}
data Syn_MStatList = Syn_MStatList { :: ([MToken]),Syn_MStatList -> [MStat]
copy_Syn_MStatList :: MStatList,Syn_MStatList -> Bool
hasBreaking_Syn_MStatList :: Bool,Syn_MStatList -> Bool
isLast_Syn_MStatList :: Bool,Syn_MStatList -> Bool
isMultiline_Syn_MStatList :: Bool,Syn_MStatList -> Doc
pretty_Syn_MStatList :: Doc,Syn_MStatList -> Bool
startsWithExprPrefixExpression_Syn_MStatList :: Bool,Syn_MStatList -> Int
statementCount_Syn_MStatList :: Int}
wrap_MStatList :: T_MStatList ->
Inh_MStatList ->
Syn_MStatList
wrap_MStatList :: T_MStatList -> Inh_MStatList -> Syn_MStatList
wrap_MStatList T_MStatList
sem (Inh_MStatList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,[MStat]
_lhsOcopy,Bool
_lhsOhasBreaking,Bool
_lhsOisLast,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Int
_lhsOstatementCount) = T_MStatList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> [MStat]
-> Bool
-> Bool
-> Bool
-> Doc
-> Bool
-> Int
-> Syn_MStatList
Syn_MStatList [MToken]
_lhsOcomments [MStat]
_lhsOcopy Bool
_lhsOhasBreaking Bool
_lhsOisLast Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Int
_lhsOstatementCount))
sem_MStatList_Cons :: T_MStat ->
T_MStatList ->
T_MStatList
sem_MStatList_Cons :: T_MStat -> T_MStatList -> T_MStatList
sem_MStatList_Cons T_MStat
hd_ T_MStatList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_hdOcomments :: ([MToken])
_tlOcomments :: ([MToken])
_tlOisHead :: Bool
_hdOisLastStatement :: Bool
_hdOwouldBeAmbiguousWithoutSemicolon :: Bool
_hdOforceMultiline :: Bool
_lhsOisLast :: Bool
_lhsOhasBreaking :: Bool
_lhsOstatementCount :: Int
_lhsOcopy :: MStatList
_lhsOcomments :: ([MToken])
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_tlOstatRegion :: Region
_hdIcomments :: ([MToken])
_hdIcopy :: MStat
_hdIendsWithPrefixExpression :: Bool
_hdIhasBreaking :: Bool
_hdIisMultiline :: Bool
_hdIpos :: Region
_hdIpretty :: Doc
_hdIstartsWithExprPrefixExpression :: Bool
_hdIstatementCount :: Int
_tlIcomments :: ([MToken])
_tlIcopy :: MStatList
_tlIhasBreaking :: Bool
_tlIisLast :: Bool
_tlIisMultiline :: Bool
_tlIpretty :: Doc
_tlIstartsWithExprPrefixExpression :: Bool
_tlIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 348 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIisMultiline
{-# LINE 5481 "src/GLua/AG/PrettyPrint.hs" #-}
)
_addNewline =
({-# LINE 349 "src/GLua/AG/PrettyPrint.ag" #-}
if not _tlIisLast && (_hdIisMultiline || _tlIisMultiline) then zchr '\n' else empty
{-# LINE 5486 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 350 "src/GLua/AG/PrettyPrint.ag" #-}
_prettyCommentsBefore
$+$ indent _lhsIppconf _lhsIindent _hdIpretty
<-> _prettyCommentsAfter <> _addNewline
$+$ _tlIpretty
{-# LINE 5494 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 355 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 5499 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsBefore =
({-# LINE 357 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
{-# LINE 5504 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 358 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 5509 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 359 "src/GLua/AG/PrettyPrint.ag" #-}
if _hdIisMultiline
then span (\(MToken pos' _) -> pos' `beforeOrOnLine` _hdIpos) _lhsIcomments
else _commentsBeforeLine
{-# LINE 5516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 363 "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 5523 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeLine =
({-# LINE 367 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments
{-# LINE 5528 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 368 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 5533 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 369 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 5538 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOisHead =
({-# LINE 371 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5543 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOisLastStatement =
({-# LINE 372 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIisLast
{-# LINE 5548 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 377 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIendsWithPrefixExpression && _tlIstartsWithExprPrefixExpression
{-# LINE 5553 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 379 "src/GLua/AG/PrettyPrint.ag" #-}
commentsForceMultiline $ fst _commentsBeforeLine
{-# LINE 5558 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 380 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5563 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIhasBreaking || _tlIhasBreaking
{-# LINE 5568 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 303 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstatementCount + _tlIstatementCount
{-# LINE 5573 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5578 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5583 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5588 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5593 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5598 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5603 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5608 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5613 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 5618 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIhasBreaking,_hdIisMultiline,_hdIpos,_hdIpretty,_hdIstartsWithExprPrefixExpression,_hdIstatementCount) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOisLastStatement _hdOppconf _hdOwouldBeAmbiguousWithoutSemicolon
( _tlIcomments,_tlIcopy,_tlIhasBreaking,_tlIisLast,_tlIisMultiline,_tlIpretty,_tlIstartsWithExprPrefixExpression,_tlIstatementCount) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOisHead _tlOppconf _tlOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
sem_MStatList_Nil :: T_MStatList
sem_MStatList_Nil :: T_MStatList
sem_MStatList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOcomments :: ([MToken])
_lhsOhasBreaking :: Bool
_lhsOisLast :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: MStatList
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 381 "src/GLua/AG/PrettyPrint.ag" #-}
_renderedComments
{-# LINE 5644 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 382 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 5649 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 383 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5654 "src/GLua/AG/PrettyPrint.hs" #-}
)
_renderedComments =
({-# LINE 384 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent $ fst _commentsBeforeEnd
{-# LINE 5659 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeEnd =
({-# LINE 387 "src/GLua/AG/PrettyPrint.ag" #-}
if _lhsIisHead then ([], _lhsIcomments) else span (\(MToken pos' _tok) -> pos' `beforeEnd` _lhsIstatRegion) _lhsIcomments
{-# LINE 5664 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 388 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBeforeEnd
{-# LINE 5669 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5674 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 281 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5694 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOhasBreaking,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
sem_MaybeMExpr :: MaybeMExpr ->
T_MaybeMExpr
sem_MaybeMExpr :: Maybe MExpr -> T_MaybeMExpr
sem_MaybeMExpr (Prelude.Just MExpr
x) =
(T_MExpr -> T_MaybeMExpr
sem_MaybeMExpr_Just (MExpr -> T_MExpr
sem_MExpr MExpr
x))
sem_MaybeMExpr Maybe MExpr
Prelude.Nothing =
T_MaybeMExpr
sem_MaybeMExpr_Nothing
type T_MaybeMExpr = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MaybeMExpr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_MaybeMExpr = Inh_MaybeMExpr { :: ([MToken]),Inh_MaybeMExpr -> Bool
forceMultiline_Inh_MaybeMExpr :: Bool,Inh_MaybeMExpr -> Int
indent_Inh_MaybeMExpr :: Int,Inh_MaybeMExpr -> PrettyPrintConfig
ppconf_Inh_MaybeMExpr :: PrettyPrintConfig}
data Syn_MaybeMExpr = Syn_MaybeMExpr { :: ([MToken]),Syn_MaybeMExpr -> Maybe MExpr
copy_Syn_MaybeMExpr :: MaybeMExpr,Syn_MaybeMExpr -> Bool
endsWithPrefixExpression_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isAssociative_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isDefined_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isMultiline_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> OperatorLevel
precedence_Syn_MaybeMExpr :: OperatorLevel,Syn_MaybeMExpr -> Doc
pretty_Syn_MaybeMExpr :: Doc}
wrap_MaybeMExpr :: T_MaybeMExpr ->
Inh_MaybeMExpr ->
Syn_MaybeMExpr
wrap_MaybeMExpr :: T_MaybeMExpr -> Inh_MaybeMExpr -> Syn_MaybeMExpr
wrap_MaybeMExpr T_MaybeMExpr
sem (Inh_MaybeMExpr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,Maybe MExpr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisDefined,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MaybeMExpr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> Maybe MExpr
-> Bool
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_MaybeMExpr
Syn_MaybeMExpr [MToken]
_lhsOcomments Maybe MExpr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisDefined Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MaybeMExpr_Just :: T_MExpr ->
T_MaybeMExpr
sem_MaybeMExpr_Just :: T_MExpr -> T_MaybeMExpr
sem_MaybeMExpr_Just T_MExpr
just_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_justOparentOperatorPrecedence :: OperatorLevel
_justOparentOperatorAssociative :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MaybeMExpr
_lhsOcomments :: ([MToken])
_justOcomments :: ([MToken])
_justOforceMultiline :: Bool
_justOindent :: Int
_justOppconf :: PrettyPrintConfig
_justIcomments :: ([MToken])
_justIcopy :: MExpr
_justIendsWithPrefixExpression :: Bool
_justIisAssociative :: Bool
_justIisLiteral :: Bool
_justIisMultiline :: Bool
_justIpos :: Region
_justIprecedence :: OperatorLevel
_justIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 457 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 5752 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 458 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5757 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 459 "src/GLua/AG/PrettyPrint.ag" #-}
_justIendsWithPrefixExpression
{-# LINE 5762 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorPrecedence =
({-# LINE 460 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5767 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorAssociative =
({-# LINE 461 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5772 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisAssociative
{-# LINE 5777 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 5782 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_justIprecedence
{-# LINE 5787 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 5792 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5797 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 5802 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5807 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5812 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5817 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5822 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _justIcomments,_justIcopy,_justIendsWithPrefixExpression,_justIisAssociative,_justIisLiteral,_justIisMultiline,_justIpos,_justIprecedence,_justIpretty) =
just_ _justOcomments _justOforceMultiline _justOindent _justOparentOperatorAssociative _justOparentOperatorPrecedence _justOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_MaybeMExpr_Nothing :: T_MaybeMExpr
sem_MaybeMExpr_Nothing :: T_MaybeMExpr
sem_MaybeMExpr_Nothing =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MaybeMExpr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 463 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 464 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 465 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5854 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5859 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5864 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5869 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 5874 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5879 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5884 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix :: PFExprSuffix ->
T_PFExprSuffix
sem_PFExprSuffix :: PFExprSuffix -> T_PFExprSuffix
sem_PFExprSuffix (Call Args
_args) =
(T_Args -> T_PFExprSuffix
sem_PFExprSuffix_Call (Args -> T_Args
sem_Args Args
_args))
sem_PFExprSuffix (MetaCall MToken
_fn Args
_args) =
(MToken -> T_Args -> T_PFExprSuffix
sem_PFExprSuffix_MetaCall MToken
_fn (Args -> T_Args
sem_Args Args
_args))
sem_PFExprSuffix (ExprIndex MExpr
_index) =
(T_MExpr -> T_PFExprSuffix
sem_PFExprSuffix_ExprIndex (MExpr -> T_MExpr
sem_MExpr MExpr
_index))
sem_PFExprSuffix (DotIndex MToken
_index) =
(MToken -> T_PFExprSuffix
sem_PFExprSuffix_DotIndex MToken
_index)
type T_PFExprSuffix = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),PFExprSuffix,Bool,Bool,OperatorLevel,Doc)
data Inh_PFExprSuffix = Inh_PFExprSuffix { :: ([MToken]),Inh_PFExprSuffix -> Bool
forceMultiline_Inh_PFExprSuffix :: Bool,Inh_PFExprSuffix -> Int
indent_Inh_PFExprSuffix :: Int,Inh_PFExprSuffix -> PrettyPrintConfig
ppconf_Inh_PFExprSuffix :: PrettyPrintConfig}
data Syn_PFExprSuffix = Syn_PFExprSuffix { :: ([MToken]),Syn_PFExprSuffix -> PFExprSuffix
copy_Syn_PFExprSuffix :: PFExprSuffix,Syn_PFExprSuffix -> Bool
isAssociative_Syn_PFExprSuffix :: Bool,Syn_PFExprSuffix -> Bool
isMultiline_Syn_PFExprSuffix :: Bool,Syn_PFExprSuffix -> OperatorLevel
precedence_Syn_PFExprSuffix :: OperatorLevel,Syn_PFExprSuffix -> Doc
pretty_Syn_PFExprSuffix :: Doc}
wrap_PFExprSuffix :: T_PFExprSuffix ->
Inh_PFExprSuffix ->
Syn_PFExprSuffix
wrap_PFExprSuffix :: T_PFExprSuffix -> Inh_PFExprSuffix -> Syn_PFExprSuffix
wrap_PFExprSuffix T_PFExprSuffix
sem (Inh_PFExprSuffix [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,PFExprSuffix
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_PFExprSuffix
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> PFExprSuffix
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_PFExprSuffix
Syn_PFExprSuffix [MToken]
_lhsOcomments PFExprSuffix
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_PFExprSuffix_Call :: T_Args ->
T_PFExprSuffix
sem_PFExprSuffix_Call :: T_Args -> T_PFExprSuffix
sem_PFExprSuffix_Call T_Args
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOindent :: Int
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: Args
_argsIisMultiline :: Bool
_argsIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 717 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIpretty
{-# LINE 5937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 5947 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5952 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Call _argsIcopy
{-# LINE 5957 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5962 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 5967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5977 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5982 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5987 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_MetaCall :: MToken ->
T_Args ->
T_PFExprSuffix
sem_PFExprSuffix_MetaCall :: MToken -> T_Args -> T_PFExprSuffix
sem_PFExprSuffix_MetaCall MToken
fn_ T_Args
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOindent :: Int
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: Args
_argsIisMultiline :: Bool
_argsIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 718 "src/GLua/AG/PrettyPrint.ag" #-}
zchr ':' <> tok fn_ <> _argsIpretty
{-# LINE 6017 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6022 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 6027 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 6032 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
MetaCall fn_ _argsIcopy
{-# LINE 6037 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6042 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 6047 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6052 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6057 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6062 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6067 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_ExprIndex :: T_MExpr ->
T_PFExprSuffix
sem_PFExprSuffix_ExprIndex :: T_MExpr -> T_PFExprSuffix
sem_PFExprSuffix_ExprIndex T_MExpr
index_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_indexOparentOperatorPrecedence :: OperatorLevel
_indexOparentOperatorAssociative :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_indexOcomments :: ([MToken])
_indexOforceMultiline :: Bool
_indexOindent :: Int
_indexOppconf :: PrettyPrintConfig
_indexIcomments :: ([MToken])
_indexIcopy :: MExpr
_indexIendsWithPrefixExpression :: Bool
_indexIisAssociative :: Bool
_indexIisLiteral :: Bool
_indexIisMultiline :: Bool
_indexIpos :: Region
_indexIprecedence :: OperatorLevel
_indexIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 719 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _indexIpretty
{-# LINE 6103 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorPrecedence =
({-# LINE 720 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6108 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorAssociative =
({-# LINE 721 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6113 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisAssociative
{-# LINE 6118 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisMultiline
{-# LINE 6123 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIprecedence
{-# LINE 6128 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ExprIndex _indexIcopy
{-# LINE 6133 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6138 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIcomments
{-# LINE 6143 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6148 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6153 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6158 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6163 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _indexIcomments,_indexIcopy,_indexIendsWithPrefixExpression,_indexIisAssociative,_indexIisLiteral,_indexIisMultiline,_indexIpos,_indexIprecedence,_indexIpretty) =
index_ _indexOcomments _indexOforceMultiline _indexOindent _indexOparentOperatorAssociative _indexOparentOperatorPrecedence _indexOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_DotIndex :: MToken ->
T_PFExprSuffix
sem_PFExprSuffix_DotIndex :: MToken -> T_PFExprSuffix
sem_PFExprSuffix_DotIndex MToken
index_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 722 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '.' <> tok index_
{-# LINE 6184 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6189 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6194 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 6199 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
DotIndex index_
{-# LINE 6204 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6209 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6214 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PrefixExp :: PrefixExp ->
T_PrefixExp
sem_PrefixExp :: PrefixExp -> T_PrefixExp
sem_PrefixExp (PFVar MToken
_name ExprSuffixList
_suffixes) =
(MToken -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_PFVar MToken
_name (ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
_suffixes))
sem_PrefixExp (ExprVar MExpr
_expr ExprSuffixList
_suffixes) =
(T_MExpr -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_ExprVar (MExpr -> T_MExpr
sem_MExpr MExpr
_expr) (ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
_suffixes))
type T_PrefixExp = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),PrefixExp,Bool,Bool,Bool,OperatorLevel,Doc,Bool)
data Inh_PrefixExp = Inh_PrefixExp { :: ([MToken]),Inh_PrefixExp -> Bool
forceMultiline_Inh_PrefixExp :: Bool,Inh_PrefixExp -> Int
indent_Inh_PrefixExp :: Int,Inh_PrefixExp -> Bool
parentOperatorAssociative_Inh_PrefixExp :: Bool,Inh_PrefixExp -> OperatorLevel
parentOperatorPrecedence_Inh_PrefixExp :: OperatorLevel,Inh_PrefixExp -> PrettyPrintConfig
ppconf_Inh_PrefixExp :: PrettyPrintConfig}
data Syn_PrefixExp = Syn_PrefixExp { :: ([MToken]),Syn_PrefixExp -> PrefixExp
copy_Syn_PrefixExp :: PrefixExp,Syn_PrefixExp -> Bool
isAssociative_Syn_PrefixExp :: Bool,Syn_PrefixExp -> Bool
isLiteral_Syn_PrefixExp :: Bool,Syn_PrefixExp -> Bool
isMultiline_Syn_PrefixExp :: Bool,Syn_PrefixExp -> OperatorLevel
precedence_Syn_PrefixExp :: OperatorLevel,Syn_PrefixExp -> Doc
pretty_Syn_PrefixExp :: Doc,Syn_PrefixExp -> Bool
startsWithExprPrefixExpression_Syn_PrefixExp :: Bool}
wrap_PrefixExp :: T_PrefixExp ->
Inh_PrefixExp ->
Syn_PrefixExp
wrap_PrefixExp :: T_PrefixExp -> Inh_PrefixExp -> Syn_PrefixExp
wrap_PrefixExp T_PrefixExp
sem (Inh_PrefixExp [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,PrefixExp
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression) = T_PrefixExp
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> PrefixExp
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Bool
-> Syn_PrefixExp
Syn_PrefixExp [MToken]
_lhsOcomments PrefixExp
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression))
sem_PrefixExp_PFVar :: MToken ->
T_ExprSuffixList ->
T_PrefixExp
sem_PrefixExp_PFVar :: MToken -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_PFVar MToken
name_ T_ExprSuffixList
suffixes_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PrefixExp
_lhsOcomments :: ([MToken])
_suffixesOcomments :: ([MToken])
_suffixesOforceMultiline :: Bool
_suffixesOindent :: Int
_suffixesOppconf :: PrettyPrintConfig
_suffixesIcomments :: ([MToken])
_suffixesIcopy :: ExprSuffixList
_suffixesIisAssociative :: Bool
_suffixesIisMultiline :: Bool
_suffixesIprecedence :: OperatorLevel
_suffixesIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 676 "src/GLua/AG/PrettyPrint.ag" #-}
tok name_ <> _suffixesIpretty
{-# LINE 6272 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 677 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6277 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 678 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6282 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisAssociative
{-# LINE 6287 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisMultiline
{-# LINE 6292 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIprecedence
{-# LINE 6297 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
PFVar name_ _suffixesIcopy
{-# LINE 6302 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6307 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6312 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6317 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6322 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6327 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6332 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) =
suffixes_ _suffixesOcomments _suffixesOforceMultiline _suffixesOindent _suffixesOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_PrefixExp_ExprVar :: T_MExpr ->
T_ExprSuffixList ->
T_PrefixExp
sem_PrefixExp_ExprVar :: T_MExpr -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_ExprVar T_MExpr
expr_ T_ExprSuffixList
suffixes_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisAssociative :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: PrefixExp
_lhsOcomments :: ([MToken])
_exprOcomments :: ([MToken])
_exprOforceMultiline :: Bool
_exprOindent :: Int
_exprOparentOperatorAssociative :: Bool
_exprOparentOperatorPrecedence :: OperatorLevel
_exprOppconf :: PrettyPrintConfig
_suffixesOcomments :: ([MToken])
_suffixesOforceMultiline :: Bool
_suffixesOindent :: Int
_suffixesOppconf :: PrettyPrintConfig
_exprIcomments :: ([MToken])
_exprIcopy :: MExpr
_exprIendsWithPrefixExpression :: Bool
_exprIisAssociative :: Bool
_exprIisLiteral :: Bool
_exprIisMultiline :: Bool
_exprIpos :: Region
_exprIprecedence :: OperatorLevel
_exprIpretty :: Doc
_suffixesIcomments :: ([MToken])
_suffixesIcopy :: ExprSuffixList
_suffixesIisAssociative :: Bool
_suffixesIisMultiline :: Bool
_suffixesIprecedence :: OperatorLevel
_suffixesIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 679 "src/GLua/AG/PrettyPrint.ag" #-}
(if _noparens then _exprIpretty else parens _lhsIppconf NonEmpty _exprIpretty) <> _suffixesIpretty
{-# LINE 6383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 680 "src/GLua/AG/PrettyPrint.ag" #-}
if _noparens then _exprIprecedence else OperatorLevel8
{-# LINE 6388 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 681 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6393 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 682 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6398 "src/GLua/AG/PrettyPrint.hs" #-}
)
_containsParenthesizedExpr =
({-# LINE 686 "src/GLua/AG/PrettyPrint.ag" #-}
case _exprIcopy of
MExpr _ (APrefixExpr (ExprVar (MExpr _ AVarArg) _)) -> False
MExpr _ (APrefixExpr _) -> True
_ -> False
{-# LINE 6406 "src/GLua/AG/PrettyPrint.hs" #-}
)
_noparens =
({-# LINE 691 "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 6418 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative && _suffixesIisAssociative
{-# LINE 6423 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline || _suffixesIisMultiline
{-# LINE 6428 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ExprVar _exprIcopy _suffixesIcopy
{-# LINE 6433 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6438 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6443 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6448 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6453 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6458 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 6463 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 258 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 6468 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6473 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 6478 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6483 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6488 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6493 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _exprIcomments,_exprIcopy,_exprIendsWithPrefixExpression,_exprIisAssociative,_exprIisLiteral,_exprIisMultiline,_exprIpos,_exprIprecedence,_exprIpretty) =
expr_ _exprOcomments _exprOforceMultiline _exprOindent _exprOparentOperatorAssociative _exprOparentOperatorPrecedence _exprOppconf
( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) =
suffixes_ _suffixesOcomments _suffixesOforceMultiline _suffixesOindent _suffixesOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat :: Stat ->
T_Stat
sem_Stat :: Stat -> T_Stat
sem_Stat (Def [(PrefixExp, Maybe MExpr)]
_vars) =
(T_VarsList -> T_Stat
sem_Stat_Def ([(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
_vars))
sem_Stat (LocDef [(PrefixExp, Maybe MExpr)]
_vars) =
(T_VarsList -> T_Stat
sem_Stat_LocDef ([(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
_vars))
sem_Stat (AFuncCall PrefixExp
_fn) =
(T_PrefixExp -> T_Stat
sem_Stat_AFuncCall (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
_fn))
sem_Stat (ALabel MToken
_lbl) =
(MToken -> T_Stat
sem_Stat_ALabel MToken
_lbl)
sem_Stat (Stat
ABreak) =
(T_Stat
sem_Stat_ABreak)
sem_Stat (Stat
AContinue) =
(T_Stat
sem_Stat_AContinue)
sem_Stat (AGoto MToken
_lbl) =
(MToken -> T_Stat
sem_Stat_AGoto MToken
_lbl)
sem_Stat (ADo Block
_body) =
(T_Block -> T_Stat
sem_Stat_ADo (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AWhile MExpr
_cond Block
_body) =
(T_MExpr -> T_Block -> T_Stat
sem_Stat_AWhile (MExpr -> T_MExpr
sem_MExpr MExpr
_cond) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (ARepeat Block
_body MExpr
_cond) =
(T_Block -> T_MExpr -> T_Stat
sem_Stat_ARepeat (Block -> T_Block
sem_Block Block
_body) (MExpr -> T_MExpr
sem_MExpr MExpr
_cond))
sem_Stat (AIf MExpr
_cond Block
_body [MElseIf]
_elifs Maybe MElse
_els) =
(T_MExpr -> T_Block -> T_ElseIfList -> T_Else -> T_Stat
sem_Stat_AIf (MExpr -> T_MExpr
sem_MExpr MExpr
_cond) (Block -> T_Block
sem_Block Block
_body) ([MElseIf] -> T_ElseIfList
sem_ElseIfList [MElseIf]
_elifs) (Maybe MElse -> T_Else
sem_Else Maybe MElse
_els))
sem_Stat (ANFor MToken
_var MExpr
_val MExpr
_to MExpr
_step Block
_body) =
(MToken -> T_MExpr -> T_MExpr -> T_MExpr -> T_Block -> T_Stat
sem_Stat_ANFor MToken
_var (MExpr -> T_MExpr
sem_MExpr MExpr
_val) (MExpr -> T_MExpr
sem_MExpr MExpr
_to) (MExpr -> T_MExpr
sem_MExpr MExpr
_step) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AGFor [MToken]
_vars [MExpr]
_vals Block
_body) =
([MToken] -> T_MExprList -> T_Block -> T_Stat
sem_Stat_AGFor [MToken]
_vars ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_vals) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AFunc FuncName
_name [MToken]
_args Block
_body) =
(T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_AFunc (FuncName -> T_FuncName
sem_FuncName FuncName
_name) [MToken]
_args (Block -> T_Block
sem_Block Block
_body))
sem_Stat (ALocFunc FuncName
_name [MToken]
_args Block
_body) =
(T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_ALocFunc (FuncName -> T_FuncName
sem_FuncName FuncName
_name) [MToken]
_args (Block -> T_Block
sem_Block Block
_body))
type T_Stat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Region ->
Bool ->
( ([MToken]),Stat,Bool,Bool,Bool,Doc,Bool)
data Inh_Stat = Inh_Stat { :: ([MToken]),Inh_Stat -> Bool
forceMultiline_Inh_Stat :: Bool,Inh_Stat -> Int
indent_Inh_Stat :: Int,Inh_Stat -> Bool
isLastStatement_Inh_Stat :: Bool,Inh_Stat -> PrettyPrintConfig
ppconf_Inh_Stat :: PrettyPrintConfig,Inh_Stat -> Region
statRegion_Inh_Stat :: Region,Inh_Stat -> Bool
wouldBeAmbiguousWithoutSemicolon_Inh_Stat :: Bool}
data Syn_Stat = Syn_Stat { :: ([MToken]),Syn_Stat -> Stat
copy_Syn_Stat :: Stat,Syn_Stat -> Bool
endsWithPrefixExpression_Syn_Stat :: Bool,Syn_Stat -> Bool
hasBreaking_Syn_Stat :: Bool,Syn_Stat -> Bool
isMultiline_Syn_Stat :: Bool,Syn_Stat -> Doc
pretty_Syn_Stat :: Doc,Syn_Stat -> Bool
startsWithExprPrefixExpression_Syn_Stat :: Bool}
wrap_Stat :: T_Stat ->
Inh_Stat ->
Syn_Stat
wrap_Stat :: T_Stat -> Inh_Stat -> Syn_Stat
wrap_Stat T_Stat
sem (Inh_Stat [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion Bool
_lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( [MToken]
_lhsOcomments,Stat
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOhasBreaking,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression) = T_Stat
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion Bool
_lhsIwouldBeAmbiguousWithoutSemicolon
in ([MToken] -> Stat -> Bool -> Bool -> Bool -> Doc -> Bool -> Syn_Stat
Syn_Stat [MToken]
_lhsOcomments Stat
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOhasBreaking Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression))
sem_Stat_Def :: T_VarsList ->
T_Stat
sem_Stat_Def :: T_VarsList -> T_Stat
sem_Stat_Def T_VarsList
vars_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_varsOisHead :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_varsOcomments :: ([MToken])
_varsOforceMultiline :: Bool
_varsOindent :: Int
_varsOppconf :: PrettyPrintConfig
_varsIcomments :: ([MToken])
_varsIcopy :: VarsList
_varsIendsWithPrefixExpression :: Bool
_varsIexprPretty :: Doc
_varsIisDefined :: Bool
_varsIisMultiline :: Bool
_varsIpretty :: Doc
_varsIstartsWithExprPrefixExpression :: Bool
_varsIvarPretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 542 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIpretty <> _semicolon
{-# LINE 6585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 543 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 544 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 545 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon then zchr ';' else empty
{-# LINE 6600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOisHead =
({-# LINE 546 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6615 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
Def _varsIcopy
{-# LINE 6620 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6625 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6630 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6635 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6640 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6645 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6650 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _varsIcomments,_varsIcopy,_varsIendsWithPrefixExpression,_varsIexprPretty,_varsIisDefined,_varsIisMultiline,_varsIpretty,_varsIstartsWithExprPrefixExpression,_varsIvarPretty) =
vars_ _varsOcomments _varsOforceMultiline _varsOindent _varsOisHead _varsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_LocDef :: T_VarsList ->
T_Stat
sem_Stat_LocDef :: T_VarsList -> T_Stat
sem_Stat_LocDef T_VarsList
vars_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_varsOisHead :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_varsOcomments :: ([MToken])
_varsOforceMultiline :: Bool
_varsOindent :: Int
_varsOppconf :: PrettyPrintConfig
_varsIcomments :: ([MToken])
_varsIcopy :: VarsList
_varsIendsWithPrefixExpression :: Bool
_varsIexprPretty :: Doc
_varsIisDefined :: Bool
_varsIisMultiline :: Bool
_varsIpretty :: Doc
_varsIstartsWithExprPrefixExpression :: Bool
_varsIvarPretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 547 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "local" <-> _varsIpretty <> _semicolon
{-# LINE 6689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 548 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 549 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 550 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon then zchr ';' else empty
{-# LINE 6704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOisHead =
({-# LINE 551 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
LocDef _varsIcopy
{-# LINE 6724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6739 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6744 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6749 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6754 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _varsIcomments,_varsIcopy,_varsIendsWithPrefixExpression,_varsIexprPretty,_varsIisDefined,_varsIisMultiline,_varsIpretty,_varsIstartsWithExprPrefixExpression,_varsIvarPretty) =
vars_ _varsOcomments _varsOforceMultiline _varsOindent _varsOisHead _varsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AFuncCall :: T_PrefixExp ->
T_Stat
sem_Stat_AFuncCall :: T_PrefixExp -> T_Stat
sem_Stat_AFuncCall T_PrefixExp
fn_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_fnOparentOperatorPrecedence :: OperatorLevel
_fnOparentOperatorAssociative :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_fnOcomments :: ([MToken])
_fnOforceMultiline :: Bool
_fnOindent :: Int
_fnOppconf :: PrettyPrintConfig
_fnIcomments :: ([MToken])
_fnIcopy :: PrefixExp
_fnIisAssociative :: Bool
_fnIisLiteral :: Bool
_fnIisMultiline :: Bool
_fnIprecedence :: OperatorLevel
_fnIpretty :: Doc
_fnIstartsWithExprPrefixExpression :: Bool
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 552 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIpretty <> _semicolon
{-# LINE 6793 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 553 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6798 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 554 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIstartsWithExprPrefixExpression
{-# LINE 6803 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 555 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6808 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorPrecedence =
({-# LINE 556 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6813 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorAssociative =
({-# LINE 557 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6818 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6823 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIisMultiline
{-# LINE 6828 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AFuncCall _fnIcopy
{-# LINE 6833 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6838 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIcomments
{-# LINE 6843 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6848 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6853 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6858 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6863 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _fnIcomments,_fnIcopy,_fnIisAssociative,_fnIisLiteral,_fnIisMultiline,_fnIprecedence,_fnIpretty,_fnIstartsWithExprPrefixExpression) =
fn_ _fnOcomments _fnOforceMultiline _fnOindent _fnOparentOperatorAssociative _fnOparentOperatorPrecedence _fnOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ALabel :: MToken ->
T_Stat
sem_Stat_ALabel :: MToken -> T_Stat
sem_Stat_ALabel MToken
lbl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 558 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "::" <> _whitespace <> tok lbl_ <> _whitespace <> zeroWidthText "::"
{-# LINE 6888 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 559 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6893 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 560 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6898 "src/GLua/AG/PrettyPrint.hs" #-}
)
_whitespace =
({-# LINE 561 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterLabel _lhsIppconf then zeroWidthText " " else empty
{-# LINE 6903 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6908 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6913 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ALabel lbl_
{-# LINE 6918 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6923 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6928 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ABreak :: T_Stat
sem_Stat_ABreak :: T_Stat
sem_Stat_ABreak =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 562 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "break" <> _semicolon
{-# LINE 6950 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 563 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6955 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 564 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6960 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 565 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6965 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 566 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6970 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6975 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ABreak
{-# LINE 6980 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6985 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6990 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AContinue :: T_Stat
sem_Stat_AContinue :: T_Stat
sem_Stat_AContinue =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 567 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "continue" <> _semicolon
{-# LINE 7012 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 568 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7017 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 569 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7022 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 570 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 7027 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 571 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7032 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7037 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AContinue
{-# LINE 7042 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7047 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7052 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AGoto :: MToken ->
T_Stat
sem_Stat_AGoto :: MToken -> T_Stat
sem_Stat_AGoto MToken
lbl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 572 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "goto" <-> tok lbl_ <> _semicolon
{-# LINE 7075 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 573 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7080 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 574 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7085 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 575 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 7090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 306 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AGoto lbl_
{-# LINE 7105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7115 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ADo :: T_Block ->
T_Stat
sem_Stat_ADo :: T_Block -> T_Stat
sem_Stat_ADo T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 577 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7149 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 578 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7154 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 579 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7159 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 580 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7164 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 581 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7169 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 582 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7174 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ADo _bodyIcopy
{-# LINE 7179 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7184 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7189 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7194 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7199 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7204 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7209 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AWhile :: T_MExpr ->
T_Block ->
T_Stat
sem_Stat_AWhile :: T_MExpr -> T_Block -> T_Stat
sem_Stat_AWhile T_MExpr
cond_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_condOcomments :: ([MToken])
_condOforceMultiline :: Bool
_condOindent :: Int
_condOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_condIcomments :: ([MToken])
_condIcopy :: MExpr
_condIendsWithPrefixExpression :: Bool
_condIisAssociative :: Bool
_condIisLiteral :: Bool
_condIisMultiline :: Bool
_condIpos :: Region
_condIprecedence :: OperatorLevel
_condIpretty :: Doc
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 583 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 584 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 585 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 586 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7276 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 587 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7281 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 588 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "while" <-> _condIpretty <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7286 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 589 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7291 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 590 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7296 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AWhile _condIcopy _bodyIcopy
{-# LINE 7301 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7306 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7311 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7316 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7321 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7326 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7331 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7336 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7341 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7346 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7351 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ARepeat :: T_Block ->
T_MExpr ->
T_Stat
sem_Stat_ARepeat :: T_Block -> T_MExpr -> T_Stat
sem_Stat_ARepeat T_Block
body_ T_MExpr
cond_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_condOcomments :: ([MToken])
_condOforceMultiline :: Bool
_condOindent :: Int
_condOppconf :: PrettyPrintConfig
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_condIcomments :: ([MToken])
_condIcopy :: MExpr
_condIendsWithPrefixExpression :: Bool
_condIisAssociative :: Bool
_condIisLiteral :: Bool
_condIisMultiline :: Bool
_condIpos :: Region
_condIprecedence :: OperatorLevel
_condIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 591 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "repeat" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "until" <-> _condIpretty)
{-# LINE 7405 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 592 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7410 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 593 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7415 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 594 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7420 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 595 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7425 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 596 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7430 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 597 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7435 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIisMultiline || _condIisMultiline
{-# LINE 7440 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ARepeat _bodyIcopy _condIcopy
{-# LINE 7445 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7450 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7455 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7460 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7465 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7470 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7475 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7480 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7485 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7490 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7495 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AIf :: T_MExpr ->
T_Block ->
T_ElseIfList ->
T_Else ->
T_Stat
sem_Stat_AIf :: T_MExpr -> T_Block -> T_ElseIfList -> T_Else -> T_Stat
sem_Stat_AIf T_MExpr
cond_ T_Block
body_ T_ElseIfList
elifs_ T_Else
els_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_bodyOindent :: Int
_bodyOstatRegion :: Region
_lhsOpretty :: Doc
_lhsOhasBreaking :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_condOcomments :: ([MToken])
_condOforceMultiline :: Bool
_condOindent :: Int
_condOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_elifsOcomments :: ([MToken])
_elifsOforceMultiline :: Bool
_elifsOindent :: Int
_elifsOppconf :: PrettyPrintConfig
_elsOcomments :: ([MToken])
_elsOforceMultiline :: Bool
_elsOindent :: Int
_elsOppconf :: PrettyPrintConfig
_elsOstatRegion :: Region
_condIcomments :: ([MToken])
_condIcopy :: MExpr
_condIendsWithPrefixExpression :: Bool
_condIisAssociative :: Bool
_condIisLiteral :: Bool
_condIisMultiline :: Bool
_condIpos :: Region
_condIprecedence :: OperatorLevel
_condIpretty :: Doc
_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 :: Bool
_isMultiline =
({-# LINE 598 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _condIisMultiline || _bodyIisMultiline || _bodyIstatementCount > 1 || (_bodyIstatementCount == 1 && not _bodyIhasBreaking) || _elifsIelsesExist || _elsIelsesExist
{-# LINE 7572 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 600 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7577 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 601 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7582 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 602 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if" <-> _condIpretty <-> zeroWidthText "then" <-> _bodyIpretty <-> zeroWidthText "end"
{-# LINE 7587 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 603 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if" <-> _condIpretty <-> zeroWidthText "then" $+$ _bodyIpretty $+$ _elifsIpretty $+$ _elsIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7592 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 604 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7597 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 605 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7602 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 606 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 7607 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 607 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion `upto` _elifsIpos `upto` _elsIpos
{-# LINE 7612 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 608 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 7617 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 609 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7622 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 7627 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AIf _condIcopy _bodyIcopy _elifsIcopy _elsIcopy
{-# LINE 7632 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7637 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_elsIcomments
{-# LINE 7642 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7647 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7652 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7657 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7662 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7667 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7672 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7677 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7682 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7687 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7692 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7697 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_elifsIcomments
{-# LINE 7702 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7707 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7712 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7717 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7722 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
( _elifsIcomments,_elifsIcopy,_elifsIelsesExist,_elifsIisMultiline,_elifsIpos,_elifsIpretty) =
elifs_ _elifsOcomments _elifsOforceMultiline _elifsOindent _elifsOppconf
( _elsIcomments,_elsIcopy,_elsIelsesExist,_elsIisMultiline,_elsIpos,_elsIpretty) =
els_ _elsOcomments _elsOforceMultiline _elsOindent _elsOppconf _elsOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ANFor :: MToken ->
T_MExpr ->
T_MExpr ->
T_MExpr ->
T_Block ->
T_Stat
sem_Stat_ANFor :: MToken -> T_MExpr -> T_MExpr -> T_MExpr -> T_Block -> T_Stat
sem_Stat_ANFor MToken
var_ T_MExpr
val_ T_MExpr
to_ T_MExpr
step_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_valOparentOperatorPrecedence :: OperatorLevel
_valOparentOperatorAssociative :: Bool
_toOparentOperatorPrecedence :: OperatorLevel
_toOparentOperatorAssociative :: Bool
_stepOparentOperatorPrecedence :: OperatorLevel
_stepOparentOperatorAssociative :: Bool
_bodyOindent :: Int
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_valOcomments :: ([MToken])
_valOforceMultiline :: Bool
_valOindent :: Int
_valOppconf :: PrettyPrintConfig
_toOcomments :: ([MToken])
_toOforceMultiline :: Bool
_toOindent :: Int
_toOppconf :: PrettyPrintConfig
_stepOcomments :: ([MToken])
_stepOforceMultiline :: Bool
_stepOindent :: Int
_stepOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_valIcomments :: ([MToken])
_valIcopy :: MExpr
_valIendsWithPrefixExpression :: Bool
_valIisAssociative :: Bool
_valIisLiteral :: Bool
_valIisMultiline :: Bool
_valIpos :: Region
_valIprecedence :: OperatorLevel
_valIpretty :: Doc
_toIcomments :: ([MToken])
_toIcopy :: MExpr
_toIendsWithPrefixExpression :: Bool
_toIisAssociative :: Bool
_toIisLiteral :: Bool
_toIisMultiline :: Bool
_toIpos :: Region
_toIprecedence :: OperatorLevel
_toIpretty :: Doc
_stepIcomments :: ([MToken])
_stepIcopy :: MExpr
_stepIendsWithPrefixExpression :: Bool
_stepIisAssociative :: Bool
_stepIisLiteral :: Bool
_stepIisMultiline :: Bool
_stepIpos :: Region
_stepIprecedence :: OperatorLevel
_stepIpretty :: Doc
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIhasBreaking :: Bool
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 610 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7813 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 611 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7818 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 612 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7823 "src/GLua/AG/PrettyPrint.hs" #-}
)
_step =
({-# LINE 613 "src/GLua/AG/PrettyPrint.ag" #-}
case _stepIcopy of
MExpr _ (ANumber "1") -> empty
_ -> _comma <> _stepIpretty
{-# LINE 7830 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 616 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "for" <-> tok var_ <-> zchr '=' <-> _valIpretty <> _comma <> _toIpretty <> _step <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7835 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 617 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 7840 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorPrecedence =
({-# LINE 618 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7845 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorAssociative =
({-# LINE 619 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7850 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorPrecedence =
({-# LINE 620 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7855 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorAssociative =
({-# LINE 621 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7860 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorPrecedence =
({-# LINE 622 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7865 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorAssociative =
({-# LINE 623 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7870 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 624 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7875 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 625 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7880 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ANFor var_ _valIcopy _toIcopy _stepIcopy _bodyIcopy
{-# LINE 7885 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7890 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7895 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7900 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7905 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7910 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7915 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_valIcomments
{-# LINE 7920 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7925 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7930 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7935 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_toIcomments
{-# LINE 7940 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7945 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7950 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7955 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_stepIcomments
{-# LINE 7960 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7965 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7970 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7975 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valIcomments,_valIcopy,_valIendsWithPrefixExpression,_valIisAssociative,_valIisLiteral,_valIisMultiline,_valIpos,_valIprecedence,_valIpretty) =
val_ _valOcomments _valOforceMultiline _valOindent _valOparentOperatorAssociative _valOparentOperatorPrecedence _valOppconf
( _toIcomments,_toIcopy,_toIendsWithPrefixExpression,_toIisAssociative,_toIisLiteral,_toIisMultiline,_toIpos,_toIprecedence,_toIpretty) =
to_ _toOcomments _toOforceMultiline _toOindent _toOparentOperatorAssociative _toOparentOperatorPrecedence _toOppconf
( _stepIcomments,_stepIcopy,_stepIendsWithPrefixExpression,_stepIisAssociative,_stepIisLiteral,_stepIisMultiline,_stepIpos,_stepIprecedence,_stepIpretty) =
step_ _stepOcomments _stepOforceMultiline _stepOindent _stepOparentOperatorAssociative _stepOparentOperatorPrecedence _stepOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AGFor :: ([MToken]) ->
T_MExprList ->
T_Block ->
T_Stat
sem_Stat_AGFor :: [MToken] -> T_MExprList -> T_Block -> T_Stat
sem_Stat_AGFor [MToken]
vars_ T_MExprList
vals_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_valsOisHead :: Bool
_valsOforceMultiline :: Bool
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_valsOcomments :: ([MToken])
_valsOindent :: Int
_valsOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_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 :: Bool
_lhsOisMultiline =
({-# LINE 626 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8031 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 627 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8036 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 628 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8041 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 629 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "for" <-> printList tok (render _comma ) vars_ <-> zeroWidthText "in" <-> _valsIpretty <-> zeroWidthText "do" $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8046 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 630 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8051 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 631 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8056 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOisHead =
({-# LINE 632 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8061 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOforceMultiline =
({-# LINE 634 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8066 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 635 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8071 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AGFor vars_ _valsIcopy _bodyIcopy
{-# LINE 8076 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8081 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8086 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8091 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8096 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8101 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_valsIcomments
{-# LINE 8106 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8111 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8116 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8121 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valsIcomments,_valsIcopy,_valsIisAssociative,_valsIisMultiline,_valsIpos,_valsIprecedence,_valsIpretty) =
vals_ _valsOcomments _valsOforceMultiline _valsOindent _valsOisHead _valsOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AFunc :: T_FuncName ->
([MToken]) ->
T_Block ->
T_Stat
sem_Stat_AFunc :: T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_AFunc T_FuncName
name_ [MToken]
args_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_nameOcomments :: ([MToken])
_nameOindent :: Int
_nameOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_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 :: Bool
_lhsOisMultiline =
({-# LINE 636 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8168 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 637 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8173 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 638 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8178 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 639 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function" <-> _nameIpretty <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8183 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 640 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8188 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 641 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8193 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 642 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8198 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 643 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8203 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8208 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8213 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8218 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8223 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8228 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8233 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8238 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8243 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8248 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8253 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ALocFunc :: T_FuncName ->
([MToken]) ->
T_Block ->
T_Stat
sem_Stat_ALocFunc :: T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_ALocFunc T_FuncName
name_ [MToken]
args_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOhasBreaking :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_nameOcomments :: ([MToken])
_nameOindent :: Int
_nameOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_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 :: Bool
_lhsOisMultiline =
({-# LINE 644 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8300 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 645 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "local function" <-> _nameIpretty <> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_) $+$ _bodyIpretty $+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8305 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 646 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8310 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 647 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8315 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 648 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8320 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 649 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8325 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 650 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8330 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOhasBreaking =
({-# LINE 651 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8335 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ALocFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8365 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8370 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8375 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8380 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 312 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8385 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIhasBreaking,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOhasBreaking,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_UnOp :: UnOp ->
T_UnOp
sem_UnOp :: UnOp -> T_UnOp
sem_UnOp (UnOp
UnMinus) =
(T_UnOp
sem_UnOp_UnMinus)
sem_UnOp (UnOp
ANot) =
(T_UnOp
sem_UnOp_ANot)
sem_UnOp (UnOp
AHash) =
(T_UnOp
sem_UnOp_AHash)
type T_UnOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),UnOp,Bool,Doc)
data Inh_UnOp = Inh_UnOp { :: ([MToken]),Inh_UnOp -> Int
indent_Inh_UnOp :: Int,Inh_UnOp -> PrettyPrintConfig
ppconf_Inh_UnOp :: PrettyPrintConfig}
data Syn_UnOp = Syn_UnOp { :: ([MToken]),Syn_UnOp -> UnOp
copy_Syn_UnOp :: UnOp,Syn_UnOp -> Bool
isMultiline_Syn_UnOp :: Bool,Syn_UnOp -> Doc
pretty_Syn_UnOp :: Doc}
wrap_UnOp :: T_UnOp ->
Inh_UnOp ->
Syn_UnOp
wrap_UnOp :: T_UnOp -> Inh_UnOp -> Syn_UnOp
wrap_UnOp T_UnOp
sem (Inh_UnOp [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,UnOp
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_UnOp
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> UnOp -> Bool -> Doc -> Syn_UnOp
Syn_UnOp [MToken]
_lhsOcomments UnOp
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_UnOp_UnMinus :: T_UnOp
sem_UnOp_UnMinus :: T_UnOp
sem_UnOp_UnMinus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 877 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 8427 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8432 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
UnMinus
{-# LINE 8437 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8442 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8447 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_ANot :: T_UnOp
sem_UnOp_ANot :: T_UnOp
sem_UnOp_ANot =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 878 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!" else "not ")
{-# LINE 8462 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8467 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
ANot
{-# LINE 8472 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8477 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8482 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_AHash :: T_UnOp
sem_UnOp_AHash :: T_UnOp
sem_UnOp_AHash =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 879 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "#"
{-# LINE 8497 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8502 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
AHash
{-# LINE 8507 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8512 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8517 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_VarsList :: VarsList ->
T_VarsList
sem_VarsList :: [(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Declaration -> T_VarsList -> T_VarsList
sem_VarsList_Cons T_VarsList
sem_VarsList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map (PrefixExp, Maybe MExpr) -> T_Declaration
sem_Declaration [(PrefixExp, Maybe MExpr)]
list))
type T_VarsList = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
( ([MToken]),VarsList,Bool,Doc,Bool,Bool,Doc,Bool,Doc)
data Inh_VarsList = Inh_VarsList { :: ([MToken]),Inh_VarsList -> Bool
forceMultiline_Inh_VarsList :: Bool,Inh_VarsList -> Int
indent_Inh_VarsList :: Int,Inh_VarsList -> Bool
isHead_Inh_VarsList :: Bool,Inh_VarsList -> PrettyPrintConfig
ppconf_Inh_VarsList :: PrettyPrintConfig}
data Syn_VarsList = Syn_VarsList { :: ([MToken]),Syn_VarsList -> [(PrefixExp, Maybe MExpr)]
copy_Syn_VarsList :: VarsList,Syn_VarsList -> Bool
endsWithPrefixExpression_Syn_VarsList :: Bool,Syn_VarsList -> Doc
exprPretty_Syn_VarsList :: Doc,Syn_VarsList -> Bool
isDefined_Syn_VarsList :: Bool,Syn_VarsList -> Bool
isMultiline_Syn_VarsList :: Bool,Syn_VarsList -> Doc
pretty_Syn_VarsList :: Doc,Syn_VarsList -> Bool
startsWithExprPrefixExpression_Syn_VarsList :: Bool,Syn_VarsList -> Doc
varPretty_Syn_VarsList :: Doc}
wrap_VarsList :: T_VarsList ->
Inh_VarsList ->
Syn_VarsList
wrap_VarsList :: T_VarsList -> Inh_VarsList -> Syn_VarsList
wrap_VarsList T_VarsList
sem (Inh_VarsList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,[(PrefixExp, Maybe MExpr)]
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Doc
_lhsOexprPretty,Bool
_lhsOisDefined,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Doc
_lhsOvarPretty) = T_VarsList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisHead PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> [(PrefixExp, Maybe MExpr)]
-> Bool
-> Doc
-> Bool
-> Bool
-> Doc
-> Bool
-> Doc
-> Syn_VarsList
Syn_VarsList [MToken]
_lhsOcomments [(PrefixExp, Maybe MExpr)]
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Doc
_lhsOexprPretty Bool
_lhsOisDefined Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Doc
_lhsOvarPretty))
sem_VarsList_Cons :: T_Declaration ->
T_VarsList ->
T_VarsList
sem_VarsList_Cons :: T_Declaration -> T_VarsList -> T_VarsList
sem_VarsList_Cons T_Declaration
hd_ T_VarsList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_tlOisHead :: Bool
_lhsOexprPretty :: Doc
_lhsOisDefined :: Bool
_lhsOisMultiline :: Bool
_lhsOvarPretty :: Doc
_lhsOcopy :: VarsList
_lhsOcomments :: ([MToken])
_hdOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_hdIcomments :: ([MToken])
_hdIcopy :: Declaration
_hdIendsWithPrefixExpression :: Bool
_hdIexprPretty :: Doc
_hdIisDefined :: Bool
_hdIisMultiline :: Bool
_hdIpretty :: Doc
_hdIstartsWithExprPrefixExpression :: Bool
_hdIvarPretty :: Doc
_tlIcomments :: ([MToken])
_tlIcopy :: VarsList
_tlIendsWithPrefixExpression :: Bool
_tlIexprPretty :: Doc
_tlIisDefined :: Bool
_tlIisMultiline :: Bool
_tlIpretty :: Doc
_tlIstartsWithExprPrefixExpression :: Bool
_tlIvarPretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 476 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty <-> if _isDefined then zchr '=' <-> _exprPretty else empty
{-# LINE 8589 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 477 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 8594 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 478 "src/GLua/AG/PrettyPrint.ag" #-}
if _tlIisDefined then _tlIendsWithPrefixExpression else _hdIendsWithPrefixExpression
{-# LINE 8599 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isDefined =
({-# LINE 485 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisDefined || _tlIisDefined
{-# LINE 8604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varPretty =
({-# LINE 486 "src/GLua/AG/PrettyPrint.ag" #-}
(if _lhsIisHead then empty else _comma ) <> _hdIvarPretty <> _tlIvarPretty
{-# LINE 8609 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprPretty =
({-# LINE 487 "src/GLua/AG/PrettyPrint.ag" #-}
(if _lhsIisHead || not _hdIisDefined then empty else _comma ) <> _hdIexprPretty <> _tlIexprPretty
{-# LINE 8614 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 488 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ',' <> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8619 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOisHead =
({-# LINE 489 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8624 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 272 "src/GLua/AG/PrettyPrint.ag" #-}
_exprPretty
{-# LINE 8629 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_isDefined
{-# LINE 8634 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 8639 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty
{-# LINE 8644 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 8649 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8654 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 8659 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8664 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8669 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8674 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 8684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 344 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8699 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIexprPretty,_hdIisDefined,_hdIisMultiline,_hdIpretty,_hdIstartsWithExprPrefixExpression,_hdIvarPretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIendsWithPrefixExpression,_tlIexprPretty,_tlIisDefined,_tlIisMultiline,_tlIpretty,_tlIstartsWithExprPrefixExpression,_tlIvarPretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOisHead _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))
sem_VarsList_Nil :: T_VarsList
sem_VarsList_Nil :: T_VarsList
sem_VarsList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisHead
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOexprPretty :: Doc
_lhsOisDefined :: Bool
_lhsOisMultiline :: Bool
_lhsOvarPretty :: Doc
_lhsOcopy :: VarsList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 491 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8725 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 492 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8730 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 493 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8735 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 272 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8740 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8745 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8750 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 271 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8755 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 8760 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8765 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 290 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8770 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))