glualint-1.29.0: src/GLua/AG/PrettyPrint.hs
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- UUAGC 0.9.56 (src/GLua/AG/PrettyPrint.ag)
module GLua.AG.PrettyPrint where
{-# LINE 9 "src/GLua/AG/AST.ag" #-}
import GLua.AG.Token
import GLua.Position
import GLua.TokenTypes ()
import Data.Aeson
{-# LINE 14 "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 GLua.Position
import Text.PrettyPrint hiding (parens, brackets, braces)
import GLua.TokenTypes
import Data.Maybe
import Text.Parsec
import Text.Parsec.Error
import Debug.Trace
{-# LINE 28 "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
-- | Render comments on multiple lines
renderMLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc
renderMLComments conf ind toks =
foldl' ($+$) empty . map (indent conf ind . tok . convertComment conf) $ toks
-- | Render comments, and prefer having them on a single line. It may not print comments on the same
-- line if that would cause a syntax error (e.g. a multiline comment after a single line comment)
renderSLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc
renderSLComments conf ind toks = foldl' combine empty . map (convertComment conf) $ toks
where
combine :: Doc -> MToken -> Doc
combine acc mt@(MToken _pos t) =
case t of
-- Block comments after single line comments cannot be printed on the same line, as that
-- would cause a syntax error, e.g. in this case:
-- foo = { -- single line comment
-- --[[multiline
-- comment
-- ]]
-- }
-- Make sure in these cases the comment is printed on a new line, rather than on the
-- same line
DashBlockComment _depth comment | '\n' `elem` comment ->
acc $+$ (indent conf ind $ tok mt)
SlashBlockComment comment | '\n' `elem` comment ->
acc $+$ (indent conf ind $ tok mt)
_ -> acc <-> tok mt
convertComment :: PrettyPrintConfig -> MToken -> MToken
convertComment conf (MToken p t) = MToken p $ convert' t
where
convert' :: Token -> Token
convert' = if cStyle conf then cComment else luaComment
luaComment :: Token -> Token
luaComment (SlashComment s) = DashComment s
luaComment (SlashBlockComment s) = DashBlockComment (lastBracket s) s
luaComment t' = t'
-- converting /*]*/ would end up in --[[]]] when plainly converted
-- Deepen the block comment by 1 if that's the case
lastBracket :: String -> Int
lastBracket [] = 0
lastBracket s = if last s == ']' then 1 else 0
cComment :: Token -> Token
cComment (DashComment s) = SlashComment s
cComment (DashBlockComment _ s) = SlashBlockComment s
cComment t' = t'
indent :: PrettyPrintConfig -> Int -> Doc -> Doc
indent conf n = (<>) $ zeroWidthText (concat . replicate n $ indentation conf)
parens :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc
parens conf ie doc = zchr '(' `sep'` doc `sep'` zchr ')'
where
sep' :: Doc -> Doc -> Doc
sep' =
if spaceAfterParens conf && (not (fromEmpty ie) || spaceEmptyParens conf)
then (<->)
else (<>)
brackets :: PrettyPrintConfig -> Doc -> Doc
brackets conf doc = zchr '[' `sep'` doc `sep'` zchr ']'
where
sep' :: Doc -> Doc -> Doc
sep' = if spaceAfterBrackets conf then (<->) else (<>)
braces :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc
braces conf ie doc = zchr '{' `sep'` doc `sep'` zchr '}'
where
sep' :: Doc -> Doc -> Doc
sep' =
if spaceAfterBraces conf && (not (fromEmpty ie) || spaceEmptyBraces conf)
then (<->)
else (<>)
-- Zero width char
zchr :: Char -> Doc
zchr c = zeroWidthText [c]
-- Zero width <+>
infixl 6 <->
(<->) :: Doc -> Doc -> Doc
a <-> b | a == empty = b
| b == empty = a
| otherwise = a <> zchr ' ' <> b
-- Operator levels, where level 1 is the lowest level, and level 8 is the highest one
-- See http://www.lua.org/manual/5.2/manual.html#3.4.7
data OperatorLevel
-- At the top level, there is no assigned operator level yet. This serves as a bottom value.
= TopLevelExpression
| OperatorLevel1
| OperatorLevel2
| OperatorLevel3
| OperatorLevel4
| OperatorLevel5
| OperatorLevel6
| OperatorLevel7
| OperatorLevel8
deriving (Eq, Ord)
-- | Returns true when any of the comments contain the string "format: multiline"
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 1212 "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 436 "src/GLua/AG/PrettyPrint.hs" #-}
-- AReturn -----------------------------------------------------
-- cata
sem_AReturn :: AReturn ->
T_AReturn
sem_AReturn (AReturn _pos _values) =
(sem_AReturn_AReturn _pos (sem_MExprList _values))
sem_AReturn (NoReturn) =
(sem_AReturn_NoReturn)
-- semantic domain
type T_AReturn = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),AReturn,Bool,Doc,Int)
data Inh_AReturn = Inh_AReturn {comments_Inh_AReturn :: ([MToken]),forceMultiline_Inh_AReturn :: Bool,indent_Inh_AReturn :: Int,ppconf_Inh_AReturn :: PrettyPrintConfig}
data Syn_AReturn = Syn_AReturn {comments_Syn_AReturn :: ([MToken]),copy_Syn_AReturn :: AReturn,isMultiline_Syn_AReturn :: Bool,pretty_Syn_AReturn :: Doc,statementCount_Syn_AReturn :: Int}
wrap_AReturn :: T_AReturn ->
Inh_AReturn ->
Syn_AReturn
wrap_AReturn sem (Inh_AReturn _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_AReturn _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty _lhsOstatementCount))
sem_AReturn_AReturn :: Region ->
T_MExprList ->
T_AReturn
sem_AReturn_AReturn pos_ values_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_valuesOcomments :: ([MToken])
_lhsOcomments :: ([MToken])
_valuesOforceMultiline :: Bool
_valuesOsomeElementsInListAreMultiline :: Bool
_lhsOstatementCount :: Int
_lhsOcopy :: AReturn
_valuesOindent :: Int
_valuesOppconf :: PrettyPrintConfig
_valuesIcomments :: ([MToken])
_valuesIcopy :: MExprList
_valuesIisAssociative :: Bool
_valuesIisLast :: Bool
_valuesIisMultiline :: Bool
_valuesIpos :: Region
_valuesIprecedence :: OperatorLevel
_valuesIpretty :: Doc
_valuesIstartsWithNewline :: Bool
_lhsOpretty =
({-# LINE 869 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "return")
`_sep ` _valuesIpretty
<> _semicolon
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 493 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 875 "src/GLua/AG/PrettyPrint.ag" #-}
_valuesIisMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 500 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sep =
({-# LINE 879 "src/GLua/AG/PrettyPrint.ag" #-}
if _valuesIstartsWithNewline then (<>) else (<->)
{-# LINE 505 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 880 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 510 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 881 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `before` pos_) _lhsIcomments
{-# LINE 515 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOcomments =
({-# LINE 882 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBefore
{-# LINE 520 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 883 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` (rgOr _valuesIpos pos_)) _valuesIcomments
{-# LINE 525 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 885 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 530 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOforceMultiline =
({-# LINE 889 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 535 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOsomeElementsInListAreMultiline =
({-# LINE 890 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 540 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 891 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 545 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AReturn pos_ _valuesIcopy
{-# LINE 550 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 555 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 560 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 565 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valuesIcomments,_valuesIcopy,_valuesIisAssociative,_valuesIisLast,_valuesIisMultiline,_valuesIpos,_valuesIprecedence,_valuesIpretty,_valuesIstartsWithNewline) =
values_ _valuesOcomments _valuesOforceMultiline _valuesOindent _valuesOppconf _valuesOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_AReturn_NoReturn :: T_AReturn
sem_AReturn_NoReturn =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOcopy :: AReturn
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 893 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 584 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 894 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 589 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 895 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 594 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
NoReturn
{-# LINE 599 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 609 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
-- AST ---------------------------------------------------------
-- cata
sem_AST :: AST ->
T_AST
sem_AST (AST _comments _chunk) =
(sem_AST_AST _comments (sem_Block _chunk))
-- semantic domain
type T_AST = Int ->
PrettyPrintConfig ->
( AST,Bool,Doc)
data Inh_AST = Inh_AST {indent_Inh_AST :: Int,ppconf_Inh_AST :: PrettyPrintConfig}
data Syn_AST = Syn_AST {copy_Syn_AST :: AST,isMultiline_Syn_AST :: Bool,pretty_Syn_AST :: Doc}
wrap_AST :: T_AST ->
Inh_AST ->
Syn_AST
wrap_AST sem (Inh_AST _lhsIindent _lhsIppconf) =
(let ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIindent _lhsIppconf
in (Syn_AST _lhsOcopy _lhsOisMultiline _lhsOpretty))
sem_AST_AST :: ([MToken]) ->
T_Block ->
T_AST
sem_AST_AST comments_ chunk_ =
(\ _lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_chunkOcomments :: ([MToken])
_chunkOstatRegion :: Region
_chunkOforceMultiline :: Bool
_lhsOcopy :: AST
_chunkOindent :: Int
_chunkOppconf :: PrettyPrintConfig
_chunkIcomments :: ([MToken])
_chunkIcopy :: Block
_chunkIisMultiline :: Bool
_chunkIpos :: Region
_chunkIpretty :: Doc
_chunkIstatementCount :: Int
_lhsOpretty =
({-# LINE 624 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIpretty $+$ _prettyComments
{-# LINE 653 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 625 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIisMultiline
{-# LINE 658 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyComments =
({-# LINE 626 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent _chunkIcomments
{-# LINE 663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOcomments =
({-# LINE 627 "src/GLua/AG/PrettyPrint.ag" #-}
comments_
{-# LINE 668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOstatRegion =
({-# LINE 628 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 673 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOforceMultiline =
({-# LINE 629 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 678 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AST comments_ _chunkIcopy
{-# LINE 683 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 688 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 693 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 698 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _chunkIcomments,_chunkIcopy,_chunkIisMultiline,_chunkIpos,_chunkIpretty,_chunkIstatementCount) =
chunk_ _chunkOcomments _chunkOforceMultiline _chunkOindent _chunkOppconf _chunkOstatRegion
in ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
-- Args --------------------------------------------------------
-- cata
sem_Args :: Args ->
T_Args
sem_Args (ListArgs _args) =
(sem_Args_ListArgs (sem_MExprList _args))
sem_Args (TableArg _arg) =
(sem_Args_TableArg (sem_FieldList _arg))
sem_Args (StringArg _arg) =
(sem_Args_StringArg _arg)
-- semantic domain
type T_Args = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Args,Bool,Doc)
data Inh_Args = Inh_Args {comments_Inh_Args :: ([MToken]),forceMultiline_Inh_Args :: Bool,indent_Inh_Args :: Int,ppconf_Inh_Args :: PrettyPrintConfig}
data Syn_Args = Syn_Args {comments_Syn_Args :: ([MToken]),copy_Syn_Args :: Args,isMultiline_Syn_Args :: Bool,pretty_Syn_Args :: Doc}
wrap_Args :: T_Args ->
Inh_Args ->
Syn_Args
wrap_Args sem (Inh_Args _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_Args _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty))
sem_Args_ListArgs :: T_MExprList ->
T_Args
sem_Args_ListArgs args_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_argsOindent :: Int
_argsOsomeElementsInListAreMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: MExprList
_argsIisAssociative :: Bool
_argsIisLast :: Bool
_argsIisMultiline :: Bool
_argsIpos :: Region
_argsIprecedence :: OperatorLevel
_argsIpretty :: Doc
_argsIstartsWithNewline :: Bool
_lhsOpretty =
({-# LINE 1068 "src/GLua/AG/PrettyPrint.ag" #-}
if _lhsIforceMultiline then
zchr '(' $+$
_argsIpretty $+$
indent _lhsIppconf _lhsIindent (zchr ')')
else
parens _lhsIppconf _emptyParams _argsIpretty
{-# LINE 760 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1075 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 765 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 1076 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argsIcopy
{-# LINE 770 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 1077 "src/GLua/AG/PrettyPrint.ag" #-}
if _lhsIforceMultiline then _lhsIindent + 1 else _lhsIindent
{-# LINE 775 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOsomeElementsInListAreMultiline =
({-# LINE 1078 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 780 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ListArgs _argsIcopy
{-# LINE 785 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 790 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 795 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 800 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 805 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 810 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisAssociative,_argsIisLast,_argsIisMultiline,_argsIpos,_argsIprecedence,_argsIpretty,_argsIstartsWithNewline) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf _argsOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args_TableArg :: T_FieldList ->
T_Args
sem_Args_TableArg arg_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_argOindent :: Int
_argOsomeElementsInListAreMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_argOcomments :: ([MToken])
_argOforceMultiline :: Bool
_argOppconf :: PrettyPrintConfig
_argIcomments :: ([MToken])
_argIcopy :: FieldList
_argIisMultiline :: Bool
_argIisNil :: Bool
_argIpretty :: Doc
_lhsOpretty =
({-# LINE 1080 "src/GLua/AG/PrettyPrint.ag" #-}
if _argIisMultiline then _prettyMulti else _prettySingle
{-# LINE 839 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1081 "src/GLua/AG/PrettyPrint.ag" #-}
_argIisMultiline
{-# LINE 844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 1082 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ _argIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 1083 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _argIpretty
{-# LINE 854 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 1084 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argIcopy
{-# LINE 859 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOindent =
({-# LINE 1085 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _argIisMultiline then 1 else 0)
{-# LINE 864 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOsomeElementsInListAreMultiline =
({-# LINE 1086 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 869 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
TableArg _argIcopy
{-# LINE 874 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 879 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_argIcomments
{-# LINE 884 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 889 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 894 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 899 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argIcomments,_argIcopy,_argIisMultiline,_argIisNil,_argIpretty) =
arg_ _argOcomments _argOforceMultiline _argOindent _argOppconf _argOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args_StringArg :: MToken ->
T_Args
sem_Args_StringArg arg_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1088 "src/GLua/AG/PrettyPrint.ag" #-}
tok arg_
{-# LINE 918 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1089 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 923 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
StringArg arg_
{-# LINE 928 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 933 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 938 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
-- BinOp -------------------------------------------------------
-- cata
sem_BinOp :: BinOp ->
T_BinOp
sem_BinOp (AOr) =
(sem_BinOp_AOr)
sem_BinOp (AAnd) =
(sem_BinOp_AAnd)
sem_BinOp (ALT) =
(sem_BinOp_ALT)
sem_BinOp (AGT) =
(sem_BinOp_AGT)
sem_BinOp (ALEQ) =
(sem_BinOp_ALEQ)
sem_BinOp (AGEQ) =
(sem_BinOp_AGEQ)
sem_BinOp (ANEq) =
(sem_BinOp_ANEq)
sem_BinOp (AEq) =
(sem_BinOp_AEq)
sem_BinOp (AConcatenate) =
(sem_BinOp_AConcatenate)
sem_BinOp (APlus) =
(sem_BinOp_APlus)
sem_BinOp (BinMinus) =
(sem_BinOp_BinMinus)
sem_BinOp (AMultiply) =
(sem_BinOp_AMultiply)
sem_BinOp (ADivide) =
(sem_BinOp_ADivide)
sem_BinOp (AModulus) =
(sem_BinOp_AModulus)
sem_BinOp (APower) =
(sem_BinOp_APower)
-- semantic domain
type T_BinOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),BinOp,Bool,Bool,OperatorLevel,Doc)
data Inh_BinOp = Inh_BinOp {comments_Inh_BinOp :: ([MToken]),indent_Inh_BinOp :: Int,ppconf_Inh_BinOp :: PrettyPrintConfig}
data Syn_BinOp = Syn_BinOp {comments_Syn_BinOp :: ([MToken]),copy_Syn_BinOp :: BinOp,isAssociative_Syn_BinOp :: Bool,isMultiline_Syn_BinOp :: Bool,precedence_Syn_BinOp :: OperatorLevel,pretty_Syn_BinOp :: Doc}
wrap_BinOp :: T_BinOp ->
Inh_BinOp ->
Syn_BinOp
wrap_BinOp sem (Inh_BinOp _lhsIcomments _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf
in (Syn_BinOp _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty))
sem_BinOp_AOr :: T_BinOp
sem_BinOp_AOr =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1196 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "||" else "or")
{-# LINE 1002 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1197 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1007 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1198 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel1
{-# LINE 1012 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1199 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1017 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AOr
{-# LINE 1022 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1027 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1032 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AAnd :: T_BinOp
sem_BinOp_AAnd =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1191 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "&&" else "and")
{-# LINE 1049 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1192 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1054 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1193 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel2
{-# LINE 1059 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1194 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1064 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AAnd
{-# LINE 1069 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1074 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1079 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALT :: T_BinOp
sem_BinOp_ALT =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1161 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<"
{-# LINE 1096 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1162 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1101 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1163 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1106 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1164 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1111 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ALT
{-# LINE 1116 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1121 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1126 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGT :: T_BinOp
sem_BinOp_AGT =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1171 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">"
{-# LINE 1143 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1172 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1148 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1173 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1153 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1174 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1158 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AGT
{-# LINE 1163 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1168 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1173 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALEQ :: T_BinOp
sem_BinOp_ALEQ =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1166 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<="
{-# LINE 1190 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1167 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1195 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1168 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1200 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1169 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1205 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ALEQ
{-# LINE 1210 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1215 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1220 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGEQ :: T_BinOp
sem_BinOp_AGEQ =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1176 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">="
{-# LINE 1237 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1177 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1242 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1178 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1247 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1179 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1252 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AGEQ
{-# LINE 1257 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1262 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1267 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ANEq :: T_BinOp
sem_BinOp_ANEq =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1186 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!=" else "~=")
{-# LINE 1284 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1187 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1289 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1188 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1294 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1189 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1299 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ANEq
{-# LINE 1304 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1309 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1314 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AEq :: T_BinOp
sem_BinOp_AEq =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1181 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "=="
{-# LINE 1331 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1182 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1336 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1183 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1341 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1184 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1346 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AEq
{-# LINE 1351 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1356 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1361 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AConcatenate :: T_BinOp
sem_BinOp_AConcatenate =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1156 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ".."
{-# LINE 1378 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1157 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1158 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel4
{-# LINE 1388 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1159 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1393 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AConcatenate
{-# LINE 1398 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1403 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1408 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APlus :: T_BinOp
sem_BinOp_APlus =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1126 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "+"
{-# LINE 1425 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1127 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1430 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1128 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1435 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1129 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1440 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
APlus
{-# LINE 1445 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1450 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1455 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_BinMinus :: T_BinOp
sem_BinOp_BinMinus =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1131 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 1472 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1132 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1477 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1133 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1482 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1134 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1487 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
BinMinus
{-# LINE 1492 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1497 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1502 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AMultiply :: T_BinOp
sem_BinOp_AMultiply =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1136 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "*"
{-# LINE 1519 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1137 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1524 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1138 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1529 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1139 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1534 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AMultiply
{-# LINE 1539 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1544 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1549 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ADivide :: T_BinOp
sem_BinOp_ADivide =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1141 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "/"
{-# LINE 1566 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1142 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1571 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1143 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1576 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1144 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1581 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ADivide
{-# LINE 1586 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1591 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1596 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AModulus :: T_BinOp
sem_BinOp_AModulus =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1146 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "%"
{-# LINE 1613 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1147 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1618 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1148 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1623 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1149 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1628 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AModulus
{-# LINE 1633 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1638 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1643 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APower :: T_BinOp
sem_BinOp_APower =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1151 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "^"
{-# LINE 1660 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1152 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1665 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1153 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 1670 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1154 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1675 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
APower
{-# LINE 1680 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1685 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1690 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
-- Block -------------------------------------------------------
-- cata
sem_Block :: Block ->
T_Block
sem_Block (Block _pos _stats _ret) =
(sem_Block_Block _pos (sem_MStatList _stats) (sem_AReturn _ret))
-- semantic domain
type T_Block = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Block,Bool,Region,Doc,Int)
data Inh_Block = Inh_Block {comments_Inh_Block :: ([MToken]),forceMultiline_Inh_Block :: Bool,indent_Inh_Block :: Int,ppconf_Inh_Block :: PrettyPrintConfig,statRegion_Inh_Block :: Region}
data Syn_Block = Syn_Block {comments_Syn_Block :: ([MToken]),copy_Syn_Block :: Block,isMultiline_Syn_Block :: Bool,pos_Syn_Block :: Region,pretty_Syn_Block :: Doc,statementCount_Syn_Block :: Int}
wrap_Block :: T_Block ->
Inh_Block ->
Syn_Block
wrap_Block sem (Inh_Block _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty,_lhsOstatementCount) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion
in (Syn_Block _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpos _lhsOpretty _lhsOstatementCount))
sem_Block_Block :: Region ->
T_MStatList ->
T_AReturn ->
T_Block
sem_Block_Block pos_ stats_ ret_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOcomments :: ([MToken])
_lhsOstatementCount :: Int
_lhsOcopy :: Block
_lhsOisMultiline :: Bool
_statsOcomments :: ([MToken])
_statsOforceMultiline :: Bool
_statsOindent :: Int
_statsOppconf :: PrettyPrintConfig
_statsOstatRegion :: Region
_retOcomments :: ([MToken])
_retOforceMultiline :: Bool
_retOindent :: Int
_retOppconf :: PrettyPrintConfig
_statsIcomments :: ([MToken])
_statsIcopy :: MStatList
_statsIisLast :: Bool
_statsIisMultiline :: Bool
_statsIpretty :: Doc
_statsIstartsWithExprPrefixExpression :: Bool
_statsIstatementCount :: Int
_retIcomments :: ([MToken])
_retIcopy :: AReturn
_retIisMultiline :: Bool
_retIpretty :: Doc
_retIstatementCount :: Int
_lhsOpretty =
({-# LINE 633 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline
then _statsIpretty $+$ _retIpretty $+$ _prettyCommentsAfter
else _statsIpretty <-> _retIpretty
{-# LINE 1756 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 637 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 1761 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statementCount =
({-# LINE 638 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIstatementCount + _retIstatementCount
{-# LINE 1766 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 639 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIisMultiline || _retIisMultiline || _statementCount > 1 || not (null $ fst $ _commentsAfter )
{-# LINE 1771 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 640 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeEnd` pos_) _retIcomments
{-# LINE 1776 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 641 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent $ fst _commentsAfter
{-# LINE 1781 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 642 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 1786 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 314 "src/GLua/AG/PrettyPrint.ag" #-}
_statementCount
{-# LINE 1791 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Block pos_ _statsIcopy _retIcopy
{-# LINE 1796 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1801 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 1806 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1811 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1816 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1821 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1826 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 1831 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIcomments
{-# LINE 1836 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1841 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1846 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1851 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _statsIcomments,_statsIcopy,_statsIisLast,_statsIisMultiline,_statsIpretty,_statsIstartsWithExprPrefixExpression,_statsIstatementCount) =
stats_ _statsOcomments _statsOforceMultiline _statsOindent _statsOppconf _statsOstatRegion
( _retIcomments,_retIcopy,_retIisMultiline,_retIpretty,_retIstatementCount) =
ret_ _retOcomments _retOforceMultiline _retOindent _retOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty,_lhsOstatementCount)))
-- Declaration -------------------------------------------------
-- cata
sem_Declaration :: Declaration ->
T_Declaration
sem_Declaration ( x1,x2) =
(sem_Declaration_Tuple (sem_PrefixExp x1) (sem_MaybeMExpr x2))
-- semantic domain
type T_Declaration = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Declaration,Bool,Doc,Bool,Bool,Doc,Bool,Doc)
data Inh_Declaration = Inh_Declaration {comments_Inh_Declaration :: ([MToken]),forceMultiline_Inh_Declaration :: Bool,indent_Inh_Declaration :: Int,ppconf_Inh_Declaration :: PrettyPrintConfig}
data Syn_Declaration = Syn_Declaration {comments_Syn_Declaration :: ([MToken]),copy_Syn_Declaration :: Declaration,endsWithPrefixExpression_Syn_Declaration :: Bool,exprPretty_Syn_Declaration :: Doc,isDefined_Syn_Declaration :: Bool,isMultiline_Syn_Declaration :: Bool,pretty_Syn_Declaration :: Doc,startsWithExprPrefixExpression_Syn_Declaration :: Bool,varPretty_Syn_Declaration :: Doc}
wrap_Declaration :: T_Declaration ->
Inh_Declaration ->
Syn_Declaration
wrap_Declaration sem (Inh_Declaration _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_Declaration _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOexprPretty _lhsOisDefined _lhsOisMultiline _lhsOpretty _lhsOstartsWithExprPrefixExpression _lhsOvarPretty))
sem_Declaration_Tuple :: T_PrefixExp ->
T_MaybeMExpr ->
T_Declaration
sem_Declaration_Tuple x1_ x2_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOvarPretty :: Doc
_lhsOexprPretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_x1OparentOperatorPrecedence :: OperatorLevel
_x1OparentOperatorAssociative :: Bool
_lhsOisDefined :: 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 =
({-# LINE 525 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Ipretty
{-# LINE 1924 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 526 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1929 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 527 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IstartsWithExprPrefixExpression
{-# LINE 1934 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 528 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IendsWithPrefixExpression
{-# LINE 1939 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 529 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 1944 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 530 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 1949 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 531 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1954 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 276 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IisDefined
{-# LINE 1959 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 1964 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1969 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 1974 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1979 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1984 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1989 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1994 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1999 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 2004 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2009 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2014 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2019 "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)))
-- Else --------------------------------------------------------
-- cata
sem_Else :: Else ->
T_Else
sem_Else (Prelude.Just x) =
(sem_Else_Just (sem_MElse x))
sem_Else Prelude.Nothing =
sem_Else_Nothing
-- semantic domain
type T_Else = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Else,Bool,Bool,Region,Doc)
data Inh_Else = Inh_Else {comments_Inh_Else :: ([MToken]),forceMultiline_Inh_Else :: Bool,indent_Inh_Else :: Int,ppconf_Inh_Else :: PrettyPrintConfig,statRegion_Inh_Else :: Region}
data Syn_Else = Syn_Else {comments_Syn_Else :: ([MToken]),copy_Syn_Else :: Else,elsesExist_Syn_Else :: Bool,isMultiline_Syn_Else :: Bool,pos_Syn_Else :: Region,pretty_Syn_Else :: Doc}
wrap_Else :: T_Else ->
Inh_Else ->
Syn_Else
wrap_Else sem (Inh_Else _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion
in (Syn_Else _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty))
sem_Else_Just :: T_MElse ->
T_Else
sem_Else_Just just_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_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 =
({-# LINE 595 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2077 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 596 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 2082 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 2087 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2092 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 2097 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 300 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpos
{-# LINE 2102 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 2107 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2112 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2117 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2122 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2127 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 2132 "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 =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOelsesExist :: Bool
_lhsOcopy :: Else
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 598 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2153 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 599 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2158 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 600 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2163 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 317 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2168 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 2173 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2178 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2183 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
-- ElseIf ------------------------------------------------------
-- cata
sem_ElseIf :: ElseIf ->
T_ElseIf
sem_ElseIf ( x1,x2) =
(sem_ElseIf_Tuple (sem_MExpr x1) (sem_Block x2))
-- semantic domain
type T_ElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIf,Bool,Doc)
data Inh_ElseIf = Inh_ElseIf {comments_Inh_ElseIf :: ([MToken]),forceMultiline_Inh_ElseIf :: Bool,indent_Inh_ElseIf :: Int,ppconf_Inh_ElseIf :: PrettyPrintConfig}
data Syn_ElseIf = Syn_ElseIf {comments_Syn_ElseIf :: ([MToken]),copy_Syn_ElseIf :: ElseIf,isMultiline_Syn_ElseIf :: Bool,pretty_Syn_ElseIf :: Doc}
wrap_ElseIf :: T_ElseIf ->
Inh_ElseIf ->
Syn_ElseIf
wrap_ElseIf sem (Inh_ElseIf _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_ElseIf _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty))
sem_ElseIf_Tuple :: T_MExpr ->
T_Block ->
T_ElseIf
sem_ElseIf_Tuple x1_ x2_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_x2Oindent :: Int
_x2OstatRegion :: Region
_x1OparentOperatorPrecedence :: OperatorLevel
_x1OparentOperatorAssociative :: 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
_x2IisMultiline :: Bool
_x2Ipos :: Region
_x2Ipretty :: Doc
_x2IstatementCount :: Int
_lhsOpretty =
({-# LINE 570 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "elseif" <-> _x1Ipretty <-> zeroWidthText "then" $+$ _x2Ipretty
{-# LINE 2247 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 571 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 2252 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 572 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 2257 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OstatRegion =
({-# LINE 573 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2262 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 574 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 2267 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 575 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2272 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 2277 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2282 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 2287 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2292 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2297 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2302 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2307 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 2312 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2317 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2322 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _x1Icomments,_x1Icopy,_x1IendsWithPrefixExpression,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Ipos,_x1Iprecedence,_x1Ipretty) =
x1_ _x1Ocomments _x1OforceMultiline _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf
( _x2Icomments,_x2Icopy,_x2IisMultiline,_x2Ipos,_x2Ipretty,_x2IstatementCount) =
x2_ _x2Ocomments _x2OforceMultiline _x2Oindent _x2Oppconf _x2OstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
-- ElseIfList --------------------------------------------------
-- cata
sem_ElseIfList :: ElseIfList ->
T_ElseIfList
sem_ElseIfList list =
(Prelude.foldr sem_ElseIfList_Cons sem_ElseIfList_Nil (Prelude.map sem_MElseIf list))
-- semantic domain
type T_ElseIfList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIfList,Bool,Bool,Region,Doc)
data Inh_ElseIfList = Inh_ElseIfList {comments_Inh_ElseIfList :: ([MToken]),forceMultiline_Inh_ElseIfList :: Bool,indent_Inh_ElseIfList :: Int,ppconf_Inh_ElseIfList :: PrettyPrintConfig}
data Syn_ElseIfList = Syn_ElseIfList {comments_Syn_ElseIfList :: ([MToken]),copy_Syn_ElseIfList :: ElseIfList,elsesExist_Syn_ElseIfList :: Bool,isMultiline_Syn_ElseIfList :: Bool,pos_Syn_ElseIfList :: Region,pretty_Syn_ElseIfList :: Doc}
wrap_ElseIfList :: T_ElseIfList ->
Inh_ElseIfList ->
Syn_ElseIfList
wrap_ElseIfList sem (Inh_ElseIfList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_ElseIfList _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty))
sem_ElseIfList_Cons :: T_MElseIf ->
T_ElseIfList ->
T_ElseIfList
sem_ElseIfList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_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 =
({-# LINE 584 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent _hdIpretty $+$ _tlIpretty
{-# LINE 2385 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 585 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2390 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 586 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 2395 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 587 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 2400 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 2405 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2410 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 2415 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2420 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2425 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2430 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2435 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 2440 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2445 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2450 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2455 "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 =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOelsesExist :: Bool
_lhsOcopy :: ElseIfList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 589 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2477 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 590 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2482 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 591 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2487 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 317 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2492 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 2497 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2502 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2507 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
-- Expr --------------------------------------------------------
-- cata
sem_Expr :: Expr ->
T_Expr
sem_Expr (ANil) =
(sem_Expr_ANil)
sem_Expr (AFalse) =
(sem_Expr_AFalse)
sem_Expr (ATrue) =
(sem_Expr_ATrue)
sem_Expr (ANumber _num) =
(sem_Expr_ANumber _num)
sem_Expr (AString _str) =
(sem_Expr_AString _str)
sem_Expr (AVarArg) =
(sem_Expr_AVarArg)
sem_Expr (AnonymousFunc _pars _body) =
(sem_Expr_AnonymousFunc _pars (sem_Block _body))
sem_Expr (APrefixExpr _pexpr) =
(sem_Expr_APrefixExpr (sem_PrefixExp _pexpr))
sem_Expr (ATableConstructor _fields) =
(sem_Expr_ATableConstructor (sem_FieldList _fields))
sem_Expr (BinOpExpr _op _left _right) =
(sem_Expr_BinOpExpr (sem_BinOp _op) (sem_MExpr _left) (sem_MExpr _right))
sem_Expr (UnOpExpr _op _right) =
(sem_Expr_UnOpExpr (sem_UnOp _op) (sem_MExpr _right))
-- semantic domain
type T_Expr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Expr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_Expr = Inh_Expr {comments_Inh_Expr :: ([MToken]),forceMultiline_Inh_Expr :: Bool,indent_Inh_Expr :: Int,parentOperatorAssociative_Inh_Expr :: Bool,parentOperatorPrecedence_Inh_Expr :: OperatorLevel,ppconf_Inh_Expr :: PrettyPrintConfig,statRegion_Inh_Expr :: Region}
data Syn_Expr = Syn_Expr {comments_Syn_Expr :: ([MToken]),copy_Syn_Expr :: Expr,endsWithPrefixExpression_Syn_Expr :: Bool,isAssociative_Syn_Expr :: Bool,isLiteral_Syn_Expr :: Bool,isMultiline_Syn_Expr :: Bool,precedence_Syn_Expr :: OperatorLevel,pretty_Syn_Expr :: Doc}
wrap_Expr :: T_Expr ->
Inh_Expr ->
Syn_Expr
wrap_Expr sem (Inh_Expr _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf _lhsIstatRegion
in (Syn_Expr _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOprecedence _lhsOpretty))
sem_Expr_ANil :: T_Expr
sem_Expr_ANil =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 985 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "nil"
{-# LINE 2573 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 986 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2578 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 987 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2583 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 988 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2588 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2593 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2598 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ANil
{-# LINE 2603 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2608 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2613 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AFalse :: T_Expr
sem_Expr_AFalse =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 990 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "false"
{-# LINE 2636 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 991 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2641 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 992 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2646 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 993 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2651 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2656 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2661 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AFalse
{-# LINE 2666 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2671 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2676 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ATrue :: T_Expr
sem_Expr_ATrue =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 995 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "true"
{-# LINE 2699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 996 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 997 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 998 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ATrue
{-# LINE 2729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2739 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ANumber :: String ->
T_Expr
sem_Expr_ANumber num_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1000 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText num_
{-# LINE 2763 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1001 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2768 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1002 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2773 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1003 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2778 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2783 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2788 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ANumber num_
{-# LINE 2793 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2798 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2803 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AString :: MToken ->
T_Expr
sem_Expr_AString str_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1005 "src/GLua/AG/PrettyPrint.ag" #-}
tok str_
{-# LINE 2827 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1006 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2832 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1007 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2837 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1008 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2842 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2847 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2852 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AString str_
{-# LINE 2857 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2862 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2867 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AVarArg :: T_Expr
sem_Expr_AVarArg =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1010 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "..."
{-# LINE 2890 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1011 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2895 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1012 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2900 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1013 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2905 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2910 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2915 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AVarArg
{-# LINE 2920 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2925 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2930 "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 pars_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOisMultiline :: Bool
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_isMultiline =
({-# LINE 1015 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _bodyIisMultiline
{-# LINE 2966 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1016 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2971 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 1017 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function"
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_)
<-> _bodyIpretty
<-> zeroWidthText "end"
{-# LINE 2979 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 1022 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function"
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_)
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 2987 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 1027 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 2994 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 1031 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null pars_
{-# LINE 2999 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 1032 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 3004 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 1033 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 3009 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3014 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 263 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3019 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3024 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AnonymousFunc pars_ _bodyIcopy
{-# LINE 3029 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3034 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 3039 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3044 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3049 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3054 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3059 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 3064 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_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 pexpr_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOisLiteral :: 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 =
({-# LINE 1035 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIpretty
{-# LINE 3104 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1036 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3109 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1037 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisMultiline
{-# LINE 3114 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisAssociative
{-# LINE 3119 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 263 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisLiteral
{-# LINE 3124 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIprecedence
{-# LINE 3129 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
APrefixExpr _pexprIcopy
{-# LINE 3134 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3139 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIcomments
{-# LINE 3144 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3149 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3154 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3159 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorAssociative =
({-# LINE 260 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3164 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorPrecedence =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 3169 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3174 "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 fields_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_fieldsOindent :: Int
_fieldsOsomeElementsInListAreMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOisMultiline :: Bool
_fieldsOcomments :: ([MToken])
_fieldsOforceMultiline :: Bool
_fieldsOppconf :: PrettyPrintConfig
_fieldsIcomments :: ([MToken])
_fieldsIcopy :: FieldList
_fieldsIisMultiline :: Bool
_fieldsIisNil :: Bool
_fieldsIpretty :: Doc
_lhsOpretty =
({-# LINE 1039 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _prettyMulti else _prettySingle
{-# LINE 3210 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 1040 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _fieldsIisMultiline
{-# LINE 3215 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1041 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3220 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1042 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3225 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 1043 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ _fieldsIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 3230 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 1044 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _fieldsIpretty
{-# LINE 3235 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 1045 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _fieldsIcopy
{-# LINE 3240 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOindent =
({-# LINE 1046 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _fieldsIisMultiline then 1 else 0)
{-# LINE 3245 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOsomeElementsInListAreMultiline =
({-# LINE 1047 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3250 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3255 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3260 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ATableConstructor _fieldsIcopy
{-# LINE 3265 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3270 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_fieldsIcomments
{-# LINE 3275 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3280 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3285 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3290 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3295 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _fieldsIcomments,_fieldsIcopy,_fieldsIisMultiline,_fieldsIisNil,_fieldsIpretty) =
fields_ _fieldsOcomments _fieldsOforceMultiline _fieldsOindent _fieldsOppconf _fieldsOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_BinOpExpr :: T_BinOp ->
T_MExpr ->
T_MExpr ->
T_Expr
sem_Expr_BinOpExpr op_ left_ right_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisMultiline :: Bool
_leftOparentOperatorPrecedence :: OperatorLevel
_rightOparentOperatorPrecedence :: OperatorLevel
_leftOparentOperatorAssociative :: Bool
_rightOparentOperatorAssociative :: Bool
_lhsOisAssociative :: Bool
_lhsOisLiteral :: 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 =
({-# LINE 1049 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIpretty <-> _opIpretty <-> _rightIpretty
{-# LINE 3362 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1050 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3367 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1053 "src/GLua/AG/PrettyPrint.ag" #-}
min _opIprecedence $ min _leftIprecedence _rightIprecedence
{-# LINE 3372 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1054 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIisMultiline || _rightIisMultiline
{-# LINE 3377 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorPrecedence =
({-# LINE 1055 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3382 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 1056 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3387 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorAssociative =
({-# LINE 1057 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3392 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 1058 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3397 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative && _leftIisAssociative && _rightIisAssociative
{-# LINE 3402 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 263 "src/GLua/AG/PrettyPrint.ag" #-}
((\_ _ -> False) _leftIisLiteral _rightIisLiteral)
{-# LINE 3407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
BinOpExpr _opIcopy _leftIcopy _rightIcopy
{-# LINE 3412 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3417 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3422 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3427 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3432 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3437 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3442 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3447 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3452 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3457 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIcomments
{-# LINE 3462 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3467 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3472 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3477 "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 op_ right_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_rightOparentOperatorPrecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOisLiteral :: 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 =
({-# LINE 1060 "src/GLua/AG/PrettyPrint.ag" #-}
_opIpretty <> _rightIpretty
{-# LINE 3530 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1061 "src/GLua/AG/PrettyPrint.ag" #-}
min _rightIprecedence OperatorLevel7
{-# LINE 3535 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1062 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3540 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1063 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisMultiline || _rightIisMultiline
{-# LINE 3545 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 1064 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel7
{-# LINE 3550 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisAssociative
{-# LINE 3555 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 263 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisLiteral
{-# LINE 3560 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
UnOpExpr _opIcopy _rightIcopy
{-# LINE 3565 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3570 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3575 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3580 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 260 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3615 "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)))
-- ExprSuffixList ----------------------------------------------
-- cata
sem_ExprSuffixList :: ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList list =
(Prelude.foldr sem_ExprSuffixList_Cons sem_ExprSuffixList_Nil (Prelude.map sem_PFExprSuffix list))
-- semantic domain
type T_ExprSuffixList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ExprSuffixList,Bool,Bool,OperatorLevel,Doc)
data Inh_ExprSuffixList = Inh_ExprSuffixList {comments_Inh_ExprSuffixList :: ([MToken]),forceMultiline_Inh_ExprSuffixList :: Bool,indent_Inh_ExprSuffixList :: Int,ppconf_Inh_ExprSuffixList :: PrettyPrintConfig}
data Syn_ExprSuffixList = Syn_ExprSuffixList {comments_Syn_ExprSuffixList :: ([MToken]),copy_Syn_ExprSuffixList :: ExprSuffixList,isAssociative_Syn_ExprSuffixList :: Bool,isMultiline_Syn_ExprSuffixList :: Bool,precedence_Syn_ExprSuffixList :: OperatorLevel,pretty_Syn_ExprSuffixList :: Doc}
wrap_ExprSuffixList :: T_ExprSuffixList ->
Inh_ExprSuffixList ->
Syn_ExprSuffixList
wrap_ExprSuffixList sem (Inh_ExprSuffixList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_ExprSuffixList _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty))
sem_ExprSuffixList_Cons :: T_PFExprSuffix ->
T_ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: 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 =
({-# LINE 617 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpretty <> _tlIpretty
{-# LINE 3679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 618 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 3684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 3689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 3694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 3699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 3709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 3734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3739 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3744 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3749 "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 =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: ExprSuffixList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 620 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 3771 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 621 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3776 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3781 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3786 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 3791 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3796 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3801 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
-- Field -------------------------------------------------------
-- cata
sem_Field :: Field ->
T_Field
sem_Field (ExprField _key _value _sep) =
(sem_Field_ExprField (sem_MExpr _key) (sem_MExpr _value) (sem_FieldSep _sep))
sem_Field (NamedField _key _value _sep) =
(sem_Field_NamedField _key (sem_MExpr _value) (sem_FieldSep _sep))
sem_Field (UnnamedField _value _sep) =
(sem_Field_UnnamedField (sem_MExpr _value) (sem_FieldSep _sep))
-- semantic domain
type T_Field = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Field,Bool,Bool,Region,Doc)
data Inh_Field = Inh_Field {comments_Inh_Field :: ([MToken]),forceMultiline_Inh_Field :: Bool,indent_Inh_Field :: Int,ppconf_Inh_Field :: PrettyPrintConfig}
data Syn_Field = Syn_Field {comments_Syn_Field :: ([MToken]),copy_Syn_Field :: Field,isMultiline_Syn_Field :: Bool,isSemiColon_Syn_Field :: Bool,pos_Syn_Field :: Region,pretty_Syn_Field :: Doc}
wrap_Field :: T_Field ->
Inh_Field ->
Syn_Field
wrap_Field sem (Inh_Field _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_Field _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOisSemiColon _lhsOpos _lhsOpretty))
sem_Field_ExprField :: T_MExpr ->
T_MExpr ->
T_FieldSep ->
T_Field
sem_Field_ExprField key_ value_ sep_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: 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
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty =
({-# LINE 1093 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _keyIpretty <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 3882 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1094 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3887 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorPrecedence =
({-# LINE 1095 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3892 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorAssociative =
({-# LINE 1096 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3897 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1097 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3902 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1098 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 311 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 3912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ExprField _keyIcopy _valueIcopy _sepIcopy
{-# LINE 3917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 3927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 300 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 3932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3947 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3952 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_keyIcomments
{-# LINE 3957 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3962 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3977 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3982 "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
( _sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) =
sep_ _sepOindent _sepOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty)))
sem_Field_NamedField :: MToken ->
T_MExpr ->
T_FieldSep ->
T_Field
sem_Field_NamedField key_ value_ sep_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: 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
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty =
({-# LINE 1100 "src/GLua/AG/PrettyPrint.ag" #-}
tok key_ <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 4030 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1101 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4035 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1102 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4040 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1103 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4045 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 311 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4050 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
NamedField key_ _valueIcopy _sepIcopy
{-# LINE 4055 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4060 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4065 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 300 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4070 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4075 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4080 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4085 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4100 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valueIcomments,_valueIcopy,_valueIendsWithPrefixExpression,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty) =
value_ _valueOcomments _valueOforceMultiline _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf
( _sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) =
sep_ _sepOindent _sepOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty)))
sem_Field_UnnamedField :: T_MExpr ->
T_FieldSep ->
T_Field
sem_Field_UnnamedField value_ sep_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: 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
_sepIcopy :: FieldSep
_sepIisMultiline :: Bool
_sepIisSemiColon :: Bool
_sepIpretty :: Doc
_lhsOpretty =
({-# LINE 1105 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpretty <> _sepIpretty
{-# LINE 4145 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1106 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIisMultiline || _sepIisMultiline
{-# LINE 4150 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1107 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4155 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1108 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4160 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 311 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4165 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
UnnamedField _valueIcopy _sepIcopy
{-# LINE 4170 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4175 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4180 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 300 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4185 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4190 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4195 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4200 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4205 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4210 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4215 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valueIcomments,_valueIcopy,_valueIendsWithPrefixExpression,_valueIisAssociative,_valueIisLiteral,_valueIisMultiline,_valueIpos,_valueIprecedence,_valueIpretty) =
value_ _valueOcomments _valueOforceMultiline _valueOindent _valueOparentOperatorAssociative _valueOparentOperatorPrecedence _valueOppconf
( _sepIcopy,_sepIisMultiline,_sepIisSemiColon,_sepIpretty) =
sep_ _sepOindent _sepOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpos,_lhsOpretty)))
-- FieldList ---------------------------------------------------
-- cata
sem_FieldList :: FieldList ->
T_FieldList
sem_FieldList list =
(Prelude.foldr sem_FieldList_Cons sem_FieldList_Nil (Prelude.map sem_Field list))
-- semantic domain
type T_FieldList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),FieldList,Bool,Bool,Doc)
data Inh_FieldList = Inh_FieldList {comments_Inh_FieldList :: ([MToken]),forceMultiline_Inh_FieldList :: Bool,indent_Inh_FieldList :: Int,ppconf_Inh_FieldList :: PrettyPrintConfig,someElementsInListAreMultiline_Inh_FieldList :: Bool}
data Syn_FieldList = Syn_FieldList {comments_Syn_FieldList :: ([MToken]),copy_Syn_FieldList :: FieldList,isMultiline_Syn_FieldList :: Bool,isNil_Syn_FieldList :: Bool,pretty_Syn_FieldList :: Doc}
wrap_FieldList :: T_FieldList ->
Inh_FieldList ->
Syn_FieldList
wrap_FieldList sem (Inh_FieldList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIsomeElementsInListAreMultiline) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIsomeElementsInListAreMultiline
in (Syn_FieldList _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOisNil _lhsOpretty))
sem_FieldList_Cons :: T_Field ->
T_FieldList ->
T_FieldList
sem_FieldList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_lhsOisNil :: Bool
_tlOsomeElementsInListAreMultiline :: Bool
_hdOcomments :: ([MToken])
_tlOcomments :: ([MToken])
_lhsOcomments :: ([MToken])
_lhsOcopy :: FieldList
_lhsOisMultiline :: Bool
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_hdIcomments :: ([MToken])
_hdIcopy :: Field
_hdIisMultiline :: Bool
_hdIisSemiColon :: Bool
_hdIpos :: Region
_hdIpretty :: Doc
_tlIcomments :: ([MToken])
_tlIcopy :: FieldList
_tlIisMultiline :: Bool
_tlIisNil :: Bool
_tlIpretty :: Doc
_lhsOpretty =
({-# LINE 471 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline
then renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
$+$ indent _lhsIppconf _lhsIindent _hdIpretty
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
$+$ _tlIpretty
else _hdIpretty
`_optionalSpaceAfterSep ` _tlIpretty
{-# LINE 4286 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 479 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4291 "src/GLua/AG/PrettyPrint.hs" #-}
)
_optionalSpaceAfterSep =
({-# LINE 481 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterComma _lhsIppconf then (<->) else (<>)
{-# LINE 4296 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 483 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| _hdIisMultiline
|| _tlIisMultiline
|| _lhsIsomeElementsInListAreMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 4306 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOsomeElementsInListAreMultiline =
({-# LINE 491 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 4314 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 497 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `before` _hdIpos) _lhsIcomments
{-# LINE 4319 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 498 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBefore
{-# LINE 4324 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 499 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _hdIpos) _hdIcomments
{-# LINE 4329 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 501 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4334 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 502 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 4339 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 4344 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4349 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 4354 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4359 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4364 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4369 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4374 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4379 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4384 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIisMultiline,_hdIisSemiColon,_hdIpos,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIisMultiline,_tlIisNil,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf _tlOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty)))
sem_FieldList_Nil :: T_FieldList
sem_FieldList_Nil =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_lhsOisNil :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 505 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4406 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 506 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4411 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 507 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4416 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 4421 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4426 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4431 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty)))
-- FieldSep ----------------------------------------------------
-- cata
sem_FieldSep :: FieldSep ->
T_FieldSep
sem_FieldSep (CommaSep) =
(sem_FieldSep_CommaSep)
sem_FieldSep (SemicolonSep) =
(sem_FieldSep_SemicolonSep)
sem_FieldSep (NoSep) =
(sem_FieldSep_NoSep)
-- semantic domain
type T_FieldSep = Int ->
PrettyPrintConfig ->
( FieldSep,Bool,Bool,Doc)
data Inh_FieldSep = Inh_FieldSep {indent_Inh_FieldSep :: Int,ppconf_Inh_FieldSep :: PrettyPrintConfig}
data Syn_FieldSep = Syn_FieldSep {copy_Syn_FieldSep :: FieldSep,isMultiline_Syn_FieldSep :: Bool,isSemiColon_Syn_FieldSep :: Bool,pretty_Syn_FieldSep :: Doc}
wrap_FieldSep :: T_FieldSep ->
Inh_FieldSep ->
Syn_FieldSep
wrap_FieldSep sem (Inh_FieldSep _lhsIindent _lhsIppconf) =
(let ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty) = sem _lhsIindent _lhsIppconf
in (Syn_FieldSep _lhsOcopy _lhsOisMultiline _lhsOisSemiColon _lhsOpretty))
sem_FieldSep_CommaSep :: T_FieldSep
sem_FieldSep_CommaSep =
(\ _lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty =
({-# LINE 1112 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ','
{-# LINE 4467 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1113 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4472 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 311 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4477 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
CommaSep
{-# LINE 4482 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4487 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_SemicolonSep :: T_FieldSep
sem_FieldSep_SemicolonSep =
(\ _lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisSemiColon :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty =
({-# LINE 1115 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ';'
{-# LINE 4501 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 1116 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4506 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1119 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4511 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
SemicolonSep
{-# LINE 4516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4521 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_NoSep :: T_FieldSep
sem_FieldSep_NoSep =
(\ _lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty =
({-# LINE 1121 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4535 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1122 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4540 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 311 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4545 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
NoSep
{-# LINE 4550 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4555 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
-- FuncName ----------------------------------------------------
-- cata
sem_FuncName :: FuncName ->
T_FuncName
sem_FuncName (FuncName _names _meta) =
(sem_FuncName_FuncName _names _meta)
-- semantic domain
type T_FuncName = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),FuncName,Bool,Region,Doc)
data Inh_FuncName = Inh_FuncName {comments_Inh_FuncName :: ([MToken]),indent_Inh_FuncName :: Int,ppconf_Inh_FuncName :: PrettyPrintConfig}
data Syn_FuncName = Syn_FuncName {comments_Syn_FuncName :: ([MToken]),copy_Syn_FuncName :: FuncName,isMultiline_Syn_FuncName :: Bool,pos_Syn_FuncName :: Region,pretty_Syn_FuncName :: Doc}
wrap_FuncName :: T_FuncName ->
Inh_FuncName ->
Syn_FuncName
wrap_FuncName sem (Inh_FuncName _lhsIcomments _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf
in (Syn_FuncName _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpos _lhsOpretty))
sem_FuncName_FuncName :: ([MToken]) ->
(Maybe MToken) ->
T_FuncName
sem_FuncName_FuncName names_ meta_ =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOpos :: Region
_lhsOcopy :: FuncName
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 899 "src/GLua/AG/PrettyPrint.ag" #-}
printList tok "." names_ <> metaDoc meta_
{-# LINE 4592 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 900 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4597 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 901 "src/GLua/AG/PrettyPrint.ag" #-}
case meta_ of
Nothing -> _namesPos
Just name -> rgOr _namesPos (mpos name)
{-# LINE 4604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_namesPos =
({-# LINE 905 "src/GLua/AG/PrettyPrint.ag" #-}
foldl1 rgOr $ map mpos names_
{-# LINE 4609 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
FuncName names_ meta_
{-# LINE 4614 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4619 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4624 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
-- MElse -------------------------------------------------------
-- cata
sem_MElse :: MElse ->
T_MElse
sem_MElse (MElse _pos _body) =
(sem_MElse_MElse _pos (sem_Block _body))
-- semantic domain
type T_MElse = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MElse,Bool,Bool,Region,Doc)
data Inh_MElse = Inh_MElse {comments_Inh_MElse :: ([MToken]),forceMultiline_Inh_MElse :: Bool,indent_Inh_MElse :: Int,ppconf_Inh_MElse :: PrettyPrintConfig,statRegion_Inh_MElse :: Region}
data Syn_MElse = Syn_MElse {comments_Syn_MElse :: ([MToken]),copy_Syn_MElse :: MElse,elsesExist_Syn_MElse :: Bool,isMultiline_Syn_MElse :: Bool,pos_Syn_MElse :: Region,pretty_Syn_MElse :: Doc}
wrap_MElse :: T_MElse ->
Inh_MElse ->
Syn_MElse
wrap_MElse sem (Inh_MElse _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion
in (Syn_MElse _lhsOcomments _lhsOcopy _lhsOelsesExist _lhsOisMultiline _lhsOpos _lhsOpretty))
sem_MElse_MElse :: Region ->
T_Block ->
T_MElse
sem_MElse_MElse pos_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_bodyOindent :: Int
_lhsOpos :: Region
_bodyOcomments :: ([MToken])
_lhsOelsesExist :: Bool
_lhsOcopy :: MElse
_lhsOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOpretty =
({-# LINE 604 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent (zeroWidthText "else")
<-> _prettyCommentsAfter
$+$ _bodyIpretty
{-# LINE 4679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 608 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIisMultiline
{-# LINE 4684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 609 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 4689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 610 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 4694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 611 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` pos_) _lhsIcomments
{-# LINE 4699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 612 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 613 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 317 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
MElse pos_ _bodyIcopy
{-# LINE 4719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 4729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4739 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 4744 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
-- MElseIf -----------------------------------------------------
-- cata
sem_MElseIf :: MElseIf ->
T_MElseIf
sem_MElseIf (MElseIf _pos _elif) =
(sem_MElseIf_MElseIf _pos (sem_ElseIf _elif))
-- semantic domain
type T_MElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MElseIf,Bool,Region,Doc)
data Inh_MElseIf = Inh_MElseIf {comments_Inh_MElseIf :: ([MToken]),forceMultiline_Inh_MElseIf :: Bool,indent_Inh_MElseIf :: Int,ppconf_Inh_MElseIf :: PrettyPrintConfig}
data Syn_MElseIf = Syn_MElseIf {comments_Syn_MElseIf :: ([MToken]),copy_Syn_MElseIf :: MElseIf,isMultiline_Syn_MElseIf :: Bool,pos_Syn_MElseIf :: Region,pretty_Syn_MElseIf :: Doc}
wrap_MElseIf :: T_MElseIf ->
Inh_MElseIf ->
Syn_MElseIf
wrap_MElseIf sem (Inh_MElseIf _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_MElseIf _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpos _lhsOpretty))
sem_MElseIf_MElseIf :: Region ->
T_ElseIf ->
T_MElseIf
sem_MElseIf_MElseIf pos_ elif_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_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 =
({-# LINE 579 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4793 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 580 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIisMultiline
{-# LINE 4798 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
MElseIf pos_ _elifIcopy
{-# LINE 4803 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4808 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIcomments
{-# LINE 4813 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIpretty
{-# LINE 4818 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4823 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4828 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4833 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4838 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _elifIcomments,_elifIcopy,_elifIisMultiline,_elifIpretty) =
elif_ _elifOcomments _elifOforceMultiline _elifOindent _elifOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
-- MExpr -------------------------------------------------------
-- cata
sem_MExpr :: MExpr ->
T_MExpr
sem_MExpr (MExpr _pos _expr) =
(sem_MExpr_MExpr _pos (sem_Expr _expr))
-- semantic domain
type T_MExpr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),MExpr,Bool,Bool,Bool,Bool,Region,OperatorLevel,Doc)
data Inh_MExpr = Inh_MExpr {comments_Inh_MExpr :: ([MToken]),forceMultiline_Inh_MExpr :: Bool,indent_Inh_MExpr :: Int,parentOperatorAssociative_Inh_MExpr :: Bool,parentOperatorPrecedence_Inh_MExpr :: OperatorLevel,ppconf_Inh_MExpr :: PrettyPrintConfig}
data Syn_MExpr = Syn_MExpr {comments_Syn_MExpr :: ([MToken]),copy_Syn_MExpr :: MExpr,endsWithPrefixExpression_Syn_MExpr :: Bool,isAssociative_Syn_MExpr :: Bool,isLiteral_Syn_MExpr :: Bool,isMultiline_Syn_MExpr :: Bool,pos_Syn_MExpr :: Region,precedence_Syn_MExpr :: OperatorLevel,pretty_Syn_MExpr :: Doc}
wrap_MExpr :: T_MExpr ->
Inh_MExpr ->
Syn_MExpr
wrap_MExpr sem (Inh_MExpr _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf
in (Syn_MExpr _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOpos _lhsOprecedence _lhsOpretty))
sem_MExpr_MExpr :: Region ->
T_Expr ->
T_MExpr
sem_MExpr_MExpr pos_ expr_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf ->
(let _lhsOpos :: Region
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_exprOstatRegion :: Region
_lhsOisAssociative :: Bool
_lhsOisLiteral :: 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 =
({-# LINE 978 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4902 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 979 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIendsWithPrefixExpression
{-# LINE 4907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 980 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline
{-# LINE 4912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOstatRegion =
({-# LINE 981 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative
{-# LINE 4922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 263 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisLiteral
{-# LINE 4927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIprecedence
{-# LINE 4932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
MExpr pos_ _exprIcopy
{-# LINE 4937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 4947 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIpretty
{-# LINE 4952 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4957 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4962 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 260 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 4972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 4977 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4982 "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)))
-- MExprList ---------------------------------------------------
-- cata
sem_MExprList :: MExprList ->
T_MExprList
sem_MExprList list =
(Prelude.foldr sem_MExprList_Cons sem_MExprList_Nil (Prelude.map sem_MExpr list))
-- semantic domain
type T_MExprList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),MExprList,Bool,Bool,Bool,Region,OperatorLevel,Doc,Bool)
data Inh_MExprList = Inh_MExprList {comments_Inh_MExprList :: ([MToken]),forceMultiline_Inh_MExprList :: Bool,indent_Inh_MExprList :: Int,ppconf_Inh_MExprList :: PrettyPrintConfig,someElementsInListAreMultiline_Inh_MExprList :: Bool}
data Syn_MExprList = Syn_MExprList {comments_Syn_MExprList :: ([MToken]),copy_Syn_MExprList :: MExprList,isAssociative_Syn_MExprList :: Bool,isLast_Syn_MExprList :: Bool,isMultiline_Syn_MExprList :: Bool,pos_Syn_MExprList :: Region,precedence_Syn_MExprList :: OperatorLevel,pretty_Syn_MExprList :: Doc,startsWithNewline_Syn_MExprList :: Bool}
wrap_MExprList :: T_MExprList ->
Inh_MExprList ->
Syn_MExprList
wrap_MExprList sem (Inh_MExprList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIsomeElementsInListAreMultiline) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLast,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithNewline) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIsomeElementsInListAreMultiline
in (Syn_MExprList _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisLast _lhsOisMultiline _lhsOpos _lhsOprecedence _lhsOpretty _lhsOstartsWithNewline))
sem_MExprList_Cons :: T_MExpr ->
T_MExprList ->
T_MExprList
sem_MExprList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_hdOcomments :: ([MToken])
_tlOcomments :: ([MToken])
_lhsOcomments :: ([MToken])
_lhsOpos :: Region
_lhsOisLast :: Bool
_hdOparentOperatorPrecedence :: OperatorLevel
_hdOparentOperatorAssociative :: Bool
_tlOsomeElementsInListAreMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExprList
_lhsOisMultiline :: Bool
_lhsOstartsWithNewline :: Bool
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_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
_tlIisLast :: Bool
_tlIisMultiline :: Bool
_tlIpos :: Region
_tlIprecedence :: OperatorLevel
_tlIpretty :: Doc
_tlIstartsWithNewline :: Bool
_lhsOpretty =
({-# LINE 407 "src/GLua/AG/PrettyPrint.ag" #-}
if _lhsIforceMultiline then _prettyForcedMultiline else _prettyNotForcedMultiline
{-# LINE 5058 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyNotForcedMultiline =
({-# LINE 408 "src/GLua/AG/PrettyPrint.ag" #-}
(if _startsWithNewline then
zchr '\n' <>
renderMLComments _lhsIppconf (_lhsIindent + 1) (fst _commentsBeforeLine ) $+$
indent _lhsIppconf (_lhsIindent + 1) _hdIpretty
else
_hdIpretty)
<> _comma
<> (if (not $ null $ fst _commentsAfter ) then
renderSLComments _lhsIppconf (_lhsIindent + 1) (fst _commentsAfter ) $+$
indent _lhsIppconf (_lhsIindent + 1) _tlIpretty
else
_tlIpretty)
{-# LINE 5074 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyForcedMultiline =
({-# LINE 423 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBeforeLine )
$+$ indent _lhsIppconf (_lhsIindent) _hdIpretty
<> _comma
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
$+$ _tlIpretty
{-# LINE 5083 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 429 "src/GLua/AG/PrettyPrint.ag" #-}
if _tlIisLast then
empty
else
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 5093 "src/GLua/AG/PrettyPrint.hs" #-}
)
_startsWithNewline =
({-# LINE 437 "src/GLua/AG/PrettyPrint.ag" #-}
not $ null $ fst _commentsBeforeLine
{-# LINE 5098 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeLine =
({-# LINE 438 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments
{-# LINE 5103 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 439 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBeforeLine
{-# LINE 5108 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 440 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _tlIpos) _hdIcomments
{-# LINE 5113 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 441 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 5118 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 442 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5123 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 444 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 5128 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 445 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5133 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorPrecedence =
({-# LINE 446 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5138 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorAssociative =
({-# LINE 447 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5143 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 448 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
|| _lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| _tlIisMultiline
{-# LINE 5153 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOsomeElementsInListAreMultiline =
({-# LINE 456 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
{-# LINE 5161 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 5166 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 5171 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5176 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5181 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 5186 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithNewline =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_startsWithNewline
{-# LINE 5191 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5196 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5201 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5206 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5216 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5221 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIisAssociative,_hdIisLiteral,_hdIisMultiline,_hdIpos,_hdIprecedence,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOparentOperatorAssociative _hdOparentOperatorPrecedence _hdOppconf
( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisLast,_tlIisMultiline,_tlIpos,_tlIprecedence,_tlIpretty,_tlIstartsWithNewline) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf _tlOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLast,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithNewline)))
sem_MExprList_Nil :: T_MExprList
sem_MExprList_Nil =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOstartsWithNewline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExprList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 463 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5247 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 464 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 5252 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 465 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5257 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 466 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5262 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithNewline =
({-# LINE 467 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5267 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5272 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5277 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5282 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5287 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5292 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLast,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithNewline)))
-- MStat -------------------------------------------------------
-- cata
sem_MStat :: MStat ->
T_MStat
sem_MStat (MStat _pos _stat) =
(sem_MStat_MStat _pos (sem_Stat _stat))
-- semantic domain
type T_MStat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),MStat,Bool,Bool,Region,Doc,Bool,Int)
data Inh_MStat = Inh_MStat {comments_Inh_MStat :: ([MToken]),forceMultiline_Inh_MStat :: Bool,indent_Inh_MStat :: Int,isLastStatement_Inh_MStat :: Bool,ppconf_Inh_MStat :: PrettyPrintConfig,wouldBeAmbiguousWithoutSemicolon_Inh_MStat :: Bool}
data Syn_MStat = Syn_MStat {comments_Syn_MStat :: ([MToken]),copy_Syn_MStat :: MStat,endsWithPrefixExpression_Syn_MStat :: Bool,isMultiline_Syn_MStat :: Bool,pos_Syn_MStat :: Region,pretty_Syn_MStat :: Doc,startsWithExprPrefixExpression_Syn_MStat :: Bool,statementCount_Syn_MStat :: Int}
wrap_MStat :: T_MStat ->
Inh_MStat ->
Syn_MStat
wrap_MStat sem (Inh_MStat _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIisLastStatement _lhsIppconf _lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpos,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIisLastStatement _lhsIppconf _lhsIwouldBeAmbiguousWithoutSemicolon
in (Syn_MStat _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOisMultiline _lhsOpos _lhsOpretty _lhsOstartsWithExprPrefixExpression _lhsOstatementCount))
sem_MStat_MStat :: Region ->
T_Stat ->
T_MStat
sem_MStat_MStat pos_ stat_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpos :: Region
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_statOstatRegion :: Region
_statOwouldBeAmbiguousWithoutSemicolon :: 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
_statIisMultiline :: Bool
_statIpretty :: Doc
_statIstartsWithExprPrefixExpression :: Bool
_lhsOpos =
({-# LINE 398 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5351 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 399 "src/GLua/AG/PrettyPrint.ag" #-}
_statIstartsWithExprPrefixExpression
{-# LINE 5356 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 400 "src/GLua/AG/PrettyPrint.ag" #-}
_statIendsWithPrefixExpression
{-# LINE 5361 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 401 "src/GLua/AG/PrettyPrint.ag" #-}
_statIisMultiline
{-# LINE 5366 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOstatRegion =
({-# LINE 402 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5371 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 403 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIwouldBeAmbiguousWithoutSemicolon
{-# LINE 5376 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 314 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 5381 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
MStat pos_ _statIcopy
{-# LINE 5386 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5391 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_statIcomments
{-# LINE 5396 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 249 "src/GLua/AG/PrettyPrint.ag" #-}
_statIpretty
{-# LINE 5401 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5406 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5411 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5416 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOisLastStatement =
({-# LINE 297 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIisLastStatement
{-# LINE 5421 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5426 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _statIcomments,_statIcopy,_statIendsWithPrefixExpression,_statIisMultiline,_statIpretty,_statIstartsWithExprPrefixExpression) =
stat_ _statOcomments _statOforceMultiline _statOindent _statOisLastStatement _statOppconf _statOstatRegion _statOwouldBeAmbiguousWithoutSemicolon
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpos,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
-- MStatList ---------------------------------------------------
-- cata
sem_MStatList :: MStatList ->
T_MStatList
sem_MStatList list =
(Prelude.foldr sem_MStatList_Cons sem_MStatList_Nil (Prelude.map sem_MStat list))
-- semantic domain
type T_MStatList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MStatList,Bool,Bool,Doc,Bool,Int)
data Inh_MStatList = Inh_MStatList {comments_Inh_MStatList :: ([MToken]),forceMultiline_Inh_MStatList :: Bool,indent_Inh_MStatList :: Int,ppconf_Inh_MStatList :: PrettyPrintConfig,statRegion_Inh_MStatList :: Region}
data Syn_MStatList = Syn_MStatList {comments_Syn_MStatList :: ([MToken]),copy_Syn_MStatList :: MStatList,isLast_Syn_MStatList :: Bool,isMultiline_Syn_MStatList :: Bool,pretty_Syn_MStatList :: Doc,startsWithExprPrefixExpression_Syn_MStatList :: Bool,statementCount_Syn_MStatList :: Int}
wrap_MStatList :: T_MStatList ->
Inh_MStatList ->
Syn_MStatList
wrap_MStatList sem (Inh_MStatList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf _lhsIstatRegion
in (Syn_MStatList _lhsOcomments _lhsOcopy _lhsOisLast _lhsOisMultiline _lhsOpretty _lhsOstartsWithExprPrefixExpression _lhsOstatementCount))
sem_MStatList_Cons :: T_MStat ->
T_MStatList ->
T_MStatList
sem_MStatList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisLast :: Bool
_hdOcomments :: ([MToken])
_tlOcomments :: ([MToken])
_lhsOcomments :: ([MToken])
_hdOisLastStatement :: Bool
_hdOwouldBeAmbiguousWithoutSemicolon :: Bool
_hdOforceMultiline :: Bool
_lhsOstatementCount :: Int
_lhsOcopy :: MStatList
_lhsOisMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_tlOstatRegion :: Region
_hdIcomments :: ([MToken])
_hdIcopy :: MStat
_hdIendsWithPrefixExpression :: Bool
_hdIisMultiline :: Bool
_hdIpos :: Region
_hdIpretty :: Doc
_hdIstartsWithExprPrefixExpression :: Bool
_hdIstatementCount :: Int
_tlIcomments :: ([MToken])
_tlIcopy :: MStatList
_tlIisLast :: Bool
_tlIisMultiline :: Bool
_tlIpretty :: Doc
_tlIstartsWithExprPrefixExpression :: Bool
_tlIstatementCount :: Int
_lhsOpretty =
({-# LINE 357 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBeforeLine )
$+$ indent _lhsIppconf _lhsIindent _hdIpretty
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
<> _addNewline
$+$ _tlIpretty
{-# LINE 5501 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 5506 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 364 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5511 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 366 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline
|| _tlIisMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
{-# LINE 5519 "src/GLua/AG/PrettyPrint.hs" #-}
)
_addNewline =
({-# LINE 371 "src/GLua/AG/PrettyPrint.ag" #-}
if not _tlIisLast && _hdIisMultiline then zchr '\n' else empty
{-# LINE 5524 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeLine =
({-# LINE 374 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments
{-# LINE 5529 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 375 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBeforeLine
{-# LINE 5534 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 376 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `beforeOrOnLine` _hdIpos) _hdIcomments
{-# LINE 5539 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 377 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 5544 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 378 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5549 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOisLastStatement =
({-# LINE 380 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIisLast
{-# LINE 5554 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 386 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIendsWithPrefixExpression && _tlIstartsWithExprPrefixExpression
{-# LINE 5559 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 388 "src/GLua/AG/PrettyPrint.ag" #-}
commentsForceMultiline $ fst _commentsBeforeLine
{-# LINE 5564 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 314 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstatementCount + _tlIstatementCount
{-# LINE 5569 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5574 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5579 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 5584 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5589 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5594 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5599 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5609 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 5614 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIisMultiline,_hdIpos,_hdIpretty,_hdIstartsWithExprPrefixExpression,_hdIstatementCount) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOisLastStatement _hdOppconf _hdOwouldBeAmbiguousWithoutSemicolon
( _tlIcomments,_tlIcopy,_tlIisLast,_tlIisMultiline,_tlIpretty,_tlIstartsWithExprPrefixExpression,_tlIstatementCount) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf _tlOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
sem_MStatList_Nil :: T_MStatList
sem_MStatList_Nil =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOcopy :: MStatList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 390 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5638 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 391 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 5643 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 392 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5648 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 393 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5653 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 394 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5658 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5673 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
-- MaybeMExpr --------------------------------------------------
-- cata
sem_MaybeMExpr :: MaybeMExpr ->
T_MaybeMExpr
sem_MaybeMExpr (Prelude.Just x) =
(sem_MaybeMExpr_Just (sem_MExpr x))
sem_MaybeMExpr Prelude.Nothing =
sem_MaybeMExpr_Nothing
-- semantic domain
type T_MaybeMExpr = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MaybeMExpr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_MaybeMExpr = Inh_MaybeMExpr {comments_Inh_MaybeMExpr :: ([MToken]),forceMultiline_Inh_MaybeMExpr :: Bool,indent_Inh_MaybeMExpr :: Int,ppconf_Inh_MaybeMExpr :: PrettyPrintConfig}
data Syn_MaybeMExpr = Syn_MaybeMExpr {comments_Syn_MaybeMExpr :: ([MToken]),copy_Syn_MaybeMExpr :: MaybeMExpr,endsWithPrefixExpression_Syn_MaybeMExpr :: Bool,isAssociative_Syn_MaybeMExpr :: Bool,isDefined_Syn_MaybeMExpr :: Bool,isMultiline_Syn_MaybeMExpr :: Bool,precedence_Syn_MaybeMExpr :: OperatorLevel,pretty_Syn_MaybeMExpr :: Doc}
wrap_MaybeMExpr :: T_MaybeMExpr ->
Inh_MaybeMExpr ->
Syn_MaybeMExpr
wrap_MaybeMExpr sem (Inh_MaybeMExpr _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_MaybeMExpr _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOisAssociative _lhsOisDefined _lhsOisMultiline _lhsOprecedence _lhsOpretty))
sem_MaybeMExpr_Just :: T_MExpr ->
T_MaybeMExpr
sem_MaybeMExpr_Just just_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_justOparentOperatorPrecedence :: OperatorLevel
_justOparentOperatorAssociative :: Bool
_lhsOisAssociative :: 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 =
({-# LINE 511 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 5731 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 512 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5736 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 513 "src/GLua/AG/PrettyPrint.ag" #-}
_justIendsWithPrefixExpression
{-# LINE 5741 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 514 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 5746 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorPrecedence =
({-# LINE 515 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5751 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorAssociative =
({-# LINE 516 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5756 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisAssociative
{-# LINE 5761 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_justIprecedence
{-# LINE 5766 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 5771 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5776 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 5781 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5786 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5791 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5796 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5801 "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 =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MaybeMExpr
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 518 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5823 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 519 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5828 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 520 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5833 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 521 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5838 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5843 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5848 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 5853 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5858 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5863 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
-- PFExprSuffix ------------------------------------------------
-- cata
sem_PFExprSuffix :: PFExprSuffix ->
T_PFExprSuffix
sem_PFExprSuffix (Call _args) =
(sem_PFExprSuffix_Call (sem_Args _args))
sem_PFExprSuffix (MetaCall _fn _args) =
(sem_PFExprSuffix_MetaCall _fn (sem_Args _args))
sem_PFExprSuffix (ExprIndex _index) =
(sem_PFExprSuffix_ExprIndex (sem_MExpr _index))
sem_PFExprSuffix (DotIndex _index) =
(sem_PFExprSuffix_DotIndex _index)
-- semantic domain
type T_PFExprSuffix = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),PFExprSuffix,Bool,Bool,OperatorLevel,Doc)
data Inh_PFExprSuffix = Inh_PFExprSuffix {comments_Inh_PFExprSuffix :: ([MToken]),forceMultiline_Inh_PFExprSuffix :: Bool,indent_Inh_PFExprSuffix :: Int,ppconf_Inh_PFExprSuffix :: PrettyPrintConfig}
data Syn_PFExprSuffix = Syn_PFExprSuffix {comments_Syn_PFExprSuffix :: ([MToken]),copy_Syn_PFExprSuffix :: PFExprSuffix,isAssociative_Syn_PFExprSuffix :: Bool,isMultiline_Syn_PFExprSuffix :: Bool,precedence_Syn_PFExprSuffix :: OperatorLevel,pretty_Syn_PFExprSuffix :: Doc}
wrap_PFExprSuffix :: T_PFExprSuffix ->
Inh_PFExprSuffix ->
Syn_PFExprSuffix
wrap_PFExprSuffix sem (Inh_PFExprSuffix _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_PFExprSuffix _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisMultiline _lhsOprecedence _lhsOpretty))
sem_PFExprSuffix_Call :: T_Args ->
T_PFExprSuffix
sem_PFExprSuffix_Call args_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOindent :: Int
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: Args
_argsIisMultiline :: Bool
_argsIpretty :: Doc
_lhsOpretty =
({-# LINE 962 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIpretty
{-# LINE 5916 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 963 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 5921 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5926 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5931 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Call _argsIcopy
{-# LINE 5936 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5941 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 5946 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5951 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5956 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5961 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5966 "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 fn_ args_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_argsOcomments :: ([MToken])
_argsOforceMultiline :: Bool
_argsOindent :: Int
_argsOppconf :: PrettyPrintConfig
_argsIcomments :: ([MToken])
_argsIcopy :: Args
_argsIisMultiline :: Bool
_argsIpretty :: Doc
_lhsOpretty =
({-# LINE 965 "src/GLua/AG/PrettyPrint.ag" #-}
zchr ':' <> tok fn_ <> _argsIpretty
{-# LINE 5996 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 966 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 6001 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6006 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 6011 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
MetaCall fn_ _argsIcopy
{-# LINE 6016 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6021 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 6026 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6031 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6036 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6041 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6046 "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 index_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_indexOparentOperatorPrecedence :: OperatorLevel
_indexOparentOperatorAssociative :: Bool
_lhsOisAssociative :: 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 =
({-# LINE 968 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _indexIpretty
{-# LINE 6082 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 969 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisMultiline
{-# LINE 6087 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorPrecedence =
({-# LINE 970 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6092 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorAssociative =
({-# LINE 971 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6097 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisAssociative
{-# LINE 6102 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIprecedence
{-# LINE 6107 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ExprIndex _indexIcopy
{-# LINE 6112 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6117 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIcomments
{-# LINE 6122 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6127 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6132 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6137 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6142 "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 index_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 973 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '.' <> tok index_
{-# LINE 6163 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 974 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6168 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6173 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 6178 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
DotIndex index_
{-# LINE 6183 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6188 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6193 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
-- PrefixExp ---------------------------------------------------
-- cata
sem_PrefixExp :: PrefixExp ->
T_PrefixExp
sem_PrefixExp (PFVar _name _suffixes) =
(sem_PrefixExp_PFVar _name (sem_ExprSuffixList _suffixes))
sem_PrefixExp (ExprVar _expr _suffixes) =
(sem_PrefixExp_ExprVar (sem_MExpr _expr) (sem_ExprSuffixList _suffixes))
-- semantic domain
type T_PrefixExp = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),PrefixExp,Bool,Bool,Bool,OperatorLevel,Doc,Bool)
data Inh_PrefixExp = Inh_PrefixExp {comments_Inh_PrefixExp :: ([MToken]),forceMultiline_Inh_PrefixExp :: Bool,indent_Inh_PrefixExp :: Int,parentOperatorAssociative_Inh_PrefixExp :: Bool,parentOperatorPrecedence_Inh_PrefixExp :: OperatorLevel,ppconf_Inh_PrefixExp :: PrettyPrintConfig}
data Syn_PrefixExp = Syn_PrefixExp {comments_Syn_PrefixExp :: ([MToken]),copy_Syn_PrefixExp :: PrefixExp,isAssociative_Syn_PrefixExp :: Bool,isLiteral_Syn_PrefixExp :: Bool,isMultiline_Syn_PrefixExp :: Bool,precedence_Syn_PrefixExp :: OperatorLevel,pretty_Syn_PrefixExp :: Doc,startsWithExprPrefixExpression_Syn_PrefixExp :: Bool}
wrap_PrefixExp :: T_PrefixExp ->
Inh_PrefixExp ->
Syn_PrefixExp
wrap_PrefixExp sem (Inh_PrefixExp _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithExprPrefixExpression) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIparentOperatorAssociative _lhsIparentOperatorPrecedence _lhsIppconf
in (Syn_PrefixExp _lhsOcomments _lhsOcopy _lhsOisAssociative _lhsOisLiteral _lhsOisMultiline _lhsOprecedence _lhsOpretty _lhsOstartsWithExprPrefixExpression))
sem_PrefixExp_PFVar :: MToken ->
T_ExprSuffixList ->
T_PrefixExp
sem_PrefixExp_PFVar name_ suffixes_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: 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 =
({-# LINE 909 "src/GLua/AG/PrettyPrint.ag" #-}
tok name_ <> _suffixesIpretty
{-# LINE 6251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 910 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 911 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 912 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisMultiline
{-# LINE 6266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisAssociative
{-# LINE 6271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIprecedence
{-# LINE 6276 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
PFVar name_ _suffixesIcopy
{-# LINE 6281 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6286 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6291 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6296 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6301 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6306 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6311 "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 expr_ suffixes_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIparentOperatorAssociative
_lhsIparentOperatorPrecedence
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: 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 =
({-# LINE 914 "src/GLua/AG/PrettyPrint.ag" #-}
(if _noparens then _exprIpretty else parens _lhsIppconf NonEmpty _exprIpretty)
<> _suffixesIpretty
{-# LINE 6363 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 917 "src/GLua/AG/PrettyPrint.ag" #-}
if _noparens then _exprIprecedence else OperatorLevel8
{-# LINE 6368 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 918 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6373 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 919 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6378 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 920 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline || _suffixesIisMultiline
{-# LINE 6383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_containsParenthesizedExpr =
({-# LINE 924 "src/GLua/AG/PrettyPrint.ag" #-}
case _exprIcopy of
MExpr _ (APrefixExpr (ExprVar (MExpr _ AVarArg) _)) -> False
MExpr _ (APrefixExpr _) -> True
_ -> False
{-# LINE 6391 "src/GLua/AG/PrettyPrint.hs" #-}
)
_noparens =
({-# LINE 930 "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 6407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 269 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative && _suffixesIisAssociative
{-# LINE 6412 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ExprVar _exprIcopy _suffixesIcopy
{-# LINE 6417 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6422 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6427 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6432 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6437 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6442 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 260 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 6447 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 259 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 6452 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6457 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 6462 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6467 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6472 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6477 "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)))
-- Stat --------------------------------------------------------
-- cata
sem_Stat :: Stat ->
T_Stat
sem_Stat (Def _vars) =
(sem_Stat_Def (sem_VarsList _vars))
sem_Stat (LocDef _vars) =
(sem_Stat_LocDef (sem_VarsList _vars))
sem_Stat (AFuncCall _fn) =
(sem_Stat_AFuncCall (sem_PrefixExp _fn))
sem_Stat (ALabel _lbl) =
(sem_Stat_ALabel _lbl)
sem_Stat (ABreak) =
(sem_Stat_ABreak)
sem_Stat (AContinue) =
(sem_Stat_AContinue)
sem_Stat (AGoto _lbl) =
(sem_Stat_AGoto _lbl)
sem_Stat (ADo _body) =
(sem_Stat_ADo (sem_Block _body))
sem_Stat (AWhile _cond _body) =
(sem_Stat_AWhile (sem_MExpr _cond) (sem_Block _body))
sem_Stat (ARepeat _body _cond) =
(sem_Stat_ARepeat (sem_Block _body) (sem_MExpr _cond))
sem_Stat (AIf _cond _body _elifs _els) =
(sem_Stat_AIf (sem_MExpr _cond) (sem_Block _body) (sem_ElseIfList _elifs) (sem_Else _els))
sem_Stat (ANFor _var _val _to _step _body) =
(sem_Stat_ANFor _var (sem_MExpr _val) (sem_MExpr _to) (sem_MExpr _step) (sem_Block _body))
sem_Stat (AGFor _vars _vals _body) =
(sem_Stat_AGFor _vars (sem_MExprList _vals) (sem_Block _body))
sem_Stat (AFunc _name _args _body) =
(sem_Stat_AFunc (sem_FuncName _name) _args (sem_Block _body))
sem_Stat (ALocFunc _name _args _body) =
(sem_Stat_ALocFunc (sem_FuncName _name) _args (sem_Block _body))
-- semantic domain
type T_Stat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Region ->
Bool ->
( ([MToken]),Stat,Bool,Bool,Doc,Bool)
data Inh_Stat = Inh_Stat {comments_Inh_Stat :: ([MToken]),forceMultiline_Inh_Stat :: Bool,indent_Inh_Stat :: Int,isLastStatement_Inh_Stat :: Bool,ppconf_Inh_Stat :: PrettyPrintConfig,statRegion_Inh_Stat :: Region,wouldBeAmbiguousWithoutSemicolon_Inh_Stat :: Bool}
data Syn_Stat = Syn_Stat {comments_Syn_Stat :: ([MToken]),copy_Syn_Stat :: Stat,endsWithPrefixExpression_Syn_Stat :: Bool,isMultiline_Syn_Stat :: Bool,pretty_Syn_Stat :: Doc,startsWithExprPrefixExpression_Syn_Stat :: Bool}
wrap_Stat :: T_Stat ->
Inh_Stat ->
Syn_Stat
wrap_Stat sem (Inh_Stat _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIisLastStatement _lhsIppconf _lhsIstatRegion _lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIisLastStatement _lhsIppconf _lhsIstatRegion _lhsIwouldBeAmbiguousWithoutSemicolon
in (Syn_Stat _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOisMultiline _lhsOpretty _lhsOstartsWithExprPrefixExpression))
sem_Stat_Def :: T_VarsList ->
T_Stat
sem_Stat_Def vars_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: 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
_varsIisLast :: Bool
_varsIisMultiline :: Bool
_varsIpretty :: Doc
_varsIstartsWithExprPrefixExpression :: Bool
_varsIvarPretty :: Doc
_lhsOpretty =
({-# LINE 646 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIpretty <> _semicolon
{-# LINE 6568 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 647 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6573 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 648 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6578 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 649 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6583 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 650 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon
then zchr ';'
else empty
{-# LINE 6590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
Def _varsIcopy
{-# LINE 6595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6615 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6620 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6625 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _varsIcomments,_varsIcopy,_varsIendsWithPrefixExpression,_varsIexprPretty,_varsIisDefined,_varsIisLast,_varsIisMultiline,_varsIpretty,_varsIstartsWithExprPrefixExpression,_varsIvarPretty) =
vars_ _varsOcomments _varsOforceMultiline _varsOindent _varsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_LocDef :: T_VarsList ->
T_Stat
sem_Stat_LocDef vars_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: 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
_varsIisLast :: Bool
_varsIisMultiline :: Bool
_varsIpretty :: Doc
_varsIstartsWithExprPrefixExpression :: Bool
_varsIvarPretty :: Doc
_lhsOpretty =
({-# LINE 655 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "local" <-> _varsIpretty <> _semicolon
{-# LINE 6663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 656 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 657 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6673 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 658 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6678 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 659 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon
then zchr ';'
else empty
{-# LINE 6685 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
LocDef _varsIcopy
{-# LINE 6690 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6695 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6700 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6705 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6710 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6715 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6720 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _varsIcomments,_varsIcopy,_varsIendsWithPrefixExpression,_varsIexprPretty,_varsIisDefined,_varsIisLast,_varsIisMultiline,_varsIpretty,_varsIstartsWithExprPrefixExpression,_varsIvarPretty) =
vars_ _varsOcomments _varsOforceMultiline _varsOindent _varsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AFuncCall :: T_PrefixExp ->
T_Stat
sem_Stat_AFuncCall fn_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_fnOparentOperatorPrecedence :: OperatorLevel
_fnOparentOperatorAssociative :: 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 =
({-# LINE 664 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIpretty <> _semicolon
{-# LINE 6758 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 665 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIisMultiline
{-# LINE 6763 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 666 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6768 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 667 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIstartsWithExprPrefixExpression
{-# LINE 6773 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 668 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6778 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorPrecedence =
({-# LINE 669 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6783 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorAssociative =
({-# LINE 670 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6788 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AFuncCall _fnIcopy
{-# LINE 6793 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6798 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIcomments
{-# LINE 6803 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6808 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6813 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6818 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6823 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _fnIcomments,_fnIcopy,_fnIisAssociative,_fnIisLiteral,_fnIisMultiline,_fnIprecedence,_fnIpretty,_fnIstartsWithExprPrefixExpression) =
fn_ _fnOcomments _fnOforceMultiline _fnOindent _fnOparentOperatorAssociative _fnOparentOperatorPrecedence _fnOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ALabel :: MToken ->
T_Stat
sem_Stat_ALabel lbl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 672 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "::"
<> _whitespace
<> tok lbl_
<> _whitespace
<> zeroWidthText "::"
{-# LINE 6851 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 678 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6856 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 679 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6861 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 680 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6866 "src/GLua/AG/PrettyPrint.hs" #-}
)
_whitespace =
({-# LINE 681 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterLabel _lhsIppconf then zeroWidthText " " else empty
{-# LINE 6871 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ALabel lbl_
{-# LINE 6876 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6881 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6886 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ABreak :: T_Stat
sem_Stat_ABreak =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 683 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "break" <> _semicolon
{-# LINE 6907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 684 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 685 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 686 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 687 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ABreak
{-# LINE 6932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6942 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AContinue :: T_Stat
sem_Stat_AContinue =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 689 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "continue" <> _semicolon
{-# LINE 6963 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 690 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6968 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 691 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6973 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 692 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6978 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 693 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6983 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AContinue
{-# LINE 6988 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6993 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6998 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AGoto :: MToken ->
T_Stat
sem_Stat_AGoto lbl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 695 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "goto" <-> tok lbl_ <> _semicolon
{-# LINE 7020 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 696 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7025 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 697 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7030 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 698 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7035 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 699 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 7040 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AGoto lbl_
{-# LINE 7045 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7050 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7055 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ADo :: T_Block ->
T_Stat
sem_Stat_ADo body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 701 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7088 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 702 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "do"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 706 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 707 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 708 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ADo _bodyIcopy
{-# LINE 7115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7130 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7135 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7140 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7145 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AWhile :: T_MExpr ->
T_Block ->
T_Stat
sem_Stat_AWhile cond_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_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
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 710 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7196 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 711 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7201 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 712 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7206 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 713 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 714 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7216 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 715 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "while"
<-> _condIpretty
<-> zeroWidthText "do"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7225 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 721 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7230 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AWhile _condIcopy _bodyIcopy
{-# LINE 7235 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7240 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7245 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7250 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7255 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7260 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7265 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7270 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7275 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7280 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7285 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ARepeat :: T_Block ->
T_MExpr ->
T_Stat
sem_Stat_ARepeat body_ cond_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_bodyOindent :: Int
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: 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
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_condIcomments :: ([MToken])
_condIcopy :: MExpr
_condIendsWithPrefixExpression :: Bool
_condIisAssociative :: Bool
_condIisLiteral :: Bool
_condIisMultiline :: Bool
_condIpos :: Region
_condIprecedence :: OperatorLevel
_condIpretty :: Doc
_lhsOpretty =
({-# LINE 723 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "repeat"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "until" <-> _condIpretty)
{-# LINE 7340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 727 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 728 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 729 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 730 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 731 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7365 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 732 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7370 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ARepeat _bodyIcopy _condIcopy
{-# LINE 7375 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7380 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7385 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7390 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7395 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7400 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7405 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7410 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7415 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7420 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7425 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_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,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AIf :: T_MExpr ->
T_Block ->
T_ElseIfList ->
T_Else ->
T_Stat
sem_Stat_AIf cond_ body_ elifs_ els_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_condOcomments :: ([MToken])
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_bodyOindent :: Int
_bodyOstatRegion :: Region
_lhsOpretty :: Doc
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOisMultiline :: Bool
_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
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_elifsIcomments :: ([MToken])
_elifsIcopy :: ElseIfList
_elifsIelsesExist :: Bool
_elifsIisMultiline :: Bool
_elifsIpos :: Region
_elifsIpretty :: Doc
_elsIcomments :: ([MToken])
_elsIcopy :: Else
_elsIelsesExist :: Bool
_elsIisMultiline :: Bool
_elsIpos :: Region
_elsIpretty :: Doc
_isMultiline =
({-# LINE 734 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| _condIisMultiline
|| _bodyIisMultiline
|| _elifsIelsesExist
|| _elsIelsesExist
|| not (null $ fst _commentsAfterThen )
{-# LINE 7506 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 741 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7511 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 742 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 743 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if"
<-> _condIpretty
<-> zeroWidthText "then"
<-> _bodyIpretty
<-> zeroWidthText "end"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterThen )
{-# LINE 7526 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 750 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if"
<-> _condIpretty
<-> zeroWidthText "then"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterThen )
$+$ _bodyIpretty
$+$ _elifsIpretty
$+$ _elsIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7538 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterThen =
({-# LINE 760 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _bodyIpos) _lhsIcomments
{-# LINE 7543 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 762 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterThen
{-# LINE 7548 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 764 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7553 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 765 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7558 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 766 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 7563 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 767 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion `upto` _elifsIpos `upto` _elsIpos
{-# LINE 7568 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 768 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 7573 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AIf _condIcopy _bodyIcopy _elifsIcopy _elsIcopy
{-# LINE 7578 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7583 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_elsIcomments
{-# LINE 7588 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 251 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 7593 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7598 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7603 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7608 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7613 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7618 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7623 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7628 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7633 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7638 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7643 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_elifsIcomments
{-# LINE 7648 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7653 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7658 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7668 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_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,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ANFor :: MToken ->
T_MExpr ->
T_MExpr ->
T_MExpr ->
T_Block ->
T_Stat
sem_Stat_ANFor var_ val_ to_ step_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_valOcomments :: ([MToken])
_valOparentOperatorPrecedence :: OperatorLevel
_valOparentOperatorAssociative :: Bool
_toOparentOperatorPrecedence :: OperatorLevel
_toOparentOperatorAssociative :: Bool
_stepOparentOperatorPrecedence :: OperatorLevel
_stepOparentOperatorAssociative :: Bool
_bodyOindent :: Int
_lhsOcopy :: Stat
_lhsOcomments :: ([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
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 770 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7758 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 771 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7763 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 772 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7768 "src/GLua/AG/PrettyPrint.hs" #-}
)
_step =
({-# LINE 773 "src/GLua/AG/PrettyPrint.ag" #-}
case _stepIcopy of
MExpr _ (ANumber "1") -> empty
_ -> _comma <> _stepIpretty
{-# LINE 7775 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 776 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "for"
<-> tok var_
<-> zchr '='
<-> _valIpretty
<> _comma
<> _toIpretty
<> _step
<-> zeroWidthText "do"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterFor )
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7790 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 788 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 7797 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFor =
({-# LINE 792 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` mpos var_) _lhsIcomments
{-# LINE 7802 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOcomments =
({-# LINE 794 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFor
{-# LINE 7807 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorPrecedence =
({-# LINE 795 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7812 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorAssociative =
({-# LINE 796 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7817 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorPrecedence =
({-# LINE 797 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7822 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorAssociative =
({-# LINE 798 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7827 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorPrecedence =
({-# LINE 799 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7832 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorAssociative =
({-# LINE 800 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7837 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 801 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7842 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ANFor var_ _valIcopy _toIcopy _stepIcopy _bodyIcopy
{-# LINE 7847 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7852 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7857 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7862 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7867 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7872 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_valIcomments
{-# LINE 7877 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7882 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7887 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7892 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_toIcomments
{-# LINE 7897 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7902 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_stepIcomments
{-# LINE 7917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7932 "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,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AGFor :: ([MToken]) ->
T_MExprList ->
T_Block ->
T_Stat
sem_Stat_AGFor vars_ vals_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_valsOcomments :: ([MToken])
_valsOforceMultiline :: Bool
_valsOsomeElementsInListAreMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_valsOindent :: Int
_valsOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_valsIcomments :: ([MToken])
_valsIcopy :: MExprList
_valsIisAssociative :: Bool
_valsIisLast :: Bool
_valsIisMultiline :: Bool
_valsIpos :: Region
_valsIprecedence :: OperatorLevel
_valsIpretty :: Doc
_valsIstartsWithNewline :: Bool
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 803 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7989 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 804 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7994 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 805 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7999 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 806 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "for"
<-> printList tok (render _comma ) vars_
<-> zeroWidthText "in"
<-> _valsIpretty
<-> zeroWidthText "do"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterFor )
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8011 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 815 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8016 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 816 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8023 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFor =
({-# LINE 820 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` mpos (head vars_)) _lhsIcomments
{-# LINE 8028 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOcomments =
({-# LINE 822 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFor
{-# LINE 8033 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOforceMultiline =
({-# LINE 824 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8038 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOsomeElementsInListAreMultiline =
({-# LINE 825 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8043 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AGFor vars_ _valsIcopy _bodyIcopy
{-# LINE 8048 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8053 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8058 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8063 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8068 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_valsIcomments
{-# LINE 8073 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8078 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8083 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8088 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valsIcomments,_valsIcopy,_valsIisAssociative,_valsIisLast,_valsIisMultiline,_valsIpos,_valsIprecedence,_valsIpretty,_valsIstartsWithNewline) =
vals_ _valsOcomments _valsOforceMultiline _valsOindent _valsOppconf _valsOsomeElementsInListAreMultiline
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AFunc :: T_FuncName ->
([MToken]) ->
T_Block ->
T_Stat
sem_Stat_AFunc name_ args_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_nameOcomments :: ([MToken])
_bodyOindent :: Int
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_nameOindent :: Int
_nameOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_nameIcomments :: ([MToken])
_nameIcopy :: FuncName
_nameIisMultiline :: Bool
_nameIpos :: Region
_nameIpretty :: Doc
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 827 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8135 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 828 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8140 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 829 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8145 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 830 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function"
<-> _nameIpretty
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_)
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterFunc )
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8155 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFunc =
({-# LINE 837 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _nameIpos) _lhsIcomments
{-# LINE 8160 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 839 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFunc
{-# LINE 8165 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 840 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8170 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 841 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8177 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 845 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8182 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8187 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8192 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8197 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8202 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8207 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8212 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8217 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8222 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8227 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpos,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ALocFunc :: T_FuncName ->
([MToken]) ->
T_Block ->
T_Stat
sem_Stat_ALocFunc name_ args_ body_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIisLastStatement
_lhsIppconf
_lhsIstatRegion
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_nameOcomments :: ([MToken])
_bodyOindent :: Int
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_nameOindent :: Int
_nameOppconf :: PrettyPrintConfig
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_nameIcomments :: ([MToken])
_nameIcopy :: FuncName
_nameIisMultiline :: Bool
_nameIpos :: Region
_nameIpretty :: Doc
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpos :: Region
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline =
({-# LINE 847 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8274 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 848 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "local function"
<-> _nameIpretty
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) args_)
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterFunc )
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 8284 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 855 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8289 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 856 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8294 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFunc =
({-# LINE 857 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _nameIpos) _lhsIcomments
{-# LINE 8299 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 859 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFunc
{-# LINE 8304 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 860 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8309 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 861 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8316 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 865 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8321 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ALocFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8326 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8331 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8336 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8341 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8346 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8351 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8356 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8361 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 320 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8366 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpos,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpos,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
-- UnOp --------------------------------------------------------
-- cata
sem_UnOp :: UnOp ->
T_UnOp
sem_UnOp (UnMinus) =
(sem_UnOp_UnMinus)
sem_UnOp (ANot) =
(sem_UnOp_ANot)
sem_UnOp (AHash) =
(sem_UnOp_AHash)
-- semantic domain
type T_UnOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),UnOp,Bool,Doc)
data Inh_UnOp = Inh_UnOp {comments_Inh_UnOp :: ([MToken]),indent_Inh_UnOp :: Int,ppconf_Inh_UnOp :: PrettyPrintConfig}
data Syn_UnOp = Syn_UnOp {comments_Syn_UnOp :: ([MToken]),copy_Syn_UnOp :: UnOp,isMultiline_Syn_UnOp :: Bool,pretty_Syn_UnOp :: Doc}
wrap_UnOp :: T_UnOp ->
Inh_UnOp ->
Syn_UnOp
wrap_UnOp sem (Inh_UnOp _lhsIcomments _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty) = sem _lhsIcomments _lhsIindent _lhsIppconf
in (Syn_UnOp _lhsOcomments _lhsOcopy _lhsOisMultiline _lhsOpretty))
sem_UnOp_UnMinus :: T_UnOp
sem_UnOp_UnMinus =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1203 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 8408 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1204 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8413 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
UnMinus
{-# LINE 8418 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8423 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8428 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_ANot :: T_UnOp
sem_UnOp_ANot =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1206 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!" else "not ")
{-# LINE 8443 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1207 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8448 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
ANot
{-# LINE 8453 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8458 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8463 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_AHash :: T_UnOp
sem_UnOp_AHash =
(\ _lhsIcomments
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 1209 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "#"
{-# LINE 8478 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1210 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8483 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
AHash
{-# LINE 8488 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8493 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8498 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
-- VarsList ----------------------------------------------------
-- cata
sem_VarsList :: VarsList ->
T_VarsList
sem_VarsList list =
(Prelude.foldr sem_VarsList_Cons sem_VarsList_Nil (Prelude.map sem_Declaration list))
-- semantic domain
type T_VarsList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),VarsList,Bool,Doc,Bool,Bool,Bool,Doc,Bool,Doc)
data Inh_VarsList = Inh_VarsList {comments_Inh_VarsList :: ([MToken]),forceMultiline_Inh_VarsList :: Bool,indent_Inh_VarsList :: Int,ppconf_Inh_VarsList :: PrettyPrintConfig}
data Syn_VarsList = Syn_VarsList {comments_Syn_VarsList :: ([MToken]),copy_Syn_VarsList :: VarsList,endsWithPrefixExpression_Syn_VarsList :: Bool,exprPretty_Syn_VarsList :: Doc,isDefined_Syn_VarsList :: Bool,isLast_Syn_VarsList :: Bool,isMultiline_Syn_VarsList :: Bool,pretty_Syn_VarsList :: Doc,startsWithExprPrefixExpression_Syn_VarsList :: Bool,varPretty_Syn_VarsList :: Doc}
wrap_VarsList :: T_VarsList ->
Inh_VarsList ->
Syn_VarsList
wrap_VarsList sem (Inh_VarsList _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf) =
(let ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty) = sem _lhsIcomments _lhsIforceMultiline _lhsIindent _lhsIppconf
in (Syn_VarsList _lhsOcomments _lhsOcopy _lhsOendsWithPrefixExpression _lhsOexprPretty _lhsOisDefined _lhsOisLast _lhsOisMultiline _lhsOpretty _lhsOstartsWithExprPrefixExpression _lhsOvarPretty))
sem_VarsList_Cons :: T_Declaration ->
T_VarsList ->
T_VarsList
sem_VarsList_Cons hd_ tl_ =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOexprPretty :: Doc
_lhsOisDefined :: 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
_tlIisLast :: Bool
_tlIisMultiline :: Bool
_tlIpretty :: Doc
_tlIstartsWithExprPrefixExpression :: Bool
_tlIvarPretty :: Doc
_lhsOpretty =
({-# LINE 535 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty
<-> if _isDefined then zchr '=' <-> _exprPretty else empty
{-# LINE 8570 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 538 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 8575 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 539 "src/GLua/AG/PrettyPrint.ag" #-}
if _tlIisDefined then _tlIendsWithPrefixExpression else _hdIendsWithPrefixExpression
{-# LINE 8580 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 546 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 8585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isDefined =
({-# LINE 547 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisDefined || _tlIisDefined
{-# LINE 8590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varPretty =
({-# LINE 548 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIvarPretty
<> (if _tlIisLast then empty else _comma )
<> _tlIvarPretty
{-# LINE 8597 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprPretty =
({-# LINE 552 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIexprPretty
<> (if not _tlIisLast && _tlIisDefined then _comma else empty)
<> _tlIexprPretty
{-# LINE 8604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 556 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8611 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 560 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8616 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 273 "src/GLua/AG/PrettyPrint.ag" #-}
_exprPretty
{-# LINE 8621 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 276 "src/GLua/AG/PrettyPrint.ag" #-}
_isDefined
{-# LINE 8626 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 272 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty
{-# LINE 8631 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 8636 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8641 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 8646 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8651 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8656 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8661 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8666 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 8671 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 353 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8676 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 250 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8681 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 252 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8686 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIendsWithPrefixExpression,_hdIexprPretty,_hdIisDefined,_hdIisMultiline,_hdIpretty,_hdIstartsWithExprPrefixExpression,_hdIvarPretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIendsWithPrefixExpression,_tlIexprPretty,_tlIisDefined,_tlIisLast,_tlIisMultiline,_tlIpretty,_tlIstartsWithExprPrefixExpression,_tlIvarPretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))
sem_VarsList_Nil :: T_VarsList
sem_VarsList_Nil =
(\ _lhsIcomments
_lhsIforceMultiline
_lhsIindent
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOexprPretty :: Doc
_lhsOisDefined :: Bool
_lhsOvarPretty :: Doc
_lhsOcopy :: VarsList
_lhsOcomments :: ([MToken])
_lhsOpretty =
({-# LINE 562 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8712 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 563 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8717 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 564 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8722 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 565 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8727 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 566 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8732 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 273 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8737 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 276 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8742 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 272 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8747 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 8752 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 253 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8757 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 305 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8762 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))