{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module GLua.AG.PrettyPrint where
{-# LINE 10 "src/GLua/AG/AST.ag" #-}
import GLua.AG.Token
import GLua.Position
import GLua.TokenTypes ()
import GHC.Generics
import Data.Aeson
{-# LINE 16 "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 30 "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
renderPSError :: ParseError -> String
renderPSError ps =
map replNL
. showErrorMessages
"or"
"unknown parse error"
"expecting"
"unexpected"
"end of input"
. errorMessages
$ ps
where
replNL '\n' = ' '
replNL c = c
renderMLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc
renderMLComments conf ind toks =
foldl' ($+$) empty . map (indent conf ind . tok . convertComment conf) $ toks
renderSLComments :: PrettyPrintConfig -> Int -> [MToken] -> Doc
renderSLComments conf ind toks = foldl' combine empty . map (convertComment conf) $ toks
where
combine :: Doc -> MToken -> Doc
combine acc mt@(MToken _pos t) =
case t of
DashBlockComment _depth comment | '\n' `elem` comment ->
acc $+$ (indent conf ind $ tok mt)
SlashBlockComment comment | '\n' `elem` comment ->
acc $+$ (indent conf ind $ tok mt)
_ -> acc <-> tok mt
convertComment :: PrettyPrintConfig -> MToken -> MToken
convertComment conf (MToken p t) = MToken p $ convert' t
where
convert' :: Token -> Token
convert' = if cStyle conf then cComment else luaComment
luaComment :: Token -> Token
luaComment (SlashComment s) = DashComment s
luaComment (SlashBlockComment s) = DashBlockComment (lastBracket s) s
luaComment t' = t'
lastBracket :: String -> Int
lastBracket [] = 0
lastBracket s = if last s == ']' then 1 else 0
cComment :: Token -> Token
cComment (DashComment s) = SlashComment s
cComment (DashBlockComment _ s) = SlashBlockComment s
cComment t' = t'
indent :: PrettyPrintConfig -> Int -> Doc -> Doc
indent conf n = (<>) $ zeroWidthText (concat . replicate n $ indentation conf)
parens :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc
parens conf ie doc = zchr '(' `sep'` doc `sep'` zchr ')'
where
sep' :: Doc -> Doc -> Doc
sep' =
if spaceAfterParens conf && (not (fromEmpty ie) || spaceEmptyParens conf)
then (<->)
else (<>)
brackets :: PrettyPrintConfig -> Doc -> Doc
brackets conf doc = zchr '[' `sep'` doc `sep'` zchr ']'
where
sep' :: Doc -> Doc -> Doc
sep' = if spaceAfterBrackets conf then (<->) else (<>)
braces :: PrettyPrintConfig -> IsEmpty -> Doc -> Doc
braces conf ie doc = zchr '{' `sep'` doc `sep'` zchr '}'
where
sep' :: Doc -> Doc -> Doc
sep' =
if spaceAfterBraces conf && (not (fromEmpty ie) || spaceEmptyBraces conf)
then (<->)
else (<>)
zchr :: Char -> Doc
zchr c = zeroWidthText [c]
infixl 6 <->
(<->) :: Doc -> Doc -> Doc
a <-> b | a == empty = b
| b == empty = a
| otherwise = a <> zchr ' ' <> b
data OperatorLevel
= TopLevelExpression
| OperatorLevel1
| OperatorLevel2
| OperatorLevel3
| OperatorLevel4
| OperatorLevel5
| OperatorLevel6
| OperatorLevel7
| OperatorLevel8
deriving (Eq, Ord)
commentsForceMultiline :: [MToken] -> Bool
commentsForceMultiline commentTokens = any containsFormatMultiline commentTokens
where
containsFormatMultiline :: MToken -> Bool
containsFormatMultiline (MToken _pos t) = case t of
DashComment comment -> stringForcesFormat comment
DashBlockComment _ comment -> stringForcesFormat comment
SlashComment comment -> stringForcesFormat comment
SlashBlockComment comment -> stringForcesFormat comment
_ -> False
stringForcesFormat :: String -> Bool
stringForcesFormat s = "format: multiline" `isInfixOf` s
{-# LINE 273 "src/GLua/AG/PrettyPrint.hs" #-}
{-# LINE 1206 "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 453 "src/GLua/AG/PrettyPrint.hs" #-}
sem_AReturn :: AReturn ->
T_AReturn
sem_AReturn :: AReturn -> T_AReturn
sem_AReturn (AReturn Region
_pos [MExpr]
_values) =
(Region -> T_MExprList -> T_AReturn
sem_AReturn_AReturn Region
_pos ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_values))
sem_AReturn (AReturn
NoReturn) =
(T_AReturn
sem_AReturn_NoReturn)
type T_AReturn = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),AReturn,Bool,Doc,Int)
data Inh_AReturn = Inh_AReturn { :: ([MToken]),Inh_AReturn -> Bool
forceMultiline_Inh_AReturn :: Bool,Inh_AReturn -> Int
indent_Inh_AReturn :: Int,Inh_AReturn -> PrettyPrintConfig
ppconf_Inh_AReturn :: PrettyPrintConfig}
data Syn_AReturn = Syn_AReturn { :: ([MToken]),Syn_AReturn -> AReturn
copy_Syn_AReturn :: AReturn,Syn_AReturn -> Bool
isMultiline_Syn_AReturn :: Bool,Syn_AReturn -> Doc
pretty_Syn_AReturn :: Doc,Syn_AReturn -> Int
statementCount_Syn_AReturn :: Int}
wrap_AReturn :: T_AReturn ->
Inh_AReturn ->
Syn_AReturn
wrap_AReturn :: T_AReturn -> Inh_AReturn -> Syn_AReturn
wrap_AReturn T_AReturn
sem (Inh_AReturn [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,AReturn
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Int
_lhsOstatementCount) = T_AReturn
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> AReturn -> Bool -> Doc -> Int -> Syn_AReturn
Syn_AReturn [MToken]
_lhsOcomments AReturn
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty Int
_lhsOstatementCount))
sem_AReturn_AReturn :: Region ->
T_MExprList ->
T_AReturn
sem_AReturn_AReturn :: Region -> T_MExprList -> T_AReturn
sem_AReturn_AReturn Region
pos_ T_MExprList
values_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 864 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBefore )
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "return")
<-> _valuesIpretty
<> _semicolon
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 509 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 870 "src/GLua/AG/PrettyPrint.ag" #-}
_valuesIisMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 874 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 521 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 875 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `before` pos_) _lhsIcomments
{-# LINE 526 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOcomments =
({-# LINE 876 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBefore
{-# LINE 531 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 877 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` (rgOr _valuesIpos pos_)) _valuesIcomments
{-# LINE 536 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 879 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOforceMultiline =
({-# LINE 883 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOsomeElementsInListAreMultiline =
({-# LINE 884 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 885 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 556 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AReturn pos_ _valuesIcopy
{-# LINE 561 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 566 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 571 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valuesOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 576 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valuesIcomments,_valuesIcopy,_valuesIisAssociative,_valuesIisLast,_valuesIisMultiline,_valuesIpos,_valuesIprecedence,_valuesIpretty) =
values_ _valuesOcomments _valuesOforceMultiline _valuesOindent _valuesOppconf _valuesOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_AReturn_NoReturn :: T_AReturn
sem_AReturn_NoReturn :: T_AReturn
sem_AReturn_NoReturn =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOcopy :: AReturn
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 887 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 888 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 889 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
NoReturn
{-# LINE 610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 615 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 620 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty,_lhsOstatementCount)))
sem_AST :: AST ->
T_AST
sem_AST :: AST -> T_AST
sem_AST (AST [MToken]
_comments Block
_chunk) =
([MToken] -> T_Block -> T_AST
sem_AST_AST [MToken]
_comments (Block -> T_Block
sem_Block Block
_chunk))
type T_AST = Int ->
PrettyPrintConfig ->
( AST,Bool,Doc)
data Inh_AST = Inh_AST {Inh_AST -> Int
indent_Inh_AST :: Int,Inh_AST -> PrettyPrintConfig
ppconf_Inh_AST :: PrettyPrintConfig}
data Syn_AST = Syn_AST {Syn_AST -> AST
copy_Syn_AST :: AST,Syn_AST -> Bool
isMultiline_Syn_AST :: Bool,Syn_AST -> Doc
pretty_Syn_AST :: Doc}
wrap_AST :: T_AST ->
Inh_AST ->
Syn_AST
wrap_AST :: T_AST -> Inh_AST -> Syn_AST
wrap_AST T_AST
sem (Inh_AST Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( AST
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_AST
sem Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (AST -> Bool -> Doc -> Syn_AST
Syn_AST AST
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_AST_AST :: ([MToken]) ->
T_Block ->
T_AST
sem_AST_AST :: [MToken] -> T_Block -> T_AST
sem_AST_AST [MToken]
comments_ T_Block
chunk_ =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_chunkOcomments :: ([MToken])
_chunkOstatRegion :: Region
_chunkOforceMultiline :: Bool
_lhsOcopy :: AST
_chunkOindent :: Int
_chunkOppconf :: PrettyPrintConfig
_chunkIcomments :: ([MToken])
_chunkIcopy :: Block
_chunkIisMultiline :: Bool
_chunkIpretty :: Doc
_chunkIstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 621 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIpretty $+$ _prettyComments
{-# LINE 663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 622 "src/GLua/AG/PrettyPrint.ag" #-}
_chunkIisMultiline
{-# LINE 668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyComments =
({-# LINE 623 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent _chunkIcomments
{-# LINE 673 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOcomments =
({-# LINE 624 "src/GLua/AG/PrettyPrint.ag" #-}
comments_
{-# LINE 678 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOstatRegion =
({-# LINE 625 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 683 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOforceMultiline =
({-# LINE 626 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 688 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AST comments_ _chunkIcopy
{-# LINE 693 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 698 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 703 "src/GLua/AG/PrettyPrint.hs" #-}
)
_chunkOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 708 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _chunkIcomments,_chunkIcopy,_chunkIisMultiline,_chunkIpretty,_chunkIstatementCount) =
chunk_ _chunkOcomments _chunkOforceMultiline _chunkOindent _chunkOppconf _chunkOstatRegion
in ( _lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args :: Args ->
T_Args
sem_Args :: Args -> T_Args
sem_Args (ListArgs [MExpr]
_args) =
(T_MExprList -> T_Args
sem_Args_ListArgs ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_args))
sem_Args (TableArg FieldList
_arg) =
(T_FieldList -> T_Args
sem_Args_TableArg (FieldList -> T_FieldList
sem_FieldList FieldList
_arg))
sem_Args (StringArg MToken
_arg) =
(MToken -> T_Args
sem_Args_StringArg MToken
_arg)
type T_Args = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Args,Bool,Doc)
data Inh_Args = Inh_Args { :: ([MToken]),Inh_Args -> Bool
forceMultiline_Inh_Args :: Bool,Inh_Args -> Int
indent_Inh_Args :: Int,Inh_Args -> PrettyPrintConfig
ppconf_Inh_Args :: PrettyPrintConfig}
data Syn_Args = Syn_Args { :: ([MToken]),Syn_Args -> Args
copy_Syn_Args :: Args,Syn_Args -> Bool
isMultiline_Syn_Args :: Bool,Syn_Args -> Doc
pretty_Syn_Args :: Doc}
wrap_Args :: T_Args ->
Inh_Args ->
Syn_Args
wrap_Args :: T_Args -> Inh_Args -> Syn_Args
wrap_Args T_Args
sem (Inh_Args [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,Args
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_Args
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> Args -> Bool -> Doc -> Syn_Args
Syn_Args [MToken]
_lhsOcomments Args
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_Args_ListArgs :: T_MExprList ->
T_Args
sem_Args_ListArgs :: T_MExprList -> T_Args
sem_Args_ListArgs T_MExprList
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1062 "src/GLua/AG/PrettyPrint.ag" #-}
if _argsIisMultiline then
zchr '(' $+$
_argsIpretty $+$
indent _lhsIppconf _lhsIindent (zchr ')')
else
parens _lhsIppconf _emptyParams _argsIpretty
{-# LINE 769 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1069 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 774 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 1070 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argsIcopy
{-# LINE 779 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 1071 "src/GLua/AG/PrettyPrint.ag" #-}
if _argsIisMultiline then _lhsIindent + 1 else 0
{-# LINE 784 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOsomeElementsInListAreMultiline =
({-# LINE 1072 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 789 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ListArgs _argsIcopy
{-# LINE 794 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 799 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 804 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 809 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 814 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 819 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisAssociative,_argsIisLast,_argsIisMultiline,_argsIpos,_argsIprecedence,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf _argsOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_Args_TableArg :: T_FieldList ->
T_Args
sem_Args_TableArg :: T_FieldList -> T_Args
sem_Args_TableArg T_FieldList
arg_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 1074 "src/GLua/AG/PrettyPrint.ag" #-}
if _argIisMultiline then _prettyMulti else _prettySingle
{-# LINE 848 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1075 "src/GLua/AG/PrettyPrint.ag" #-}
_argIisMultiline
{-# LINE 853 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 1076 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ _argIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 858 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 1077 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _argIpretty
{-# LINE 863 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 1078 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _argIcopy
{-# LINE 868 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOindent =
({-# LINE 1079 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _argIisMultiline then 1 else 0)
{-# LINE 873 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOsomeElementsInListAreMultiline =
({-# LINE 1080 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 878 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
TableArg _argIcopy
{-# LINE 883 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 888 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_argIcomments
{-# LINE 893 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 898 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 903 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 908 "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 :: MToken -> T_Args
sem_Args_StringArg MToken
arg_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: Args
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1082 "src/GLua/AG/PrettyPrint.ag" #-}
tok arg_
{-# LINE 927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1083 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
StringArg arg_
{-# LINE 937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 947 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_BinOp :: BinOp ->
T_BinOp
sem_BinOp :: BinOp -> T_BinOp
sem_BinOp (BinOp
AOr) =
(T_BinOp
sem_BinOp_AOr)
sem_BinOp (BinOp
AAnd) =
(T_BinOp
sem_BinOp_AAnd)
sem_BinOp (BinOp
ALT) =
(T_BinOp
sem_BinOp_ALT)
sem_BinOp (BinOp
AGT) =
(T_BinOp
sem_BinOp_AGT)
sem_BinOp (BinOp
ALEQ) =
(T_BinOp
sem_BinOp_ALEQ)
sem_BinOp (BinOp
AGEQ) =
(T_BinOp
sem_BinOp_AGEQ)
sem_BinOp (BinOp
ANEq) =
(T_BinOp
sem_BinOp_ANEq)
sem_BinOp (BinOp
AEq) =
(T_BinOp
sem_BinOp_AEq)
sem_BinOp (BinOp
AConcatenate) =
(T_BinOp
sem_BinOp_AConcatenate)
sem_BinOp (BinOp
APlus) =
(T_BinOp
sem_BinOp_APlus)
sem_BinOp (BinOp
BinMinus) =
(T_BinOp
sem_BinOp_BinMinus)
sem_BinOp (BinOp
AMultiply) =
(T_BinOp
sem_BinOp_AMultiply)
sem_BinOp (BinOp
ADivide) =
(T_BinOp
sem_BinOp_ADivide)
sem_BinOp (BinOp
AModulus) =
(T_BinOp
sem_BinOp_AModulus)
sem_BinOp (BinOp
APower) =
(T_BinOp
sem_BinOp_APower)
type T_BinOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),BinOp,Bool,Bool,OperatorLevel,Doc)
data Inh_BinOp = Inh_BinOp { :: ([MToken]),Inh_BinOp -> Int
indent_Inh_BinOp :: Int,Inh_BinOp -> PrettyPrintConfig
ppconf_Inh_BinOp :: PrettyPrintConfig}
data Syn_BinOp = Syn_BinOp { :: ([MToken]),Syn_BinOp -> BinOp
copy_Syn_BinOp :: BinOp,Syn_BinOp -> Bool
isAssociative_Syn_BinOp :: Bool,Syn_BinOp -> Bool
isMultiline_Syn_BinOp :: Bool,Syn_BinOp -> OperatorLevel
precedence_Syn_BinOp :: OperatorLevel,Syn_BinOp -> Doc
pretty_Syn_BinOp :: Doc}
wrap_BinOp :: T_BinOp ->
Inh_BinOp ->
Syn_BinOp
wrap_BinOp :: T_BinOp -> Inh_BinOp -> Syn_BinOp
wrap_BinOp T_BinOp
sem (Inh_BinOp [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,BinOp
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_BinOp
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> BinOp -> Bool -> Bool -> OperatorLevel -> Doc -> Syn_BinOp
Syn_BinOp [MToken]
_lhsOcomments BinOp
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_BinOp_AOr :: T_BinOp
sem_BinOp_AOr :: T_BinOp
sem_BinOp_AOr =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1190 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "||" else "or")
{-# LINE 1011 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1191 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1016 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1192 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel1
{-# LINE 1021 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1193 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1026 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AOr
{-# LINE 1031 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1036 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1041 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AAnd :: T_BinOp
sem_BinOp_AAnd :: T_BinOp
sem_BinOp_AAnd =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1185 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "&&" else "and")
{-# LINE 1058 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1186 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1063 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1187 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel2
{-# LINE 1068 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1188 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1073 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AAnd
{-# LINE 1078 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1083 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1088 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALT :: T_BinOp
sem_BinOp_ALT :: T_BinOp
sem_BinOp_ALT =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1155 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<"
{-# LINE 1105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1156 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1157 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1158 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ALT
{-# LINE 1125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1130 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1135 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGT :: T_BinOp
sem_BinOp_AGT :: T_BinOp
sem_BinOp_AGT =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1165 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">"
{-# LINE 1152 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1166 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1157 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1167 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1162 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1168 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1167 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AGT
{-# LINE 1172 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1177 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1182 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ALEQ :: T_BinOp
sem_BinOp_ALEQ :: T_BinOp
sem_BinOp_ALEQ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1160 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "<="
{-# LINE 1199 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1161 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1204 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1162 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1209 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1163 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1214 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ALEQ
{-# LINE 1219 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1224 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1229 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AGEQ :: T_BinOp
sem_BinOp_AGEQ :: T_BinOp
sem_BinOp_AGEQ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1170 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ">="
{-# LINE 1246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1171 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1172 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1173 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AGEQ
{-# LINE 1266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1276 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ANEq :: T_BinOp
sem_BinOp_ANEq :: T_BinOp
sem_BinOp_ANEq =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1180 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!=" else "~=")
{-# LINE 1293 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1181 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1298 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1182 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1303 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1183 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1308 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ANEq
{-# LINE 1313 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1318 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1323 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AEq :: T_BinOp
sem_BinOp_AEq :: T_BinOp
sem_BinOp_AEq =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1175 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "=="
{-# LINE 1340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1176 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1177 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel3
{-# LINE 1350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1178 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AEq
{-# LINE 1360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1365 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1370 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AConcatenate :: T_BinOp
sem_BinOp_AConcatenate :: T_BinOp
sem_BinOp_AConcatenate =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1150 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText ".."
{-# LINE 1387 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1151 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1392 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1152 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel4
{-# LINE 1397 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1153 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1402 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AConcatenate
{-# LINE 1407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1412 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1417 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APlus :: T_BinOp
sem_BinOp_APlus :: T_BinOp
sem_BinOp_APlus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1120 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "+"
{-# LINE 1434 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1121 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1439 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1122 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1444 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1123 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1449 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
APlus
{-# LINE 1454 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1459 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1464 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_BinMinus :: T_BinOp
sem_BinOp_BinMinus :: T_BinOp
sem_BinOp_BinMinus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1125 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 1481 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1126 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1486 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1127 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel5
{-# LINE 1491 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1128 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1496 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
BinMinus
{-# LINE 1501 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1506 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1511 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AMultiply :: T_BinOp
sem_BinOp_AMultiply :: T_BinOp
sem_BinOp_AMultiply =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1130 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "*"
{-# LINE 1528 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1131 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1533 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1132 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1538 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1133 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1543 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AMultiply
{-# LINE 1548 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1553 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1558 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_ADivide :: T_BinOp
sem_BinOp_ADivide :: T_BinOp
sem_BinOp_ADivide =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1135 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "/"
{-# LINE 1575 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1136 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1580 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1137 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1138 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ADivide
{-# LINE 1595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1605 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_AModulus :: T_BinOp
sem_BinOp_AModulus :: T_BinOp
sem_BinOp_AModulus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1140 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "%"
{-# LINE 1622 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1141 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1627 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1142 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel6
{-# LINE 1632 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1143 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1637 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AModulus
{-# LINE 1642 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1647 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1652 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_BinOp_APower :: T_BinOp
sem_BinOp_APower :: T_BinOp
sem_BinOp_APower =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOisAssociative :: Bool
_lhsOcopy :: BinOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1145 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "^"
{-# LINE 1669 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1146 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1674 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1147 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 1679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 1148 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 1684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
APower
{-# LINE 1689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1699 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Block :: Block ->
T_Block
sem_Block :: Block -> T_Block
sem_Block (Block Region
_pos [MStat]
_stats AReturn
_ret) =
(Region -> T_MStatList -> T_AReturn -> T_Block
sem_Block_Block Region
_pos ([MStat] -> T_MStatList
sem_MStatList [MStat]
_stats) (AReturn -> T_AReturn
sem_AReturn AReturn
_ret))
type T_Block = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Block,Bool,Doc,Int)
data Inh_Block = Inh_Block { :: ([MToken]),Inh_Block -> Bool
forceMultiline_Inh_Block :: Bool,Inh_Block -> Int
indent_Inh_Block :: Int,Inh_Block -> PrettyPrintConfig
ppconf_Inh_Block :: PrettyPrintConfig,Inh_Block -> Region
statRegion_Inh_Block :: Region}
data Syn_Block = Syn_Block { :: ([MToken]),Syn_Block -> Block
copy_Syn_Block :: Block,Syn_Block -> Bool
isMultiline_Syn_Block :: Bool,Syn_Block -> Doc
pretty_Syn_Block :: Doc,Syn_Block -> Int
statementCount_Syn_Block :: Int}
wrap_Block :: T_Block ->
Inh_Block ->
Syn_Block
wrap_Block :: T_Block -> Inh_Block -> Syn_Block
wrap_Block T_Block
sem (Inh_Block [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Block
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Int
_lhsOstatementCount) = T_Block
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken] -> Block -> Bool -> Doc -> Int -> Syn_Block
Syn_Block [MToken]
_lhsOcomments Block
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty Int
_lhsOstatementCount))
sem_Block_Block :: Region ->
T_MStatList ->
T_AReturn ->
T_Block
sem_Block_Block :: Region -> T_MStatList -> T_AReturn -> T_Block
sem_Block_Block Region
pos_ T_MStatList
stats_ T_AReturn
ret_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 630 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline
then _statsIpretty $+$ _retIpretty $+$ _prettyCommentsAfter
else _statsIpretty <-> _retIpretty
{-# LINE 1764 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statementCount =
({-# LINE 634 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIstatementCount + _retIstatementCount
{-# LINE 1769 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 635 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIisMultiline || _retIisMultiline || _statementCount > 1 || not (null $ fst $ _commentsAfter )
{-# LINE 1774 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 636 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeEnd` pos_) _retIcomments
{-# LINE 1779 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 637 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent $ fst _commentsAfter
{-# LINE 1784 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 638 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 1789 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 324 "src/GLua/AG/PrettyPrint.ag" #-}
_statementCount
{-# LINE 1794 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Block pos_ _statsIcopy _retIcopy
{-# LINE 1799 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1804 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 1809 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1814 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1819 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1824 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1829 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statsOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 1834 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_statsIcomments
{-# LINE 1839 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_retOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 1854 "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,_lhsOpretty,_lhsOstatementCount)))
sem_Declaration :: Declaration ->
T_Declaration
sem_Declaration :: (PrefixExp, Maybe MExpr) -> T_Declaration
sem_Declaration ( PrefixExp
x1,Maybe MExpr
x2) =
(T_PrefixExp -> T_MaybeMExpr -> T_Declaration
sem_Declaration_Tuple (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
x1) (Maybe MExpr -> T_MaybeMExpr
sem_MaybeMExpr Maybe MExpr
x2))
type T_Declaration = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Declaration,Bool,Doc,Bool,Bool,Doc,Bool,Doc)
data Inh_Declaration = Inh_Declaration { :: ([MToken]),Inh_Declaration -> Bool
forceMultiline_Inh_Declaration :: Bool,Inh_Declaration -> Int
indent_Inh_Declaration :: Int,Inh_Declaration -> PrettyPrintConfig
ppconf_Inh_Declaration :: PrettyPrintConfig}
data Syn_Declaration = Syn_Declaration { :: ([MToken]),Syn_Declaration -> (PrefixExp, Maybe MExpr)
copy_Syn_Declaration :: Declaration,Syn_Declaration -> Bool
endsWithPrefixExpression_Syn_Declaration :: Bool,Syn_Declaration -> Doc
exprPretty_Syn_Declaration :: Doc,Syn_Declaration -> Bool
isDefined_Syn_Declaration :: Bool,Syn_Declaration -> Bool
isMultiline_Syn_Declaration :: Bool,Syn_Declaration -> Doc
pretty_Syn_Declaration :: Doc,Syn_Declaration -> Bool
startsWithExprPrefixExpression_Syn_Declaration :: Bool,Syn_Declaration -> Doc
varPretty_Syn_Declaration :: Doc}
wrap_Declaration :: T_Declaration ->
Inh_Declaration ->
Syn_Declaration
wrap_Declaration :: T_Declaration -> Inh_Declaration -> Syn_Declaration
wrap_Declaration T_Declaration
sem (Inh_Declaration [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,(PrefixExp, Maybe MExpr)
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Doc
_lhsOexprPretty,Bool
_lhsOisDefined,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Doc
_lhsOvarPretty) = T_Declaration
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> (PrefixExp, Maybe MExpr)
-> Bool
-> Doc
-> Bool
-> Bool
-> Doc
-> Bool
-> Doc
-> Syn_Declaration
Syn_Declaration [MToken]
_lhsOcomments (PrefixExp, Maybe MExpr)
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Doc
_lhsOexprPretty Bool
_lhsOisDefined Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Doc
_lhsOvarPretty))
sem_Declaration_Tuple :: T_PrefixExp ->
T_MaybeMExpr ->
T_Declaration
sem_Declaration_Tuple :: T_PrefixExp -> T_MaybeMExpr -> T_Declaration
sem_Declaration_Tuple T_PrefixExp
x1_ T_MaybeMExpr
x2_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOvarPretty :: Doc
_lhsOexprPretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOvarPretty =
({-# LINE 522 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Ipretty
{-# LINE 1927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 523 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 524 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IstartsWithExprPrefixExpression
{-# LINE 1937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 525 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IendsWithPrefixExpression
{-# LINE 1942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 526 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 1947 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 527 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 1952 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 528 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 1957 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 291 "src/GLua/AG/PrettyPrint.ag" #-}
_x2IisDefined
{-# LINE 1962 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 1967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 1972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 1977 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 264 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Ipretty
{-# LINE 1982 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 1987 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 1992 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 1997 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2002 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 2007 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2012 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2017 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2022 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _x1Icomments,_x1Icopy,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Iprecedence,_x1Ipretty,_x1IstartsWithExprPrefixExpression) =
x1_ _x1Ocomments _x1OforceMultiline _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf
( _x2Icomments,_x2Icopy,_x2IendsWithPrefixExpression,_x2IisAssociative,_x2IisDefined,_x2IisMultiline,_x2Iprecedence,_x2Ipretty) =
x2_ _x2Ocomments _x2OforceMultiline _x2Oindent _x2Oppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))
sem_Else :: Else ->
T_Else
sem_Else :: Maybe MElse -> T_Else
sem_Else (Prelude.Just MElse
x) =
(T_MElse -> T_Else
sem_Else_Just (MElse -> T_MElse
sem_MElse MElse
x))
sem_Else Maybe MElse
Prelude.Nothing =
T_Else
sem_Else_Nothing
type T_Else = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Else,Bool,Bool,Region,Doc)
data Inh_Else = Inh_Else { :: ([MToken]),Inh_Else -> Bool
forceMultiline_Inh_Else :: Bool,Inh_Else -> Int
indent_Inh_Else :: Int,Inh_Else -> PrettyPrintConfig
ppconf_Inh_Else :: PrettyPrintConfig,Inh_Else -> Region
statRegion_Inh_Else :: Region}
data Syn_Else = Syn_Else { :: ([MToken]),Syn_Else -> Maybe MElse
copy_Syn_Else :: Else,Syn_Else -> Bool
elsesExist_Syn_Else :: Bool,Syn_Else -> Bool
isMultiline_Syn_Else :: Bool,Syn_Else -> Region
pos_Syn_Else :: Region,Syn_Else -> Doc
pretty_Syn_Else :: Doc}
wrap_Else :: T_Else ->
Inh_Else ->
Syn_Else
wrap_Else :: T_Else -> Inh_Else -> Syn_Else
wrap_Else T_Else
sem (Inh_Else [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Maybe MElse
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_Else
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> Maybe MElse -> Bool -> Bool -> Region -> Doc -> Syn_Else
Syn_Else [MToken]
_lhsOcomments Maybe MElse
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_Else_Just :: T_MElse ->
T_Else
sem_Else_Just :: T_MElse -> T_Else
sem_Else_Just T_MElse
just_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOelsesExist :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Else
_lhsOcomments :: ([MToken])
_lhsOpos :: Region
_lhsOpretty :: Doc
_justOcomments :: ([MToken])
_justOforceMultiline :: Bool
_justOindent :: Int
_justOppconf :: PrettyPrintConfig
_justOstatRegion :: Region
_justIcomments :: ([MToken])
_justIcopy :: MElse
_justIelsesExist :: Bool
_justIisMultiline :: Bool
_justIpos :: Region
_justIpretty :: Doc
_lhsOelsesExist :: Bool
_lhsOelsesExist =
({-# LINE 592 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2080 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 593 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 2085 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 2090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 2100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 310 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpos
{-# LINE 2105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 264 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 2110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2130 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 2135 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _justIcomments,_justIcopy,_justIelsesExist,_justIisMultiline,_justIpos,_justIpretty) =
just_ _justOcomments _justOforceMultiline _justOindent _justOppconf _justOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_Else_Nothing :: T_Else
sem_Else_Nothing :: T_Else
sem_Else_Nothing =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOelsesExist :: Bool
_lhsOcopy :: Else
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 595 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2156 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 596 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2161 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 597 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2166 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 327 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2171 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 2176 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2181 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2186 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_ElseIf :: ElseIf ->
T_ElseIf
sem_ElseIf :: (MExpr, Block) -> T_ElseIf
sem_ElseIf ( MExpr
x1,Block
x2) =
(T_MExpr -> T_Block -> T_ElseIf
sem_ElseIf_Tuple (MExpr -> T_MExpr
sem_MExpr MExpr
x1) (Block -> T_Block
sem_Block Block
x2))
type T_ElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIf,Bool,Doc)
data Inh_ElseIf = Inh_ElseIf { :: ([MToken]),Inh_ElseIf -> Bool
forceMultiline_Inh_ElseIf :: Bool,Inh_ElseIf -> Int
indent_Inh_ElseIf :: Int,Inh_ElseIf -> PrettyPrintConfig
ppconf_Inh_ElseIf :: PrettyPrintConfig}
data Syn_ElseIf = Syn_ElseIf { :: ([MToken]),Syn_ElseIf -> (MExpr, Block)
copy_Syn_ElseIf :: ElseIf,Syn_ElseIf -> Bool
isMultiline_Syn_ElseIf :: Bool,Syn_ElseIf -> Doc
pretty_Syn_ElseIf :: Doc}
wrap_ElseIf :: T_ElseIf ->
Inh_ElseIf ->
Syn_ElseIf
wrap_ElseIf :: T_ElseIf -> Inh_ElseIf -> Syn_ElseIf
wrap_ElseIf T_ElseIf
sem (Inh_ElseIf [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,(MExpr, Block)
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_ElseIf
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> (MExpr, Block) -> Bool -> Doc -> Syn_ElseIf
Syn_ElseIf [MToken]
_lhsOcomments (MExpr, Block)
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_ElseIf_Tuple :: T_MExpr ->
T_Block ->
T_ElseIf
sem_ElseIf_Tuple :: T_MExpr -> T_Block -> T_ElseIf
sem_ElseIf_Tuple T_MExpr
x1_ T_Block
x2_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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
_x2Ipretty :: Doc
_x2IstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 567 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "elseif" <-> _x1Ipretty <-> zeroWidthText "then" $+$ _x2Ipretty
{-# LINE 2249 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 568 "src/GLua/AG/PrettyPrint.ag" #-}
_x1IisMultiline || _x2IisMultiline
{-# LINE 2254 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oindent =
({-# LINE 569 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 2259 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OstatRegion =
({-# LINE 570 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2264 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorPrecedence =
({-# LINE 571 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 2269 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OparentOperatorAssociative =
({-# LINE 572 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2274 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(_x1Icopy,_x2Icopy)
{-# LINE 2279 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2284 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_x2Icomments
{-# LINE 2289 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Ocomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2294 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1OforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2299 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2304 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x1Oppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2309 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Ocomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_x1Icomments
{-# LINE 2314 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2OforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2319 "src/GLua/AG/PrettyPrint.hs" #-}
)
_x2Oppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2324 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _x1Icomments,_x1Icopy,_x1IendsWithPrefixExpression,_x1IisAssociative,_x1IisLiteral,_x1IisMultiline,_x1Ipos,_x1Iprecedence,_x1Ipretty) =
x1_ _x1Ocomments _x1OforceMultiline _x1Oindent _x1OparentOperatorAssociative _x1OparentOperatorPrecedence _x1Oppconf
( _x2Icomments,_x2Icopy,_x2IisMultiline,_x2Ipretty,_x2IstatementCount) =
x2_ _x2Ocomments _x2OforceMultiline _x2Oindent _x2Oppconf _x2OstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_ElseIfList :: ElseIfList ->
T_ElseIfList
sem_ElseIfList :: [MElseIf] -> T_ElseIfList
sem_ElseIfList [MElseIf]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MElseIf -> T_ElseIfList -> T_ElseIfList
sem_ElseIfList_Cons T_ElseIfList
sem_ElseIfList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MElseIf -> T_MElseIf
sem_MElseIf [MElseIf]
list))
type T_ElseIfList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ElseIfList,Bool,Bool,Region,Doc)
data Inh_ElseIfList = Inh_ElseIfList { :: ([MToken]),Inh_ElseIfList -> Bool
forceMultiline_Inh_ElseIfList :: Bool,Inh_ElseIfList -> Int
indent_Inh_ElseIfList :: Int,Inh_ElseIfList -> PrettyPrintConfig
ppconf_Inh_ElseIfList :: PrettyPrintConfig}
data Syn_ElseIfList = Syn_ElseIfList { :: ([MToken]),Syn_ElseIfList -> [MElseIf]
copy_Syn_ElseIfList :: ElseIfList,Syn_ElseIfList -> Bool
elsesExist_Syn_ElseIfList :: Bool,Syn_ElseIfList -> Bool
isMultiline_Syn_ElseIfList :: Bool,Syn_ElseIfList -> Region
pos_Syn_ElseIfList :: Region,Syn_ElseIfList -> Doc
pretty_Syn_ElseIfList :: Doc}
wrap_ElseIfList :: T_ElseIfList ->
Inh_ElseIfList ->
Syn_ElseIfList
wrap_ElseIfList :: T_ElseIfList -> Inh_ElseIfList -> Syn_ElseIfList
wrap_ElseIfList T_ElseIfList
sem (Inh_ElseIfList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,[MElseIf]
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_ElseIfList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> [MElseIf] -> Bool -> Bool -> Region -> Doc -> Syn_ElseIfList
Syn_ElseIfList [MToken]
_lhsOcomments [MElseIf]
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_ElseIfList_Cons :: T_MElseIf ->
T_ElseIfList ->
T_ElseIfList
sem_ElseIfList_Cons :: T_MElseIf -> T_ElseIfList -> T_ElseIfList
sem_ElseIfList_Cons T_MElseIf
hd_ T_ElseIfList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOelsesExist :: Bool
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOcopy :: ElseIfList
_lhsOcomments :: ([MToken])
_hdOcomments :: ([MToken])
_hdOforceMultiline :: Bool
_hdOindent :: Int
_hdOppconf :: PrettyPrintConfig
_tlOcomments :: ([MToken])
_tlOforceMultiline :: Bool
_tlOindent :: Int
_tlOppconf :: PrettyPrintConfig
_hdIcomments :: ([MToken])
_hdIcopy :: MElseIf
_hdIisMultiline :: Bool
_hdIpos :: Region
_hdIpretty :: Doc
_tlIcomments :: ([MToken])
_tlIcopy :: ElseIfList
_tlIelsesExist :: Bool
_tlIisMultiline :: Bool
_tlIpos :: Region
_tlIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 581 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent _hdIpretty $+$ _tlIpretty
{-# LINE 2387 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 582 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2392 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 583 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 2397 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 584 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 2402 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 2407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2412 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 2417 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2422 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2427 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2432 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2437 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 2442 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 2447 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 2452 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 2457 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIisMultiline,_hdIpos,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIelsesExist,_tlIisMultiline,_tlIpos,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_ElseIfList_Nil :: T_ElseIfList
sem_ElseIfList_Nil :: T_ElseIfList
sem_ElseIfList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOelsesExist :: Bool
_lhsOcopy :: ElseIfList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 586 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 2479 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 587 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 2484 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 588 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2489 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 327 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2494 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 2499 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2504 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2509 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_Expr :: Expr ->
T_Expr
sem_Expr :: Expr -> T_Expr
sem_Expr (Expr
ANil) =
(T_Expr
sem_Expr_ANil)
sem_Expr (Expr
AFalse) =
(T_Expr
sem_Expr_AFalse)
sem_Expr (Expr
ATrue) =
(T_Expr
sem_Expr_ATrue)
sem_Expr (ANumber String
_num) =
(String -> T_Expr
sem_Expr_ANumber String
_num)
sem_Expr (AString MToken
_str) =
(MToken -> T_Expr
sem_Expr_AString MToken
_str)
sem_Expr (Expr
AVarArg) =
(T_Expr
sem_Expr_AVarArg)
sem_Expr (AnonymousFunc [MToken]
_pars Block
_body) =
([MToken] -> T_Block -> T_Expr
sem_Expr_AnonymousFunc [MToken]
_pars (Block -> T_Block
sem_Block Block
_body))
sem_Expr (APrefixExpr PrefixExp
_pexpr) =
(T_PrefixExp -> T_Expr
sem_Expr_APrefixExpr (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
_pexpr))
sem_Expr (ATableConstructor FieldList
_fields) =
(T_FieldList -> T_Expr
sem_Expr_ATableConstructor (FieldList -> T_FieldList
sem_FieldList FieldList
_fields))
sem_Expr (BinOpExpr BinOp
_op MExpr
_left MExpr
_right) =
(T_BinOp -> T_MExpr -> T_MExpr -> T_Expr
sem_Expr_BinOpExpr (BinOp -> T_BinOp
sem_BinOp BinOp
_op) (MExpr -> T_MExpr
sem_MExpr MExpr
_left) (MExpr -> T_MExpr
sem_MExpr MExpr
_right))
sem_Expr (UnOpExpr UnOp
_op MExpr
_right) =
(T_UnOp -> T_MExpr -> T_Expr
sem_Expr_UnOpExpr (UnOp -> T_UnOp
sem_UnOp UnOp
_op) (MExpr -> T_MExpr
sem_MExpr MExpr
_right))
type T_Expr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
Region ->
( ([MToken]),Expr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_Expr = Inh_Expr { :: ([MToken]),Inh_Expr -> Bool
forceMultiline_Inh_Expr :: Bool,Inh_Expr -> Int
indent_Inh_Expr :: Int,Inh_Expr -> Bool
parentOperatorAssociative_Inh_Expr :: Bool,Inh_Expr -> OperatorLevel
parentOperatorPrecedence_Inh_Expr :: OperatorLevel,Inh_Expr -> PrettyPrintConfig
ppconf_Inh_Expr :: PrettyPrintConfig,Inh_Expr -> Region
statRegion_Inh_Expr :: Region}
data Syn_Expr = Syn_Expr { :: ([MToken]),Syn_Expr -> Expr
copy_Syn_Expr :: Expr,Syn_Expr -> Bool
endsWithPrefixExpression_Syn_Expr :: Bool,Syn_Expr -> Bool
isAssociative_Syn_Expr :: Bool,Syn_Expr -> Bool
isLiteral_Syn_Expr :: Bool,Syn_Expr -> Bool
isMultiline_Syn_Expr :: Bool,Syn_Expr -> OperatorLevel
precedence_Syn_Expr :: OperatorLevel,Syn_Expr -> Doc
pretty_Syn_Expr :: Doc}
wrap_Expr :: T_Expr ->
Inh_Expr ->
Syn_Expr
wrap_Expr :: T_Expr -> Inh_Expr -> Syn_Expr
wrap_Expr T_Expr
sem (Inh_Expr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,Expr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_Expr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> Expr
-> Bool
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_Expr
Syn_Expr [MToken]
_lhsOcomments Expr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_Expr_ANil :: T_Expr
sem_Expr_ANil :: T_Expr
sem_Expr_ANil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 979 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "nil"
{-# LINE 2575 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 980 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2580 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 981 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2585 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 982 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2590 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2595 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2600 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ANil
{-# LINE 2605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2615 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AFalse :: T_Expr
sem_Expr_AFalse :: T_Expr
sem_Expr_AFalse =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 984 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "false"
{-# LINE 2638 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 985 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2643 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 986 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2648 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 987 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2653 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2658 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AFalse
{-# LINE 2668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2673 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2678 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ATrue :: T_Expr
sem_Expr_ATrue :: T_Expr
sem_Expr_ATrue =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 989 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "true"
{-# LINE 2701 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 990 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2706 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 991 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2711 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 992 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2716 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2721 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2726 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ATrue
{-# LINE 2731 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2736 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2741 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ANumber :: String ->
T_Expr
sem_Expr_ANumber :: String -> T_Expr
sem_Expr_ANumber String
num_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 994 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText num_
{-# LINE 2765 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 995 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2770 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 996 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2775 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 997 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2780 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2785 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2790 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ANumber num_
{-# LINE 2795 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2800 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2805 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AString :: MToken ->
T_Expr
sem_Expr_AString :: MToken -> T_Expr
sem_Expr_AString MToken
str_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 999 "src/GLua/AG/PrettyPrint.ag" #-}
tok str_
{-# LINE 2829 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1000 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2834 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1001 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2839 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1002 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2854 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AString str_
{-# LINE 2859 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2864 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2869 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AVarArg :: T_Expr
sem_Expr_AVarArg :: T_Expr
sem_Expr_AVarArg =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1004 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "..."
{-# LINE 2892 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1005 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 2897 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1006 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2902 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1007 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 2917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AVarArg
{-# LINE 2922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 2927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 2932 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_AnonymousFunc :: ([MToken]) ->
T_Block ->
T_Expr
sem_Expr_AnonymousFunc :: [MToken] -> T_Block -> T_Expr
sem_Expr_AnonymousFunc [MToken]
pars_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOpretty :: Doc
_lhsOisAssociative :: Bool
_lhsOisLiteral :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: Expr
_lhsOcomments :: ([MToken])
_lhsOisMultiline :: Bool
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_isMultiline :: Bool
_isMultiline =
({-# LINE 1009 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _bodyIisMultiline
{-# LINE 2967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1010 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 2972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 1011 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function"
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_)
<-> _bodyIpretty
<-> zeroWidthText "end"
{-# LINE 2980 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 1016 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "function"
<> parens _lhsIppconf _emptyParams (printList tok (render _comma ) pars_)
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 2988 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 1021 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 2995 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 1025 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null pars_
{-# LINE 3000 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 1026 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 3005 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 1027 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 3010 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3015 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 278 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3020 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3025 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AnonymousFunc pars_ _bodyIcopy
{-# LINE 3030 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3035 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 3040 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3045 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3050 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3055 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3060 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 3065 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_APrefixExpr :: T_PrefixExp ->
T_Expr
sem_Expr_APrefixExpr :: T_PrefixExp -> T_Expr
sem_Expr_APrefixExpr T_PrefixExp
pexpr_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 1029 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIpretty
{-# LINE 3105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1030 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1031 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisMultiline
{-# LINE 3115 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisAssociative
{-# LINE 3120 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 278 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIisLiteral
{-# LINE 3125 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIprecedence
{-# LINE 3130 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
APrefixExpr _pexprIcopy
{-# LINE 3135 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3140 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_pexprIcomments
{-# LINE 3145 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3150 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3155 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3160 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorAssociative =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3165 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOparentOperatorPrecedence =
({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 3170 "src/GLua/AG/PrettyPrint.hs" #-}
)
_pexprOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3175 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _pexprIcomments,_pexprIcopy,_pexprIisAssociative,_pexprIisLiteral,_pexprIisMultiline,_pexprIprecedence,_pexprIpretty,_pexprIstartsWithExprPrefixExpression) =
pexpr_ _pexprOcomments _pexprOforceMultiline _pexprOindent _pexprOparentOperatorAssociative _pexprOparentOperatorPrecedence _pexprOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_ATableConstructor :: T_FieldList ->
T_Expr
sem_Expr_ATableConstructor :: T_FieldList -> T_Expr
sem_Expr_ATableConstructor T_FieldList
fields_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOendsWithPrefixExpression :: Bool
_fieldsOindent :: Int
_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 :: Doc
_lhsOpretty =
({-# LINE 1033 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _prettyMulti else _prettySingle
{-# LINE 3211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 1034 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline || _fieldsIisMultiline
{-# LINE 3216 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 1035 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3221 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1036 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3226 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMulti =
({-# LINE 1037 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '{' $+$ _fieldsIpretty $+$ indent _lhsIppconf _lhsIindent (zchr '}')
{-# LINE 3231 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingle =
({-# LINE 1038 "src/GLua/AG/PrettyPrint.ag" #-}
braces _lhsIppconf _emptyContents _fieldsIpretty
{-# LINE 3236 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyContents =
({-# LINE 1039 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null _fieldsIcopy
{-# LINE 3241 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOindent =
({-# LINE 1040 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + (if _fieldsIisMultiline then 1 else 0)
{-# LINE 3246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOsomeElementsInListAreMultiline =
({-# LINE 1041 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3256 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3261 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ATableConstructor _fieldsIcopy
{-# LINE 3266 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3271 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_fieldsIcomments
{-# LINE 3276 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 3281 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3286 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3291 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fieldsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3296 "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 :: T_BinOp -> T_MExpr -> T_MExpr -> T_Expr
sem_Expr_BinOpExpr T_BinOp
op_ T_MExpr
left_ T_MExpr
right_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOendsWithPrefixExpression :: Bool
_lhsOprecedence :: OperatorLevel
_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 :: Doc
_lhsOpretty =
({-# LINE 1043 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIpretty <-> _opIpretty <-> _rightIpretty
{-# LINE 3363 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1044 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3368 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1047 "src/GLua/AG/PrettyPrint.ag" #-}
min _opIprecedence $ min _leftIprecedence _rightIprecedence
{-# LINE 3373 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1048 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIisMultiline || _rightIisMultiline
{-# LINE 3378 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorPrecedence =
({-# LINE 1049 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3383 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 1050 "src/GLua/AG/PrettyPrint.ag" #-}
_opIprecedence
{-# LINE 3388 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOparentOperatorAssociative =
({-# LINE 1051 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3393 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 1052 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative
{-# LINE 3398 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisAssociative && _leftIisAssociative && _rightIisAssociative
{-# LINE 3403 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 278 "src/GLua/AG/PrettyPrint.ag" #-}
((\_ _ -> False) _leftIisLiteral _rightIisLiteral)
{-# LINE 3408 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
BinOpExpr _opIcopy _leftIcopy _rightIcopy
{-# LINE 3413 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3418 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3423 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3428 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3433 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3438 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3443 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3448 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3453 "src/GLua/AG/PrettyPrint.hs" #-}
)
_leftOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3458 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_leftIcomments
{-# LINE 3463 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3468 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3473 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3478 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _opIcomments,_opIcopy,_opIisAssociative,_opIisMultiline,_opIprecedence,_opIpretty) =
op_ _opOcomments _opOindent _opOppconf
( _leftIcomments,_leftIcopy,_leftIendsWithPrefixExpression,_leftIisAssociative,_leftIisLiteral,_leftIisMultiline,_leftIpos,_leftIprecedence,_leftIpretty) =
left_ _leftOcomments _leftOforceMultiline _leftOindent _leftOparentOperatorAssociative _leftOparentOperatorPrecedence _leftOppconf
( _rightIcomments,_rightIcopy,_rightIendsWithPrefixExpression,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty) =
right_ _rightOcomments _rightOforceMultiline _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Expr_UnOpExpr :: T_UnOp ->
T_MExpr ->
T_Expr
sem_Expr_UnOpExpr :: T_UnOp -> T_MExpr -> T_Expr
sem_Expr_UnOpExpr T_UnOp
op_ T_MExpr
right_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 1054 "src/GLua/AG/PrettyPrint.ag" #-}
_opIpretty <> _rightIpretty
{-# LINE 3531 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 1055 "src/GLua/AG/PrettyPrint.ag" #-}
min _rightIprecedence OperatorLevel7
{-# LINE 3536 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 1056 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIendsWithPrefixExpression
{-# LINE 3541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1057 "src/GLua/AG/PrettyPrint.ag" #-}
_opIisMultiline || _rightIisMultiline
{-# LINE 3546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorPrecedence =
({-# LINE 1058 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel7
{-# LINE 3551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisAssociative
{-# LINE 3556 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 278 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIisLiteral
{-# LINE 3561 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
UnOpExpr _opIcopy _rightIcopy
{-# LINE 3566 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3571 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_rightIcomments
{-# LINE 3576 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3581 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3586 "src/GLua/AG/PrettyPrint.hs" #-}
)
_opOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3591 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_opIcomments
{-# LINE 3596 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3601 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3606 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOparentOperatorAssociative =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 3611 "src/GLua/AG/PrettyPrint.hs" #-}
)
_rightOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3616 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _opIcomments,_opIcopy,_opIisMultiline,_opIpretty) =
op_ _opOcomments _opOindent _opOppconf
( _rightIcomments,_rightIcopy,_rightIendsWithPrefixExpression,_rightIisAssociative,_rightIisLiteral,_rightIisMultiline,_rightIpos,_rightIprecedence,_rightIpretty) =
right_ _rightOcomments _rightOforceMultiline _rightOindent _rightOparentOperatorAssociative _rightOparentOperatorPrecedence _rightOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_ExprSuffixList :: ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList :: ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_PFExprSuffix -> T_ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList_Cons T_ExprSuffixList
sem_ExprSuffixList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map PFExprSuffix -> T_PFExprSuffix
sem_PFExprSuffix ExprSuffixList
list))
type T_ExprSuffixList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),ExprSuffixList,Bool,Bool,OperatorLevel,Doc)
data Inh_ExprSuffixList = Inh_ExprSuffixList { :: ([MToken]),Inh_ExprSuffixList -> Bool
forceMultiline_Inh_ExprSuffixList :: Bool,Inh_ExprSuffixList -> Int
indent_Inh_ExprSuffixList :: Int,Inh_ExprSuffixList -> PrettyPrintConfig
ppconf_Inh_ExprSuffixList :: PrettyPrintConfig}
data Syn_ExprSuffixList = Syn_ExprSuffixList { :: ([MToken]),Syn_ExprSuffixList -> ExprSuffixList
copy_Syn_ExprSuffixList :: ExprSuffixList,Syn_ExprSuffixList -> Bool
isAssociative_Syn_ExprSuffixList :: Bool,Syn_ExprSuffixList -> Bool
isMultiline_Syn_ExprSuffixList :: Bool,Syn_ExprSuffixList -> OperatorLevel
precedence_Syn_ExprSuffixList :: OperatorLevel,Syn_ExprSuffixList -> Doc
pretty_Syn_ExprSuffixList :: Doc}
wrap_ExprSuffixList :: T_ExprSuffixList ->
Inh_ExprSuffixList ->
Syn_ExprSuffixList
wrap_ExprSuffixList :: T_ExprSuffixList -> Inh_ExprSuffixList -> Syn_ExprSuffixList
wrap_ExprSuffixList T_ExprSuffixList
sem (Inh_ExprSuffixList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,ExprSuffixList
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_ExprSuffixList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> ExprSuffixList
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_ExprSuffixList
Syn_ExprSuffixList [MToken]
_lhsOcomments ExprSuffixList
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_ExprSuffixList_Cons :: T_PFExprSuffix ->
T_ExprSuffixList ->
T_ExprSuffixList
sem_ExprSuffixList_Cons :: T_PFExprSuffix -> T_ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList_Cons T_PFExprSuffix
hd_ T_ExprSuffixList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 614 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpretty <> _tlIpretty
{-# LINE 3680 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 615 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 3685 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 3690 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 3695 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 3700 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3705 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 3710 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3715 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3720 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3725 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3730 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 3735 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3740 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3745 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3750 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _hdIcomments,_hdIcopy,_hdIisAssociative,_hdIisMultiline,_hdIprecedence,_hdIpretty) =
hd_ _hdOcomments _hdOforceMultiline _hdOindent _hdOppconf
( _tlIcomments,_tlIcopy,_tlIisAssociative,_tlIisMultiline,_tlIprecedence,_tlIpretty) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_ExprSuffixList_Nil :: T_ExprSuffixList
sem_ExprSuffixList_Nil :: T_ExprSuffixList
sem_ExprSuffixList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: ExprSuffixList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 617 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 3772 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 618 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3777 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 3782 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 3787 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 3792 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3797 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3802 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_Field :: Field ->
T_Field
sem_Field :: Field -> T_Field
sem_Field (ExprField MExpr
_key MExpr
_value FieldSep
_sep) =
(T_MExpr -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_ExprField (MExpr -> T_MExpr
sem_MExpr MExpr
_key) (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
sem_Field (NamedField MToken
_key MExpr
_value FieldSep
_sep) =
(MToken -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_NamedField MToken
_key (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
sem_Field (UnnamedField MExpr
_value FieldSep
_sep) =
(T_MExpr -> T_FieldSep -> T_Field
sem_Field_UnnamedField (MExpr -> T_MExpr
sem_MExpr MExpr
_value) (FieldSep -> T_FieldSep
sem_FieldSep FieldSep
_sep))
type T_Field = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),Field,Bool,Bool,Region,Doc)
data Inh_Field = Inh_Field { :: ([MToken]),Inh_Field -> Bool
forceMultiline_Inh_Field :: Bool,Inh_Field -> Int
indent_Inh_Field :: Int,Inh_Field -> PrettyPrintConfig
ppconf_Inh_Field :: PrettyPrintConfig}
data Syn_Field = Syn_Field { :: ([MToken]),Syn_Field -> Field
copy_Syn_Field :: Field,Syn_Field -> Bool
isMultiline_Syn_Field :: Bool,Syn_Field -> Bool
isSemiColon_Syn_Field :: Bool,Syn_Field -> Region
pos_Syn_Field :: Region,Syn_Field -> Doc
pretty_Syn_Field :: Doc}
wrap_Field :: T_Field ->
Inh_Field ->
Syn_Field
wrap_Field :: T_Field -> Inh_Field -> Syn_Field
wrap_Field T_Field
sem (Inh_Field [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,Field
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisSemiColon,Region
_lhsOpos,Doc
_lhsOpretty) = T_Field
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> Field -> Bool -> Bool -> Region -> Doc -> Syn_Field
Syn_Field [MToken]
_lhsOcomments Field
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisSemiColon Region
_lhsOpos Doc
_lhsOpretty))
sem_Field_ExprField :: T_MExpr ->
T_MExpr ->
T_FieldSep ->
T_Field
sem_Field_ExprField :: T_MExpr -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_ExprField T_MExpr
key_ T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 1087 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _keyIpretty <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 3883 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1088 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3888 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorPrecedence =
({-# LINE 1089 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3893 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOparentOperatorAssociative =
({-# LINE 1090 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3898 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1091 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 3903 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1092 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 3908 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 321 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 3913 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ExprField _keyIcopy _valueIcopy _sepIcopy
{-# LINE 3918 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 3923 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 3928 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 310 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 3933 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 3938 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3943 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3948 "src/GLua/AG/PrettyPrint.hs" #-}
)
_keyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3953 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_keyIcomments
{-# LINE 3958 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 3963 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3968 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3973 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 3978 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 3983 "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 :: MToken -> T_MExpr -> T_FieldSep -> T_Field
sem_Field_NamedField MToken
key_ T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 1094 "src/GLua/AG/PrettyPrint.ag" #-}
tok key_ <-> zchr '=' <-> _valueIpretty <> _sepIpretty
{-# LINE 4031 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1095 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4036 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1096 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4041 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1097 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4046 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 321 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4051 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
NamedField key_ _valueIcopy _sepIcopy
{-# LINE 4056 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4061 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4066 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 310 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4071 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4076 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4081 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4086 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4091 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4096 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4101 "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 :: T_MExpr -> T_FieldSep -> T_Field
sem_Field_UnnamedField T_MExpr
value_ T_FieldSep
sep_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 1099 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpretty <> _sepIpretty
{-# LINE 4146 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1100 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIisMultiline || _sepIisMultiline
{-# LINE 4151 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorPrecedence =
({-# LINE 1101 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 4156 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOparentOperatorAssociative =
({-# LINE 1102 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4161 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 321 "src/GLua/AG/PrettyPrint.ag" #-}
_sepIisSemiColon
{-# LINE 4166 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
UnnamedField _valueIcopy _sepIcopy
{-# LINE 4171 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4176 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIcomments
{-# LINE 4181 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 310 "src/GLua/AG/PrettyPrint.ag" #-}
_valueIpos
{-# LINE 4186 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4191 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4196 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4201 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valueOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4206 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_sepOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4216 "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_FieldList :: FieldList ->
T_FieldList
sem_FieldList :: FieldList -> T_FieldList
sem_FieldList FieldList
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Field -> T_FieldList -> T_FieldList
sem_FieldList_Cons T_FieldList
sem_FieldList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map Field -> T_Field
sem_Field FieldList
list))
type T_FieldList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),FieldList,Bool,Bool,Doc)
data Inh_FieldList = Inh_FieldList { :: ([MToken]),Inh_FieldList -> Bool
forceMultiline_Inh_FieldList :: Bool,Inh_FieldList -> Int
indent_Inh_FieldList :: Int,Inh_FieldList -> PrettyPrintConfig
ppconf_Inh_FieldList :: PrettyPrintConfig,Inh_FieldList -> Bool
someElementsInListAreMultiline_Inh_FieldList :: Bool}
data Syn_FieldList = Syn_FieldList { :: ([MToken]),Syn_FieldList -> FieldList
copy_Syn_FieldList :: FieldList,Syn_FieldList -> Bool
isMultiline_Syn_FieldList :: Bool,Syn_FieldList -> Bool
isNil_Syn_FieldList :: Bool,Syn_FieldList -> Doc
pretty_Syn_FieldList :: Doc}
wrap_FieldList :: T_FieldList ->
Inh_FieldList ->
Syn_FieldList
wrap_FieldList :: T_FieldList -> Inh_FieldList -> Syn_FieldList
wrap_FieldList T_FieldList
sem (Inh_FieldList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Bool
_lhsIsomeElementsInListAreMultiline) =
(let ( [MToken]
_lhsOcomments,FieldList
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisNil,Doc
_lhsOpretty) = T_FieldList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Bool
_lhsIsomeElementsInListAreMultiline
in ([MToken] -> FieldList -> Bool -> Bool -> Doc -> Syn_FieldList
Syn_FieldList [MToken]
_lhsOcomments FieldList
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisNil Doc
_lhsOpretty))
sem_FieldList_Cons :: T_Field ->
T_FieldList ->
T_FieldList
sem_FieldList_Cons :: T_Field -> T_FieldList -> T_FieldList
sem_FieldList_Cons T_Field
hd_ T_FieldList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 468 "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 4287 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 476 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4292 "src/GLua/AG/PrettyPrint.hs" #-}
)
_optionalSpaceAfterSep =
({-# LINE 478 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterComma _lhsIppconf then (<->) else (<>)
{-# LINE 4297 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 480 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| _hdIisMultiline
|| _tlIisMultiline
|| _lhsIsomeElementsInListAreMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 4307 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOsomeElementsInListAreMultiline =
({-# LINE 488 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| not (null $ fst _commentsBefore )
|| not (null $ fst _commentsAfter )
{-# LINE 4315 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBefore =
({-# LINE 494 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `before` _hdIpos) _lhsIcomments
{-# LINE 4320 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 495 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBefore
{-# LINE 4325 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 496 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _hdIpos) _hdIcomments
{-# LINE 4330 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 498 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4335 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 499 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 4340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 4345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 4355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4365 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4370 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4375 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4380 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4385 "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 :: T_FieldList
sem_FieldList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Bool
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_lhsOisNil :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 502 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4407 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisNil =
({-# LINE 503 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4412 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 504 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4417 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 4422 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4427 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4432 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOisNil,_lhsOpretty)))
sem_FieldSep :: FieldSep ->
T_FieldSep
sem_FieldSep :: FieldSep -> T_FieldSep
sem_FieldSep (FieldSep
CommaSep) =
(T_FieldSep
sem_FieldSep_CommaSep)
sem_FieldSep (FieldSep
SemicolonSep) =
(T_FieldSep
sem_FieldSep_SemicolonSep)
sem_FieldSep (FieldSep
NoSep) =
(T_FieldSep
sem_FieldSep_NoSep)
type T_FieldSep = Int ->
PrettyPrintConfig ->
( FieldSep,Bool,Bool,Doc)
data Inh_FieldSep = Inh_FieldSep {Inh_FieldSep -> Int
indent_Inh_FieldSep :: Int,Inh_FieldSep -> PrettyPrintConfig
ppconf_Inh_FieldSep :: PrettyPrintConfig}
data Syn_FieldSep = Syn_FieldSep {Syn_FieldSep -> FieldSep
copy_Syn_FieldSep :: FieldSep,Syn_FieldSep -> Bool
isMultiline_Syn_FieldSep :: Bool,Syn_FieldSep -> Bool
isSemiColon_Syn_FieldSep :: Bool,Syn_FieldSep -> Doc
pretty_Syn_FieldSep :: Doc}
wrap_FieldSep :: T_FieldSep ->
Inh_FieldSep ->
Syn_FieldSep
wrap_FieldSep :: T_FieldSep -> Inh_FieldSep -> Syn_FieldSep
wrap_FieldSep T_FieldSep
sem (Inh_FieldSep Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( FieldSep
_lhsOcopy,Bool
_lhsOisMultiline,Bool
_lhsOisSemiColon,Doc
_lhsOpretty) = T_FieldSep
sem Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in (FieldSep -> Bool -> Bool -> Doc -> Syn_FieldSep
Syn_FieldSep FieldSep
_lhsOcopy Bool
_lhsOisMultiline Bool
_lhsOisSemiColon Doc
_lhsOpretty))
sem_FieldSep_CommaSep :: T_FieldSep
sem_FieldSep_CommaSep :: T_FieldSep
sem_FieldSep_CommaSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1106 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ','
{-# LINE 4468 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1107 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4473 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 321 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4478 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
CommaSep
{-# LINE 4483 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4488 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_SemicolonSep :: T_FieldSep
sem_FieldSep_SemicolonSep :: T_FieldSep
sem_FieldSep_SemicolonSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisSemiColon :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1109 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty) <> zchr ';'
{-# LINE 4502 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 1110 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4507 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1113 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 4512 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
SemicolonSep
{-# LINE 4517 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4522 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FieldSep_NoSep :: T_FieldSep
sem_FieldSep_NoSep :: T_FieldSep
sem_FieldSep_NoSep =
(\ Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisSemiColon :: Bool
_lhsOcopy :: FieldSep
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1115 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 4536 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1116 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisSemiColon =
({-# LINE 321 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
NoSep
{-# LINE 4551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4556 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcopy,_lhsOisMultiline,_lhsOisSemiColon,_lhsOpretty)))
sem_FuncName :: FuncName ->
T_FuncName
sem_FuncName :: FuncName -> T_FuncName
sem_FuncName (FuncName [MToken]
_names Maybe MToken
_meta) =
([MToken] -> Maybe MToken -> T_FuncName
sem_FuncName_FuncName [MToken]
_names Maybe MToken
_meta)
type T_FuncName = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),FuncName,Bool,Region,Doc)
data Inh_FuncName = Inh_FuncName { :: ([MToken]),Inh_FuncName -> Int
indent_Inh_FuncName :: Int,Inh_FuncName -> PrettyPrintConfig
ppconf_Inh_FuncName :: PrettyPrintConfig}
data Syn_FuncName = Syn_FuncName { :: ([MToken]),Syn_FuncName -> FuncName
copy_Syn_FuncName :: FuncName,Syn_FuncName -> Bool
isMultiline_Syn_FuncName :: Bool,Syn_FuncName -> Region
pos_Syn_FuncName :: Region,Syn_FuncName -> Doc
pretty_Syn_FuncName :: Doc}
wrap_FuncName :: T_FuncName ->
Inh_FuncName ->
Syn_FuncName
wrap_FuncName :: T_FuncName -> Inh_FuncName -> Syn_FuncName
wrap_FuncName T_FuncName
sem (Inh_FuncName [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,FuncName
_lhsOcopy,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_FuncName
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> FuncName -> Bool -> Region -> Doc -> Syn_FuncName
Syn_FuncName [MToken]
_lhsOcomments FuncName
_lhsOcopy Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_FuncName_FuncName :: ([MToken]) ->
(Maybe MToken) ->
T_FuncName
sem_FuncName_FuncName :: [MToken] -> Maybe MToken -> T_FuncName
sem_FuncName_FuncName [MToken]
names_ Maybe MToken
meta_ =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOpos :: Region
_lhsOcopy :: FuncName
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 893 "src/GLua/AG/PrettyPrint.ag" #-}
printList tok "." names_ <> metaDoc meta_
{-# LINE 4593 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 894 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4598 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 895 "src/GLua/AG/PrettyPrint.ag" #-}
case meta_ of
Nothing -> _namesPos
Just name -> rgOr _namesPos (mpos name)
{-# LINE 4605 "src/GLua/AG/PrettyPrint.hs" #-}
)
_namesPos =
({-# LINE 899 "src/GLua/AG/PrettyPrint.ag" #-}
foldl1 rgOr $ map mpos names_
{-# LINE 4610 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
FuncName names_ meta_
{-# LINE 4615 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4620 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4625 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_MElse :: MElse ->
T_MElse
sem_MElse :: MElse -> T_MElse
sem_MElse (MElse Region
_pos Block
_body) =
(Region -> T_Block -> T_MElse
sem_MElse_MElse Region
_pos (Block -> T_Block
sem_Block Block
_body))
type T_MElse = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MElse,Bool,Bool,Region,Doc)
data Inh_MElse = Inh_MElse { :: ([MToken]),Inh_MElse -> Bool
forceMultiline_Inh_MElse :: Bool,Inh_MElse -> Int
indent_Inh_MElse :: Int,Inh_MElse -> PrettyPrintConfig
ppconf_Inh_MElse :: PrettyPrintConfig,Inh_MElse -> Region
statRegion_Inh_MElse :: Region}
data Syn_MElse = Syn_MElse { :: ([MToken]),Syn_MElse -> MElse
copy_Syn_MElse :: MElse,Syn_MElse -> Bool
elsesExist_Syn_MElse :: Bool,Syn_MElse -> Bool
isMultiline_Syn_MElse :: Bool,Syn_MElse -> Region
pos_Syn_MElse :: Region,Syn_MElse -> Doc
pretty_Syn_MElse :: Doc}
wrap_MElse :: T_MElse ->
Inh_MElse ->
Syn_MElse
wrap_MElse :: T_MElse -> Inh_MElse -> Syn_MElse
wrap_MElse T_MElse
sem (Inh_MElse [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,MElse
_lhsOcopy,Bool
_lhsOelsesExist,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_MElse
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken] -> MElse -> Bool -> Bool -> Region -> Doc -> Syn_MElse
Syn_MElse [MToken]
_lhsOcomments MElse
_lhsOcopy Bool
_lhsOelsesExist Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_MElse_MElse :: Region ->
T_Block ->
T_MElse
sem_MElse_MElse :: Region -> T_Block -> T_MElse
sem_MElse_MElse Region
pos_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 601 "src/GLua/AG/PrettyPrint.ag" #-}
indent _lhsIppconf _lhsIindent (zeroWidthText "else")
<-> _prettyCommentsAfter
$+$ _bodyIpretty
{-# LINE 4679 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 605 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIisMultiline
{-# LINE 4684 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 606 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 4689 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyCommentsAfter =
({-# LINE 607 "src/GLua/AG/PrettyPrint.ag" #-}
renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
{-# LINE 4694 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 608 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` pos_) _lhsIcomments
{-# LINE 4699 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 609 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 610 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 4709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOelsesExist =
({-# LINE 327 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 4714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
MElse pos_ _bodyIcopy
{-# LINE 4719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 4729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 4739 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 4744 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOelsesExist,_lhsOisMultiline,_lhsOpos,_lhsOpretty)))
sem_MElseIf :: MElseIf ->
T_MElseIf
sem_MElseIf :: MElseIf -> T_MElseIf
sem_MElseIf (MElseIf Region
_pos (MExpr, Block)
_elif) =
(Region -> T_ElseIf -> T_MElseIf
sem_MElseIf_MElseIf Region
_pos ((MExpr, Block) -> T_ElseIf
sem_ElseIf (MExpr, Block)
_elif))
type T_MElseIf = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MElseIf,Bool,Region,Doc)
data Inh_MElseIf = Inh_MElseIf { :: ([MToken]),Inh_MElseIf -> Bool
forceMultiline_Inh_MElseIf :: Bool,Inh_MElseIf -> Int
indent_Inh_MElseIf :: Int,Inh_MElseIf -> PrettyPrintConfig
ppconf_Inh_MElseIf :: PrettyPrintConfig}
data Syn_MElseIf = Syn_MElseIf { :: ([MToken]),Syn_MElseIf -> MElseIf
copy_Syn_MElseIf :: MElseIf,Syn_MElseIf -> Bool
isMultiline_Syn_MElseIf :: Bool,Syn_MElseIf -> Region
pos_Syn_MElseIf :: Region,Syn_MElseIf -> Doc
pretty_Syn_MElseIf :: Doc}
wrap_MElseIf :: T_MElseIf ->
Inh_MElseIf ->
Syn_MElseIf
wrap_MElseIf :: T_MElseIf -> Inh_MElseIf -> Syn_MElseIf
wrap_MElseIf T_MElseIf
sem (Inh_MElseIf [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,MElseIf
_lhsOcopy,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty) = T_MElseIf
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> MElseIf -> Bool -> Region -> Doc -> Syn_MElseIf
Syn_MElseIf [MToken]
_lhsOcomments MElseIf
_lhsOcopy Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty))
sem_MElseIf_MElseIf :: Region ->
T_ElseIf ->
T_MElseIf
sem_MElseIf_MElseIf :: Region -> T_ElseIf -> T_MElseIf
sem_MElseIf_MElseIf Region
pos_ T_ElseIf
elif_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOcopy :: MElseIf
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_elifOcomments :: ([MToken])
_elifOforceMultiline :: Bool
_elifOindent :: Int
_elifOppconf :: PrettyPrintConfig
_elifIcomments :: ([MToken])
_elifIcopy :: ElseIf
_elifIisMultiline :: Bool
_elifIpretty :: Doc
_lhsOpos :: Region
_lhsOpos =
({-# LINE 576 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4793 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 577 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIisMultiline
{-# LINE 4798 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
MElseIf pos_ _elifIcopy
{-# LINE 4803 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4808 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIcomments
{-# LINE 4813 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 264 "src/GLua/AG/PrettyPrint.ag" #-}
_elifIpretty
{-# LINE 4818 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4823 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4828 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4833 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifOppconf =
({-# LINE 267 "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)))
sem_MExpr :: MExpr ->
T_MExpr
sem_MExpr :: MExpr -> T_MExpr
sem_MExpr (MExpr Region
_pos Expr
_expr) =
(Region -> T_Expr -> T_MExpr
sem_MExpr_MExpr Region
_pos (Expr -> T_Expr
sem_Expr Expr
_expr))
type T_MExpr = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),MExpr,Bool,Bool,Bool,Bool,Region,OperatorLevel,Doc)
data Inh_MExpr = Inh_MExpr { :: ([MToken]),Inh_MExpr -> Bool
forceMultiline_Inh_MExpr :: Bool,Inh_MExpr -> Int
indent_Inh_MExpr :: Int,Inh_MExpr -> Bool
parentOperatorAssociative_Inh_MExpr :: Bool,Inh_MExpr -> OperatorLevel
parentOperatorPrecedence_Inh_MExpr :: OperatorLevel,Inh_MExpr -> PrettyPrintConfig
ppconf_Inh_MExpr :: PrettyPrintConfig}
data Syn_MExpr = Syn_MExpr { :: ([MToken]),Syn_MExpr -> MExpr
copy_Syn_MExpr :: MExpr,Syn_MExpr -> Bool
endsWithPrefixExpression_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isAssociative_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isLiteral_Syn_MExpr :: Bool,Syn_MExpr -> Bool
isMultiline_Syn_MExpr :: Bool,Syn_MExpr -> Region
pos_Syn_MExpr :: Region,Syn_MExpr -> OperatorLevel
precedence_Syn_MExpr :: OperatorLevel,Syn_MExpr -> Doc
pretty_Syn_MExpr :: Doc}
wrap_MExpr :: T_MExpr ->
Inh_MExpr ->
Syn_MExpr
wrap_MExpr :: T_MExpr -> Inh_MExpr -> Syn_MExpr
wrap_MExpr T_MExpr
sem (Inh_MExpr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,MExpr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,Region
_lhsOpos,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MExpr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> MExpr
-> Bool
-> Bool
-> Bool
-> Bool
-> Region
-> OperatorLevel
-> Doc
-> Syn_MExpr
Syn_MExpr [MToken]
_lhsOcomments MExpr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline Region
_lhsOpos OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MExpr_MExpr :: Region ->
T_Expr ->
T_MExpr
sem_MExpr_MExpr :: Region -> T_Expr -> T_MExpr
sem_MExpr_MExpr Region
pos_ T_Expr
expr_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpos :: Region
_lhsOendsWithPrefixExpression :: Bool
_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 :: Region
_lhsOpos =
({-# LINE 972 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4902 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 973 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIendsWithPrefixExpression
{-# LINE 4907 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 974 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline
{-# LINE 4912 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOstatRegion =
({-# LINE 975 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 4917 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative
{-# LINE 4922 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 278 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisLiteral
{-# LINE 4927 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIprecedence
{-# LINE 4932 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
MExpr pos_ _exprIcopy
{-# LINE 4937 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 4942 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 4947 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 264 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIpretty
{-# LINE 4952 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 4957 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 4962 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 4967 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 4972 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 4977 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 267 "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)))
sem_MExprList :: MExprList ->
T_MExprList
sem_MExprList :: [MExpr] -> T_MExprList
sem_MExprList [MExpr]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MExpr -> T_MExprList -> T_MExprList
sem_MExprList_Cons T_MExprList
sem_MExprList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MExpr -> T_MExpr
sem_MExpr [MExpr]
list))
type T_MExprList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),MExprList,Bool,Bool,Bool,Region,OperatorLevel,Doc)
data Inh_MExprList = Inh_MExprList { :: ([MToken]),Inh_MExprList -> Bool
forceMultiline_Inh_MExprList :: Bool,Inh_MExprList -> Int
indent_Inh_MExprList :: Int,Inh_MExprList -> PrettyPrintConfig
ppconf_Inh_MExprList :: PrettyPrintConfig,Inh_MExprList -> Bool
someElementsInListAreMultiline_Inh_MExprList :: Bool}
data Syn_MExprList = Syn_MExprList { :: ([MToken]),Syn_MExprList -> [MExpr]
copy_Syn_MExprList :: MExprList,Syn_MExprList -> Bool
isAssociative_Syn_MExprList :: Bool,Syn_MExprList -> Bool
isLast_Syn_MExprList :: Bool,Syn_MExprList -> Bool
isMultiline_Syn_MExprList :: Bool,Syn_MExprList -> Region
pos_Syn_MExprList :: Region,Syn_MExprList -> OperatorLevel
precedence_Syn_MExprList :: OperatorLevel,Syn_MExprList -> Doc
pretty_Syn_MExprList :: Doc}
wrap_MExprList :: T_MExprList ->
Inh_MExprList ->
Syn_MExprList
wrap_MExprList :: T_MExprList -> Inh_MExprList -> Syn_MExprList
wrap_MExprList T_MExprList
sem (Inh_MExprList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Bool
_lhsIsomeElementsInListAreMultiline) =
(let ( [MToken]
_lhsOcomments,[MExpr]
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisLast,Bool
_lhsOisMultiline,Region
_lhsOpos,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MExprList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Bool
_lhsIsomeElementsInListAreMultiline
in ([MToken]
-> [MExpr]
-> Bool
-> Bool
-> Bool
-> Region
-> OperatorLevel
-> Doc
-> Syn_MExprList
Syn_MExprList [MToken]
_lhsOcomments [MExpr]
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisLast Bool
_lhsOisMultiline Region
_lhsOpos OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MExprList_Cons :: T_MExpr ->
T_MExprList ->
T_MExprList
sem_MExprList_Cons :: T_MExpr -> T_MExprList -> T_MExprList
sem_MExprList_Cons T_MExpr
hd_ T_MExprList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Bool
_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
_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
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 417 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _prettyMultiLine else _prettySingleLine
{-# LINE 5056 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettySingleLine =
({-# LINE 418 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpretty
<> _comma
<> _tlIpretty
{-# LINE 5063 "src/GLua/AG/PrettyPrint.hs" #-}
)
_prettyMultiLine =
({-# LINE 422 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBeforeLine )
$+$ indent _lhsIppconf _lhsIindent _hdIpretty
<> _comma
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
$+$ _tlIpretty
{-# LINE 5072 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 428 "src/GLua/AG/PrettyPrint.ag" #-}
if _tlIisLast then
empty
else
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if not _isMultiline && spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 5082 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeLine =
({-# LINE 436 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments
{-# LINE 5087 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 437 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBeforeLine
{-# LINE 5092 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 438 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _tlIpos) _hdIcomments
{-# LINE 5097 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 439 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 5102 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 440 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5107 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 442 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIpos
{-# LINE 5112 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 443 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5117 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorPrecedence =
({-# LINE 444 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5122 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOparentOperatorAssociative =
({-# LINE 445 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5127 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 446 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
|| _lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| _tlIisMultiline
{-# LINE 5137 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOsomeElementsInListAreMultiline =
({-# LINE 454 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIsomeElementsInListAreMultiline
|| _hdIisMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
{-# LINE 5145 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisAssociative && _tlIisAssociative
{-# LINE 5150 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
(min _hdIprecedence _tlIprecedence)
{-# LINE 5155 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5160 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5165 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 5170 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5175 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5180 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5185 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5190 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5195 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5200 "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) =
tl_ _tlOcomments _tlOforceMultiline _tlOindent _tlOppconf _tlOsomeElementsInListAreMultiline
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLast,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty)))
sem_MExprList_Nil :: T_MExprList
sem_MExprList_Nil :: T_MExprList
sem_MExprList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Bool
_lhsIsomeElementsInListAreMultiline ->
(let _lhsOpretty :: Doc
_lhsOpos :: Region
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MExprList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 461 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5225 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpos =
({-# LINE 462 "src/GLua/AG/PrettyPrint.ag" #-}
emptyRg
{-# LINE 5230 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 463 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5235 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 464 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5240 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5245 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5250 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5255 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5260 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5265 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLast,_lhsOisMultiline,_lhsOpos,_lhsOprecedence,_lhsOpretty)))
sem_MStat :: MStat ->
T_MStat
sem_MStat :: MStat -> T_MStat
sem_MStat (MStat Region
_pos Stat
_stat) =
(Region -> T_Stat -> T_MStat
sem_MStat_MStat Region
_pos (Stat -> T_Stat
sem_Stat Stat
_stat))
type T_MStat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Bool ->
( ([MToken]),MStat,Bool,Bool,Region,Doc,Bool,Int)
data Inh_MStat = Inh_MStat { :: ([MToken]),Inh_MStat -> Bool
forceMultiline_Inh_MStat :: Bool,Inh_MStat -> Int
indent_Inh_MStat :: Int,Inh_MStat -> Bool
isLastStatement_Inh_MStat :: Bool,Inh_MStat -> PrettyPrintConfig
ppconf_Inh_MStat :: PrettyPrintConfig,Inh_MStat -> Bool
wouldBeAmbiguousWithoutSemicolon_Inh_MStat :: Bool}
data Syn_MStat = Syn_MStat { :: ([MToken]),Syn_MStat -> MStat
copy_Syn_MStat :: MStat,Syn_MStat -> Bool
endsWithPrefixExpression_Syn_MStat :: Bool,Syn_MStat -> Bool
isMultiline_Syn_MStat :: Bool,Syn_MStat -> Region
pos_Syn_MStat :: Region,Syn_MStat -> Doc
pretty_Syn_MStat :: Doc,Syn_MStat -> Bool
startsWithExprPrefixExpression_Syn_MStat :: Bool,Syn_MStat -> Int
statementCount_Syn_MStat :: Int}
wrap_MStat :: T_MStat ->
Inh_MStat ->
Syn_MStat
wrap_MStat :: T_MStat -> Inh_MStat -> Syn_MStat
wrap_MStat T_MStat
sem (Inh_MStat [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Bool
_lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( [MToken]
_lhsOcomments,MStat
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisMultiline,Region
_lhsOpos,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Int
_lhsOstatementCount) = T_MStat
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Bool
_lhsIwouldBeAmbiguousWithoutSemicolon
in ([MToken]
-> MStat
-> Bool
-> Bool
-> Region
-> Doc
-> Bool
-> Int
-> Syn_MStat
Syn_MStat [MToken]
_lhsOcomments MStat
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisMultiline Region
_lhsOpos Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Int
_lhsOstatementCount))
sem_MStat_MStat :: Region ->
T_Stat ->
T_MStat
sem_MStat_MStat :: Region -> T_Stat -> T_MStat
sem_MStat_MStat Region
pos_ T_Stat
stat_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpos :: Region
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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 :: Region
_lhsOpos =
({-# LINE 408 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5324 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 409 "src/GLua/AG/PrettyPrint.ag" #-}
_statIstartsWithExprPrefixExpression
{-# LINE 5329 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 410 "src/GLua/AG/PrettyPrint.ag" #-}
_statIendsWithPrefixExpression
{-# LINE 5334 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 411 "src/GLua/AG/PrettyPrint.ag" #-}
_statIisMultiline
{-# LINE 5339 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOstatRegion =
({-# LINE 412 "src/GLua/AG/PrettyPrint.ag" #-}
pos_
{-# LINE 5344 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 413 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIwouldBeAmbiguousWithoutSemicolon
{-# LINE 5349 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 324 "src/GLua/AG/PrettyPrint.ag" #-}
1
{-# LINE 5354 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
MStat pos_ _statIcopy
{-# LINE 5359 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5364 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_statIcomments
{-# LINE 5369 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 264 "src/GLua/AG/PrettyPrint.ag" #-}
_statIpretty
{-# LINE 5374 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5379 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5384 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5389 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOisLastStatement =
({-# LINE 307 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIisLastStatement
{-# LINE 5394 "src/GLua/AG/PrettyPrint.hs" #-}
)
_statOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5399 "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)))
sem_MStatList :: MStatList ->
T_MStatList
sem_MStatList :: [MStat] -> T_MStatList
sem_MStatList [MStat]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_MStat -> T_MStatList -> T_MStatList
sem_MStatList_Cons T_MStatList
sem_MStatList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map MStat -> T_MStat
sem_MStat [MStat]
list))
type T_MStatList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
Region ->
( ([MToken]),MStatList,Bool,Bool,Doc,Bool,Int)
data Inh_MStatList = Inh_MStatList { :: ([MToken]),Inh_MStatList -> Bool
forceMultiline_Inh_MStatList :: Bool,Inh_MStatList -> Int
indent_Inh_MStatList :: Int,Inh_MStatList -> PrettyPrintConfig
ppconf_Inh_MStatList :: PrettyPrintConfig,Inh_MStatList -> Region
statRegion_Inh_MStatList :: Region}
data Syn_MStatList = Syn_MStatList { :: ([MToken]),Syn_MStatList -> [MStat]
copy_Syn_MStatList :: MStatList,Syn_MStatList -> Bool
isLast_Syn_MStatList :: Bool,Syn_MStatList -> Bool
isMultiline_Syn_MStatList :: Bool,Syn_MStatList -> Doc
pretty_Syn_MStatList :: Doc,Syn_MStatList -> Bool
startsWithExprPrefixExpression_Syn_MStatList :: Bool,Syn_MStatList -> Int
statementCount_Syn_MStatList :: Int}
wrap_MStatList :: T_MStatList ->
Inh_MStatList ->
Syn_MStatList
wrap_MStatList :: T_MStatList -> Inh_MStatList -> Syn_MStatList
wrap_MStatList T_MStatList
sem (Inh_MStatList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion) =
(let ( [MToken]
_lhsOcomments,[MStat]
_lhsOcopy,Bool
_lhsOisLast,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Int
_lhsOstatementCount) = T_MStatList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion
in ([MToken]
-> [MStat] -> Bool -> Bool -> Doc -> Bool -> Int -> Syn_MStatList
Syn_MStatList [MToken]
_lhsOcomments [MStat]
_lhsOcopy Bool
_lhsOisLast Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Int
_lhsOstatementCount))
sem_MStatList_Cons :: T_MStat ->
T_MStatList ->
T_MStatList
sem_MStatList_Cons :: T_MStat -> T_MStatList -> T_MStatList
sem_MStatList_Cons T_MStat
hd_ T_MStatList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_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 :: Doc
_lhsOpretty =
({-# LINE 367 "src/GLua/AG/PrettyPrint.ag" #-}
renderMLComments _lhsIppconf _lhsIindent (fst _commentsBeforeLine )
$+$ indent _lhsIppconf _lhsIindent _hdIpretty
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfter )
<> _addNewline
$+$ _tlIpretty
{-# LINE 5474 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 373 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 5479 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 374 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5484 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isMultiline =
({-# LINE 376 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline
|| _tlIisMultiline
|| not (null $ fst _commentsBeforeLine )
|| not (null $ fst _commentsAfter )
{-# LINE 5492 "src/GLua/AG/PrettyPrint.hs" #-}
)
_addNewline =
({-# LINE 381 "src/GLua/AG/PrettyPrint.ag" #-}
if not _tlIisLast && _hdIisMultiline then zchr '\n' else empty
{-# LINE 5497 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsBeforeLine =
({-# LINE 384 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `before` _hdIpos) _lhsIcomments
{-# LINE 5502 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 385 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsBeforeLine
{-# LINE 5507 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfter =
({-# LINE 386 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos' _) -> pos' `beforeOrOnLine` _hdIpos) _hdIcomments
{-# LINE 5512 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 387 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfter
{-# LINE 5517 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 388 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 5522 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOisLastStatement =
({-# LINE 390 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIisLast
{-# LINE 5527 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOwouldBeAmbiguousWithoutSemicolon =
({-# LINE 396 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIendsWithPrefixExpression && _tlIstartsWithExprPrefixExpression
{-# LINE 5532 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 398 "src/GLua/AG/PrettyPrint.ag" #-}
commentsForceMultiline $ fst _commentsBeforeLine
{-# LINE 5537 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 324 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstatementCount + _tlIstatementCount
{-# LINE 5542 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 5547 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5552 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 5557 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5562 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5567 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5572 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5577 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5582 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 5587 "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 :: T_MStatList
sem_MStatList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion ->
(let _lhsOpretty :: Doc
_lhsOstatementCount :: Int
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOcopy :: MStatList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 400 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5611 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstatementCount =
({-# LINE 401 "src/GLua/AG/PrettyPrint.ag" #-}
0
{-# LINE 5616 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 402 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5621 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 403 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5626 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 404 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5631 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 5636 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5641 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5646 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOstatementCount)))
sem_MaybeMExpr :: MaybeMExpr ->
T_MaybeMExpr
sem_MaybeMExpr :: Maybe MExpr -> T_MaybeMExpr
sem_MaybeMExpr (Prelude.Just MExpr
x) =
(T_MExpr -> T_MaybeMExpr
sem_MaybeMExpr_Just (MExpr -> T_MExpr
sem_MExpr MExpr
x))
sem_MaybeMExpr Maybe MExpr
Prelude.Nothing =
T_MaybeMExpr
sem_MaybeMExpr_Nothing
type T_MaybeMExpr = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),MaybeMExpr,Bool,Bool,Bool,Bool,OperatorLevel,Doc)
data Inh_MaybeMExpr = Inh_MaybeMExpr { :: ([MToken]),Inh_MaybeMExpr -> Bool
forceMultiline_Inh_MaybeMExpr :: Bool,Inh_MaybeMExpr -> Int
indent_Inh_MaybeMExpr :: Int,Inh_MaybeMExpr -> PrettyPrintConfig
ppconf_Inh_MaybeMExpr :: PrettyPrintConfig}
data Syn_MaybeMExpr = Syn_MaybeMExpr { :: ([MToken]),Syn_MaybeMExpr -> Maybe MExpr
copy_Syn_MaybeMExpr :: MaybeMExpr,Syn_MaybeMExpr -> Bool
endsWithPrefixExpression_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isAssociative_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isDefined_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> Bool
isMultiline_Syn_MaybeMExpr :: Bool,Syn_MaybeMExpr -> OperatorLevel
precedence_Syn_MaybeMExpr :: OperatorLevel,Syn_MaybeMExpr -> Doc
pretty_Syn_MaybeMExpr :: Doc}
wrap_MaybeMExpr :: T_MaybeMExpr ->
Inh_MaybeMExpr ->
Syn_MaybeMExpr
wrap_MaybeMExpr :: T_MaybeMExpr -> Inh_MaybeMExpr -> Syn_MaybeMExpr
wrap_MaybeMExpr T_MaybeMExpr
sem (Inh_MaybeMExpr [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,Maybe MExpr
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisAssociative,Bool
_lhsOisDefined,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_MaybeMExpr
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> Maybe MExpr
-> Bool
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_MaybeMExpr
Syn_MaybeMExpr [MToken]
_lhsOcomments Maybe MExpr
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisAssociative Bool
_lhsOisDefined Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_MaybeMExpr_Just :: T_MExpr ->
T_MaybeMExpr
sem_MaybeMExpr_Just :: T_MExpr -> T_MaybeMExpr
sem_MaybeMExpr_Just T_MExpr
just_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 508 "src/GLua/AG/PrettyPrint.ag" #-}
_justIpretty
{-# LINE 5704 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 509 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5709 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 510 "src/GLua/AG/PrettyPrint.ag" #-}
_justIendsWithPrefixExpression
{-# LINE 5714 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 511 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisMultiline
{-# LINE 5719 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorPrecedence =
({-# LINE 512 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 5724 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOparentOperatorAssociative =
({-# LINE 513 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 5729 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_justIisAssociative
{-# LINE 5734 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
_justIprecedence
{-# LINE 5739 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Just _justIcopy
{-# LINE 5744 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5749 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_justIcomments
{-# LINE 5754 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5759 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5764 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5769 "src/GLua/AG/PrettyPrint.hs" #-}
)
_justOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5774 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _justIcomments,_justIcopy,_justIendsWithPrefixExpression,_justIisAssociative,_justIisLiteral,_justIisMultiline,_justIpos,_justIprecedence,_justIpretty) =
just_ _justOcomments _justOforceMultiline _justOindent _justOparentOperatorAssociative _justOparentOperatorPrecedence _justOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_MaybeMExpr_Nothing :: T_MaybeMExpr
sem_MaybeMExpr_Nothing :: T_MaybeMExpr
sem_MaybeMExpr_Nothing =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisDefined :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: MaybeMExpr
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 515 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 5796 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 516 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5801 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 517 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5806 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 518 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5811 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5816 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5821 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Nothing
{-# LINE 5826 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5831 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5836 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisAssociative,_lhsOisDefined,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix :: PFExprSuffix ->
T_PFExprSuffix
sem_PFExprSuffix :: PFExprSuffix -> T_PFExprSuffix
sem_PFExprSuffix (Call Args
_args) =
(T_Args -> T_PFExprSuffix
sem_PFExprSuffix_Call (Args -> T_Args
sem_Args Args
_args))
sem_PFExprSuffix (MetaCall MToken
_fn Args
_args) =
(MToken -> T_Args -> T_PFExprSuffix
sem_PFExprSuffix_MetaCall MToken
_fn (Args -> T_Args
sem_Args Args
_args))
sem_PFExprSuffix (ExprIndex MExpr
_index) =
(T_MExpr -> T_PFExprSuffix
sem_PFExprSuffix_ExprIndex (MExpr -> T_MExpr
sem_MExpr MExpr
_index))
sem_PFExprSuffix (DotIndex MToken
_index) =
(MToken -> T_PFExprSuffix
sem_PFExprSuffix_DotIndex MToken
_index)
type T_PFExprSuffix = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),PFExprSuffix,Bool,Bool,OperatorLevel,Doc)
data Inh_PFExprSuffix = Inh_PFExprSuffix { :: ([MToken]),Inh_PFExprSuffix -> Bool
forceMultiline_Inh_PFExprSuffix :: Bool,Inh_PFExprSuffix -> Int
indent_Inh_PFExprSuffix :: Int,Inh_PFExprSuffix -> PrettyPrintConfig
ppconf_Inh_PFExprSuffix :: PrettyPrintConfig}
data Syn_PFExprSuffix = Syn_PFExprSuffix { :: ([MToken]),Syn_PFExprSuffix -> PFExprSuffix
copy_Syn_PFExprSuffix :: PFExprSuffix,Syn_PFExprSuffix -> Bool
isAssociative_Syn_PFExprSuffix :: Bool,Syn_PFExprSuffix -> Bool
isMultiline_Syn_PFExprSuffix :: Bool,Syn_PFExprSuffix -> OperatorLevel
precedence_Syn_PFExprSuffix :: OperatorLevel,Syn_PFExprSuffix -> Doc
pretty_Syn_PFExprSuffix :: Doc}
wrap_PFExprSuffix :: T_PFExprSuffix ->
Inh_PFExprSuffix ->
Syn_PFExprSuffix
wrap_PFExprSuffix :: T_PFExprSuffix -> Inh_PFExprSuffix -> Syn_PFExprSuffix
wrap_PFExprSuffix T_PFExprSuffix
sem (Inh_PFExprSuffix [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,PFExprSuffix
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty) = T_PFExprSuffix
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> PFExprSuffix
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Syn_PFExprSuffix
Syn_PFExprSuffix [MToken]
_lhsOcomments PFExprSuffix
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty))
sem_PFExprSuffix_Call :: T_Args ->
T_PFExprSuffix
sem_PFExprSuffix_Call :: T_Args -> T_PFExprSuffix
sem_PFExprSuffix_Call T_Args
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 956 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIpretty
{-# LINE 5889 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 957 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 5894 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5899 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5904 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Call _argsIcopy
{-# LINE 5909 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5914 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 5919 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 5924 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 5929 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 5934 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 5939 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_MetaCall :: MToken ->
T_Args ->
T_PFExprSuffix
sem_PFExprSuffix_MetaCall :: MToken -> T_Args -> T_PFExprSuffix
sem_PFExprSuffix_MetaCall MToken
fn_ T_Args
args_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 959 "src/GLua/AG/PrettyPrint.ag" #-}
zchr ':' <> tok fn_ <> _argsIpretty
{-# LINE 5969 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 960 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIisMultiline
{-# LINE 5974 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 5979 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 5984 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
MetaCall fn_ _argsIcopy
{-# LINE 5989 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 5994 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_argsIcomments
{-# LINE 5999 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6004 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6009 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6014 "src/GLua/AG/PrettyPrint.hs" #-}
)
_argsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6019 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _argsIcomments,_argsIcopy,_argsIisMultiline,_argsIpretty) =
args_ _argsOcomments _argsOforceMultiline _argsOindent _argsOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_ExprIndex :: T_MExpr ->
T_PFExprSuffix
sem_PFExprSuffix_ExprIndex :: T_MExpr -> T_PFExprSuffix
sem_PFExprSuffix_ExprIndex T_MExpr
index_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 962 "src/GLua/AG/PrettyPrint.ag" #-}
brackets _lhsIppconf _indexIpretty
{-# LINE 6055 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 963 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisMultiline
{-# LINE 6060 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorPrecedence =
({-# LINE 964 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6065 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOparentOperatorAssociative =
({-# LINE 965 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6070 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIisAssociative
{-# LINE 6075 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIprecedence
{-# LINE 6080 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ExprIndex _indexIcopy
{-# LINE 6085 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6090 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_indexIcomments
{-# LINE 6095 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6100 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6105 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6110 "src/GLua/AG/PrettyPrint.hs" #-}
)
_indexOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6115 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _indexIcomments,_indexIcopy,_indexIendsWithPrefixExpression,_indexIisAssociative,_indexIisLiteral,_indexIisMultiline,_indexIpos,_indexIprecedence,_indexIpretty) =
index_ _indexOcomments _indexOforceMultiline _indexOindent _indexOparentOperatorAssociative _indexOparentOperatorPrecedence _indexOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PFExprSuffix_DotIndex :: MToken ->
T_PFExprSuffix
sem_PFExprSuffix_DotIndex :: MToken -> T_PFExprSuffix
sem_PFExprSuffix_DotIndex MToken
index_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOisAssociative :: Bool
_lhsOprecedence :: OperatorLevel
_lhsOcopy :: PFExprSuffix
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 967 "src/GLua/AG/PrettyPrint.ag" #-}
zchr '.' <> tok index_
{-# LINE 6136 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 968 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6141 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6146 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
OperatorLevel8
{-# LINE 6151 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
DotIndex index_
{-# LINE 6156 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6161 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6166 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty)))
sem_PrefixExp :: PrefixExp ->
T_PrefixExp
sem_PrefixExp :: PrefixExp -> T_PrefixExp
sem_PrefixExp (PFVar MToken
_name ExprSuffixList
_suffixes) =
(MToken -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_PFVar MToken
_name (ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
_suffixes))
sem_PrefixExp (ExprVar MExpr
_expr ExprSuffixList
_suffixes) =
(T_MExpr -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_ExprVar (MExpr -> T_MExpr
sem_MExpr MExpr
_expr) (ExprSuffixList -> T_ExprSuffixList
sem_ExprSuffixList ExprSuffixList
_suffixes))
type T_PrefixExp = ([MToken]) ->
Bool ->
Int ->
Bool ->
OperatorLevel ->
PrettyPrintConfig ->
( ([MToken]),PrefixExp,Bool,Bool,Bool,OperatorLevel,Doc,Bool)
data Inh_PrefixExp = Inh_PrefixExp { :: ([MToken]),Inh_PrefixExp -> Bool
forceMultiline_Inh_PrefixExp :: Bool,Inh_PrefixExp -> Int
indent_Inh_PrefixExp :: Int,Inh_PrefixExp -> Bool
parentOperatorAssociative_Inh_PrefixExp :: Bool,Inh_PrefixExp -> OperatorLevel
parentOperatorPrecedence_Inh_PrefixExp :: OperatorLevel,Inh_PrefixExp -> PrettyPrintConfig
ppconf_Inh_PrefixExp :: PrettyPrintConfig}
data Syn_PrefixExp = Syn_PrefixExp { :: ([MToken]),Syn_PrefixExp -> PrefixExp
copy_Syn_PrefixExp :: PrefixExp,Syn_PrefixExp -> Bool
isAssociative_Syn_PrefixExp :: Bool,Syn_PrefixExp -> Bool
isLiteral_Syn_PrefixExp :: Bool,Syn_PrefixExp -> Bool
isMultiline_Syn_PrefixExp :: Bool,Syn_PrefixExp -> OperatorLevel
precedence_Syn_PrefixExp :: OperatorLevel,Syn_PrefixExp -> Doc
pretty_Syn_PrefixExp :: Doc,Syn_PrefixExp -> Bool
startsWithExprPrefixExpression_Syn_PrefixExp :: Bool}
wrap_PrefixExp :: T_PrefixExp ->
Inh_PrefixExp ->
Syn_PrefixExp
wrap_PrefixExp :: T_PrefixExp -> Inh_PrefixExp -> Syn_PrefixExp
wrap_PrefixExp T_PrefixExp
sem (Inh_PrefixExp [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,PrefixExp
_lhsOcopy,Bool
_lhsOisAssociative,Bool
_lhsOisLiteral,Bool
_lhsOisMultiline,OperatorLevel
_lhsOprecedence,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression) = T_PrefixExp
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIparentOperatorAssociative OperatorLevel
_lhsIparentOperatorPrecedence PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> PrefixExp
-> Bool
-> Bool
-> Bool
-> OperatorLevel
-> Doc
-> Bool
-> Syn_PrefixExp
Syn_PrefixExp [MToken]
_lhsOcomments PrefixExp
_lhsOcopy Bool
_lhsOisAssociative Bool
_lhsOisLiteral Bool
_lhsOisMultiline OperatorLevel
_lhsOprecedence Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression))
sem_PrefixExp_PFVar :: MToken ->
T_ExprSuffixList ->
T_PrefixExp
sem_PrefixExp_PFVar :: MToken -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_PFVar MToken
name_ T_ExprSuffixList
suffixes_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 903 "src/GLua/AG/PrettyPrint.ag" #-}
tok name_ <> _suffixesIpretty
{-# LINE 6224 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 904 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6229 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 905 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6234 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 906 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisMultiline
{-# LINE 6239 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIisAssociative
{-# LINE 6244 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 282 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIprecedence
{-# LINE 6249 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
PFVar name_ _suffixesIcopy
{-# LINE 6254 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6259 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6264 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6269 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6274 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6279 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6284 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) =
suffixes_ _suffixesOcomments _suffixesOforceMultiline _suffixesOindent _suffixesOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_PrefixExp_ExprVar :: T_MExpr ->
T_ExprSuffixList ->
T_PrefixExp
sem_PrefixExp_ExprVar :: T_MExpr -> T_ExprSuffixList -> T_PrefixExp
sem_PrefixExp_ExprVar T_MExpr
expr_ T_ExprSuffixList
suffixes_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIparentOperatorAssociative
OperatorLevel
_lhsIparentOperatorPrecedence
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOprecedence :: OperatorLevel
_lhsOisLiteral :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 908 "src/GLua/AG/PrettyPrint.ag" #-}
(if _noparens then _exprIpretty else parens _lhsIppconf NonEmpty _exprIpretty)
<> _suffixesIpretty
{-# LINE 6336 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOprecedence =
({-# LINE 911 "src/GLua/AG/PrettyPrint.ag" #-}
if _noparens then _exprIprecedence else OperatorLevel8
{-# LINE 6341 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLiteral =
({-# LINE 912 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6346 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 913 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6351 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 914 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisMultiline || _suffixesIisMultiline
{-# LINE 6356 "src/GLua/AG/PrettyPrint.hs" #-}
)
_containsParenthesizedExpr =
({-# LINE 918 "src/GLua/AG/PrettyPrint.ag" #-}
case _exprIcopy of
MExpr _ (APrefixExpr (ExprVar (MExpr _ AVarArg) _)) -> False
MExpr _ (APrefixExpr _) -> True
_ -> False
{-# LINE 6364 "src/GLua/AG/PrettyPrint.hs" #-}
)
_noparens =
({-# LINE 924 "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 6380 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisAssociative =
({-# LINE 284 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIisAssociative && _suffixesIisAssociative
{-# LINE 6385 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ExprVar _exprIcopy _suffixesIcopy
{-# LINE 6390 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6395 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_suffixesIcomments
{-# LINE 6400 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6405 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6410 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6415 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorAssociative =
({-# LINE 275 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorAssociative
{-# LINE 6420 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOparentOperatorPrecedence =
({-# LINE 274 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIparentOperatorPrecedence
{-# LINE 6425 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6430 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_exprIcomments
{-# LINE 6435 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6440 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6445 "src/GLua/AG/PrettyPrint.hs" #-}
)
_suffixesOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6450 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _exprIcomments,_exprIcopy,_exprIendsWithPrefixExpression,_exprIisAssociative,_exprIisLiteral,_exprIisMultiline,_exprIpos,_exprIprecedence,_exprIpretty) =
expr_ _exprOcomments _exprOforceMultiline _exprOindent _exprOparentOperatorAssociative _exprOparentOperatorPrecedence _exprOppconf
( _suffixesIcomments,_suffixesIcopy,_suffixesIisAssociative,_suffixesIisMultiline,_suffixesIprecedence,_suffixesIpretty) =
suffixes_ _suffixesOcomments _suffixesOforceMultiline _suffixesOindent _suffixesOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOisAssociative,_lhsOisLiteral,_lhsOisMultiline,_lhsOprecedence,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat :: Stat ->
T_Stat
sem_Stat :: Stat -> T_Stat
sem_Stat (Def [(PrefixExp, Maybe MExpr)]
_vars) =
(T_VarsList -> T_Stat
sem_Stat_Def ([(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
_vars))
sem_Stat (LocDef [(PrefixExp, Maybe MExpr)]
_vars) =
(T_VarsList -> T_Stat
sem_Stat_LocDef ([(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
_vars))
sem_Stat (AFuncCall PrefixExp
_fn) =
(T_PrefixExp -> T_Stat
sem_Stat_AFuncCall (PrefixExp -> T_PrefixExp
sem_PrefixExp PrefixExp
_fn))
sem_Stat (ALabel MToken
_lbl) =
(MToken -> T_Stat
sem_Stat_ALabel MToken
_lbl)
sem_Stat (Stat
ABreak) =
(T_Stat
sem_Stat_ABreak)
sem_Stat (Stat
AContinue) =
(T_Stat
sem_Stat_AContinue)
sem_Stat (AGoto MToken
_lbl) =
(MToken -> T_Stat
sem_Stat_AGoto MToken
_lbl)
sem_Stat (ADo Block
_body) =
(T_Block -> T_Stat
sem_Stat_ADo (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AWhile MExpr
_cond Block
_body) =
(T_MExpr -> T_Block -> T_Stat
sem_Stat_AWhile (MExpr -> T_MExpr
sem_MExpr MExpr
_cond) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (ARepeat Block
_body MExpr
_cond) =
(T_Block -> T_MExpr -> T_Stat
sem_Stat_ARepeat (Block -> T_Block
sem_Block Block
_body) (MExpr -> T_MExpr
sem_MExpr MExpr
_cond))
sem_Stat (AIf MExpr
_cond Block
_body [MElseIf]
_elifs Maybe MElse
_els) =
(T_MExpr -> T_Block -> T_ElseIfList -> T_Else -> T_Stat
sem_Stat_AIf (MExpr -> T_MExpr
sem_MExpr MExpr
_cond) (Block -> T_Block
sem_Block Block
_body) ([MElseIf] -> T_ElseIfList
sem_ElseIfList [MElseIf]
_elifs) (Maybe MElse -> T_Else
sem_Else Maybe MElse
_els))
sem_Stat (ANFor MToken
_var MExpr
_val MExpr
_to MExpr
_step Block
_body) =
(MToken -> T_MExpr -> T_MExpr -> T_MExpr -> T_Block -> T_Stat
sem_Stat_ANFor MToken
_var (MExpr -> T_MExpr
sem_MExpr MExpr
_val) (MExpr -> T_MExpr
sem_MExpr MExpr
_to) (MExpr -> T_MExpr
sem_MExpr MExpr
_step) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AGFor [MToken]
_vars [MExpr]
_vals Block
_body) =
([MToken] -> T_MExprList -> T_Block -> T_Stat
sem_Stat_AGFor [MToken]
_vars ([MExpr] -> T_MExprList
sem_MExprList [MExpr]
_vals) (Block -> T_Block
sem_Block Block
_body))
sem_Stat (AFunc FuncName
_name [MToken]
_args Block
_body) =
(T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_AFunc (FuncName -> T_FuncName
sem_FuncName FuncName
_name) [MToken]
_args (Block -> T_Block
sem_Block Block
_body))
sem_Stat (ALocFunc FuncName
_name [MToken]
_args Block
_body) =
(T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_ALocFunc (FuncName -> T_FuncName
sem_FuncName FuncName
_name) [MToken]
_args (Block -> T_Block
sem_Block Block
_body))
type T_Stat = ([MToken]) ->
Bool ->
Int ->
Bool ->
PrettyPrintConfig ->
Region ->
Bool ->
( ([MToken]),Stat,Bool,Bool,Doc,Bool)
data Inh_Stat = Inh_Stat { :: ([MToken]),Inh_Stat -> Bool
forceMultiline_Inh_Stat :: Bool,Inh_Stat -> Int
indent_Inh_Stat :: Int,Inh_Stat -> Bool
isLastStatement_Inh_Stat :: Bool,Inh_Stat -> PrettyPrintConfig
ppconf_Inh_Stat :: PrettyPrintConfig,Inh_Stat -> Region
statRegion_Inh_Stat :: Region,Inh_Stat -> Bool
wouldBeAmbiguousWithoutSemicolon_Inh_Stat :: Bool}
data Syn_Stat = Syn_Stat { :: ([MToken]),Syn_Stat -> Stat
copy_Syn_Stat :: Stat,Syn_Stat -> Bool
endsWithPrefixExpression_Syn_Stat :: Bool,Syn_Stat -> Bool
isMultiline_Syn_Stat :: Bool,Syn_Stat -> Doc
pretty_Syn_Stat :: Doc,Syn_Stat -> Bool
startsWithExprPrefixExpression_Syn_Stat :: Bool}
wrap_Stat :: T_Stat ->
Inh_Stat ->
Syn_Stat
wrap_Stat :: T_Stat -> Inh_Stat -> Syn_Stat
wrap_Stat T_Stat
sem (Inh_Stat [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion Bool
_lhsIwouldBeAmbiguousWithoutSemicolon) =
(let ( [MToken]
_lhsOcomments,Stat
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression) = T_Stat
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent Bool
_lhsIisLastStatement PrettyPrintConfig
_lhsIppconf Region
_lhsIstatRegion Bool
_lhsIwouldBeAmbiguousWithoutSemicolon
in ([MToken] -> Stat -> Bool -> Bool -> Doc -> Bool -> Syn_Stat
Syn_Stat [MToken]
_lhsOcomments Stat
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression))
sem_Stat_Def :: T_VarsList ->
T_Stat
sem_Stat_Def :: T_VarsList -> T_Stat
sem_Stat_Def T_VarsList
vars_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 642 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIpretty <> _semicolon
{-# LINE 6541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 643 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 644 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 645 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6556 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 646 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon
then zchr ';'
else empty
{-# LINE 6563 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
Def _varsIcopy
{-# LINE 6568 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6573 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6578 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6583 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6588 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6593 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6598 "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 :: T_VarsList -> T_Stat
sem_Stat_LocDef T_VarsList
vars_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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 :: Doc
_lhsOpretty =
({-# LINE 651 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "local" <-> _varsIpretty <> _semicolon
{-# LINE 6636 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 652 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIstartsWithExprPrefixExpression
{-# LINE 6641 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 653 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIendsWithPrefixExpression
{-# LINE 6646 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 654 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIisMultiline
{-# LINE 6651 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 655 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf || _lhsIwouldBeAmbiguousWithoutSemicolon
then zchr ';'
else empty
{-# LINE 6658 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
LocDef _varsIcopy
{-# LINE 6663 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6668 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_varsIcomments
{-# LINE 6673 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6678 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6683 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6688 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6693 "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 :: T_PrefixExp -> T_Stat
sem_Stat_AFuncCall T_PrefixExp
fn_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_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 :: Doc
_lhsOpretty =
({-# LINE 660 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIpretty <> _semicolon
{-# LINE 6731 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 661 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIisMultiline
{-# LINE 6736 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 662 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6741 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 663 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIstartsWithExprPrefixExpression
{-# LINE 6746 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 664 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6751 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorPrecedence =
({-# LINE 665 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 6756 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOparentOperatorAssociative =
({-# LINE 666 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 6761 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AFuncCall _fnIcopy
{-# LINE 6766 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6771 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_fnIcomments
{-# LINE 6776 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6781 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 6786 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 6791 "src/GLua/AG/PrettyPrint.hs" #-}
)
_fnOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 6796 "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 :: MToken -> T_Stat
sem_Stat_ALabel MToken
lbl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 668 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "::"
<> _whitespace
<> tok lbl_
<> _whitespace
<> zeroWidthText "::"
{-# LINE 6824 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 674 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6829 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 675 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6834 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 676 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6839 "src/GLua/AG/PrettyPrint.hs" #-}
)
_whitespace =
({-# LINE 677 "src/GLua/AG/PrettyPrint.ag" #-}
if spaceAfterLabel _lhsIppconf then zeroWidthText " " else empty
{-# LINE 6844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ALabel lbl_
{-# LINE 6849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6854 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6859 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ABreak :: T_Stat
sem_Stat_ABreak :: T_Stat
sem_Stat_ABreak =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 679 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "break" <> _semicolon
{-# LINE 6880 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 680 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6885 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 681 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6890 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 682 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6895 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 683 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6900 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ABreak
{-# LINE 6905 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6910 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6915 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AContinue :: T_Stat
sem_Stat_AContinue :: T_Stat
sem_Stat_AContinue =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 685 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "continue" <> _semicolon
{-# LINE 6936 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 686 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6941 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 687 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6946 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 688 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6951 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 689 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 6956 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AContinue
{-# LINE 6961 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 6966 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 6971 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AGoto :: MToken ->
T_Stat
sem_Stat_AGoto :: MToken -> T_Stat
sem_Stat_AGoto MToken
lbl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 691 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "goto" <-> tok lbl_ <> _semicolon
{-# LINE 6993 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 692 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 6998 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 693 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7003 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 694 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7008 "src/GLua/AG/PrettyPrint.hs" #-}
)
_semicolon =
({-# LINE 695 "src/GLua/AG/PrettyPrint.ag" #-}
if semicolons _lhsIppconf then zchr ';' else empty
{-# LINE 7013 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AGoto lbl_
{-# LINE 7018 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7023 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7028 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ADo :: T_Block ->
T_Stat
sem_Stat_ADo :: T_Block -> T_Stat
sem_Stat_ADo T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_bodyOindent :: Int
_lhsOcopy :: Stat
_lhsOcomments :: ([MToken])
_bodyOcomments :: ([MToken])
_bodyOforceMultiline :: Bool
_bodyOppconf :: PrettyPrintConfig
_bodyOstatRegion :: Region
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 697 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7060 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 698 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "do"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7067 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 702 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7072 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 703 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7077 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 704 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7082 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ADo _bodyIcopy
{-# LINE 7087 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7092 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7097 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7102 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7107 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7112 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7117 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_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 :: T_MExpr -> T_Block -> T_Stat
sem_Stat_AWhile T_MExpr
cond_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_condOparentOperatorPrecedence :: OperatorLevel
_condOparentOperatorAssociative :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 706 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7167 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 707 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7172 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 708 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7177 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 709 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7182 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 710 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7187 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 711 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "while"
<-> _condIpretty
<-> zeroWidthText "do"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7196 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 717 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7201 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AWhile _condIcopy _bodyIcopy
{-# LINE 7206 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7211 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7216 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7221 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7226 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7231 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7236 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7241 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7246 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7251 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7256 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_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 :: T_Block -> T_MExpr -> T_Stat
sem_Stat_ARepeat T_Block
body_ T_MExpr
cond_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_condIcomments :: ([MToken])
_condIcopy :: MExpr
_condIendsWithPrefixExpression :: Bool
_condIisAssociative :: Bool
_condIisLiteral :: Bool
_condIisMultiline :: Bool
_condIpos :: Region
_condIprecedence :: OperatorLevel
_condIpretty :: Doc
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 719 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "repeat"
$+$ _bodyIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "until" <-> _condIpretty)
{-# LINE 7310 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 723 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7315 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 724 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7320 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 725 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7325 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 726 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7330 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 727 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7335 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 728 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7340 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ARepeat _bodyIcopy _condIcopy
{-# LINE 7345 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7350 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7355 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 7360 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7365 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7370 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7375 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7380 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7385 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7390 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7395 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_AIf :: T_MExpr ->
T_Block ->
T_ElseIfList ->
T_Else ->
T_Stat
sem_Stat_AIf :: T_MExpr -> T_Block -> T_ElseIfList -> T_Else -> T_Stat
sem_Stat_AIf T_MExpr
cond_ T_Block
body_ T_ElseIfList
elifs_ T_Else
els_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_elifsIcomments :: ([MToken])
_elifsIcopy :: ElseIfList
_elifsIelsesExist :: Bool
_elifsIisMultiline :: Bool
_elifsIpos :: Region
_elifsIpretty :: Doc
_elsIcomments :: ([MToken])
_elsIcopy :: Else
_elsIelsesExist :: Bool
_elsIisMultiline :: Bool
_elsIpos :: Region
_elsIpretty :: Doc
_isMultiline :: Bool
_isMultiline =
({-# LINE 730 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
|| _condIisMultiline
|| _bodyIisMultiline
|| _elifsIelsesExist
|| _elsIelsesExist
{-# LINE 7474 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 736 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7479 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 737 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7484 "src/GLua/AG/PrettyPrint.hs" #-}
)
_singleLinePretty =
({-# LINE 738 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if"
<-> _condIpretty
<-> zeroWidthText "then"
<-> _bodyIpretty
<-> zeroWidthText "end"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterThen )
{-# LINE 7494 "src/GLua/AG/PrettyPrint.hs" #-}
)
_multilinePretty =
({-# LINE 745 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "if"
<-> _condIpretty
<-> zeroWidthText "then"
<-> renderSLComments _lhsIppconf _lhsIindent (fst _commentsAfterThen )
$+$ _bodyIpretty
$+$ _elifsIpretty
$+$ _elsIpretty
$+$ indent _lhsIppconf _lhsIindent (zeroWidthText "end")
{-# LINE 7506 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterThen =
({-# LINE 755 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _condIpos) _lhsIcomments
{-# LINE 7511 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOcomments =
({-# LINE 757 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterThen
{-# LINE 7516 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorPrecedence =
({-# LINE 759 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7521 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOparentOperatorAssociative =
({-# LINE 760 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7526 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 761 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _lhsIindent + 1 else 0
{-# LINE 7531 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 762 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion `upto` _elifsIpos `upto` _elsIpos
{-# LINE 7536 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 763 "src/GLua/AG/PrettyPrint.ag" #-}
if _isMultiline then _multilinePretty else _singleLinePretty
{-# LINE 7541 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AIf _condIcopy _bodyIcopy _elifsIcopy _elsIcopy
{-# LINE 7546 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7551 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_elsIcomments
{-# LINE 7556 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 266 "src/GLua/AG/PrettyPrint.ag" #-}
_isMultiline
{-# LINE 7561 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7566 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7571 "src/GLua/AG/PrettyPrint.hs" #-}
)
_condOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7576 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_condIcomments
{-# LINE 7581 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7586 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7591 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7596 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7601 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7606 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elifsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7611 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_elifsIcomments
{-# LINE 7616 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7621 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7626 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7631 "src/GLua/AG/PrettyPrint.hs" #-}
)
_elsOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7636 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _condIcomments,_condIcopy,_condIendsWithPrefixExpression,_condIisAssociative,_condIisLiteral,_condIisMultiline,_condIpos,_condIprecedence,_condIpretty) =
cond_ _condOcomments _condOforceMultiline _condOindent _condOparentOperatorAssociative _condOparentOperatorPrecedence _condOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
( _elifsIcomments,_elifsIcopy,_elifsIelsesExist,_elifsIisMultiline,_elifsIpos,_elifsIpretty) =
elifs_ _elifsOcomments _elifsOforceMultiline _elifsOindent _elifsOppconf
( _elsIcomments,_elsIcopy,_elsIelsesExist,_elsIisMultiline,_elsIpos,_elsIpretty) =
els_ _elsOcomments _elsOforceMultiline _elsOindent _elsOppconf _elsOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_Stat_ANFor :: MToken ->
T_MExpr ->
T_MExpr ->
T_MExpr ->
T_Block ->
T_Stat
sem_Stat_ANFor :: MToken -> T_MExpr -> T_MExpr -> T_MExpr -> T_Block -> T_Stat
sem_Stat_ANFor MToken
var_ T_MExpr
val_ T_MExpr
to_ T_MExpr
step_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 765 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7725 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 766 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7730 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 767 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7735 "src/GLua/AG/PrettyPrint.hs" #-}
)
_step =
({-# LINE 768 "src/GLua/AG/PrettyPrint.ag" #-}
case _stepIcopy of
MExpr _ (ANumber "1") -> empty
_ -> _comma <> _stepIpretty
{-# LINE 7742 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 771 "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 7757 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 783 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 7764 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFor =
({-# LINE 787 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` mpos var_) _lhsIcomments
{-# LINE 7769 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOcomments =
({-# LINE 789 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFor
{-# LINE 7774 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorPrecedence =
({-# LINE 790 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7779 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOparentOperatorAssociative =
({-# LINE 791 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7784 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorPrecedence =
({-# LINE 792 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7789 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOparentOperatorAssociative =
({-# LINE 793 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7794 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorPrecedence =
({-# LINE 794 "src/GLua/AG/PrettyPrint.ag" #-}
TopLevelExpression
{-# LINE 7799 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOparentOperatorAssociative =
({-# LINE 795 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7804 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 796 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7809 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ANFor var_ _valIcopy _toIcopy _stepIcopy _bodyIcopy
{-# LINE 7814 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 7819 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 7824 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7829 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7834 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7839 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_valIcomments
{-# LINE 7844 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7849 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7854 "src/GLua/AG/PrettyPrint.hs" #-}
)
_toOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7859 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_toIcomments
{-# LINE 7864 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7869 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 7874 "src/GLua/AG/PrettyPrint.hs" #-}
)
_stepOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7879 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_stepIcomments
{-# LINE 7884 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 7889 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 7894 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 7899 "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,_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 :: [MToken] -> T_MExprList -> T_Block -> T_Stat
sem_Stat_AGFor [MToken]
vars_ T_MExprList
vals_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_bodyOindent :: Int
_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
_bodyIcomments :: ([MToken])
_bodyIcopy :: Block
_bodyIisMultiline :: Bool
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 798 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 7954 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 799 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7959 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 800 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 7964 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 801 "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 7976 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 810 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 7981 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 811 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 7988 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFor =
({-# LINE 815 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` mpos (head vars_)) _lhsIcomments
{-# LINE 7993 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOcomments =
({-# LINE 817 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFor
{-# LINE 7998 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOforceMultiline =
({-# LINE 819 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8003 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOsomeElementsInListAreMultiline =
({-# LINE 820 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8008 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AGFor vars_ _valsIcopy _bodyIcopy
{-# LINE 8013 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8018 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8023 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8028 "src/GLua/AG/PrettyPrint.hs" #-}
)
_valsOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8033 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_valsIcomments
{-# LINE 8038 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8043 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8048 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8053 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _valsIcomments,_valsIcopy,_valsIisAssociative,_valsIisLast,_valsIisMultiline,_valsIpos,_valsIprecedence,_valsIpretty) =
vals_ _valsOcomments _valsOforceMultiline _valsOindent _valsOppconf _valsOsomeElementsInListAreMultiline
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_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 :: T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_AFunc T_FuncName
name_ [MToken]
args_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOpretty :: Doc
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 822 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8099 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 823 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8104 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 824 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8109 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 825 "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 8119 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFunc =
({-# LINE 832 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _nameIpos) _lhsIcomments
{-# LINE 8124 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 834 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFunc
{-# LINE 8129 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 835 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8134 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 836 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8141 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 840 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8146 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8151 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8156 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8161 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8166 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8171 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8176 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8181 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8186 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8191 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpos,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_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 :: T_FuncName -> [MToken] -> T_Block -> T_Stat
sem_Stat_ALocFunc T_FuncName
name_ [MToken]
args_ T_Block
body_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
Bool
_lhsIisLastStatement
PrettyPrintConfig
_lhsIppconf
Region
_lhsIstatRegion
Bool
_lhsIwouldBeAmbiguousWithoutSemicolon ->
(let _lhsOisMultiline :: Bool
_lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_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
_bodyIpretty :: Doc
_bodyIstatementCount :: Int
_lhsOisMultiline :: Bool
_lhsOisMultiline =
({-# LINE 842 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8237 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOpretty =
({-# LINE 843 "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 8247 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 850 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8252 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 851 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8257 "src/GLua/AG/PrettyPrint.hs" #-}
)
_commentsAfterFunc =
({-# LINE 852 "src/GLua/AG/PrettyPrint.ag" #-}
span (\(MToken pos _) -> pos `beforeOrOnLine` _nameIpos) _lhsIcomments
{-# LINE 8262 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOcomments =
({-# LINE 854 "src/GLua/AG/PrettyPrint.ag" #-}
snd _commentsAfterFunc
{-# LINE 8267 "src/GLua/AG/PrettyPrint.hs" #-}
)
_emptyParams =
({-# LINE 855 "src/GLua/AG/PrettyPrint.ag" #-}
toEmpty $ null args_
{-# LINE 8272 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 856 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8279 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOindent =
({-# LINE 860 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent + 1
{-# LINE 8284 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ALocFunc _nameIcopy args_ _bodyIcopy
{-# LINE 8289 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8294 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_bodyIcomments
{-# LINE 8299 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8304 "src/GLua/AG/PrettyPrint.hs" #-}
)
_nameOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8309 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_nameIcomments
{-# LINE 8314 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8319 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8324 "src/GLua/AG/PrettyPrint.hs" #-}
)
_bodyOstatRegion =
({-# LINE 330 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIstatRegion
{-# LINE 8329 "src/GLua/AG/PrettyPrint.hs" #-}
)
( _nameIcomments,_nameIcopy,_nameIisMultiline,_nameIpos,_nameIpretty) =
name_ _nameOcomments _nameOindent _nameOppconf
( _bodyIcomments,_bodyIcopy,_bodyIisMultiline,_bodyIpretty,_bodyIstatementCount) =
body_ _bodyOcomments _bodyOforceMultiline _bodyOindent _bodyOppconf _bodyOstatRegion
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression)))
sem_UnOp :: UnOp ->
T_UnOp
sem_UnOp :: UnOp -> T_UnOp
sem_UnOp (UnOp
UnMinus) =
(T_UnOp
sem_UnOp_UnMinus)
sem_UnOp (UnOp
ANot) =
(T_UnOp
sem_UnOp_ANot)
sem_UnOp (UnOp
AHash) =
(T_UnOp
sem_UnOp_AHash)
type T_UnOp = ([MToken]) ->
Int ->
PrettyPrintConfig ->
( ([MToken]),UnOp,Bool,Doc)
data Inh_UnOp = Inh_UnOp { :: ([MToken]),Inh_UnOp -> Int
indent_Inh_UnOp :: Int,Inh_UnOp -> PrettyPrintConfig
ppconf_Inh_UnOp :: PrettyPrintConfig}
data Syn_UnOp = Syn_UnOp { :: ([MToken]),Syn_UnOp -> UnOp
copy_Syn_UnOp :: UnOp,Syn_UnOp -> Bool
isMultiline_Syn_UnOp :: Bool,Syn_UnOp -> Doc
pretty_Syn_UnOp :: Doc}
wrap_UnOp :: T_UnOp ->
Inh_UnOp ->
Syn_UnOp
wrap_UnOp :: T_UnOp -> Inh_UnOp -> Syn_UnOp
wrap_UnOp T_UnOp
sem (Inh_UnOp [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,UnOp
_lhsOcopy,Bool
_lhsOisMultiline,Doc
_lhsOpretty) = T_UnOp
sem [MToken]
_lhsIcomments Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken] -> UnOp -> Bool -> Doc -> Syn_UnOp
Syn_UnOp [MToken]
_lhsOcomments UnOp
_lhsOcopy Bool
_lhsOisMultiline Doc
_lhsOpretty))
sem_UnOp_UnMinus :: T_UnOp
sem_UnOp_UnMinus :: T_UnOp
sem_UnOp_UnMinus =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1197 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "-"
{-# LINE 8371 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1198 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8376 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
UnMinus
{-# LINE 8381 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8386 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8391 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_ANot :: T_UnOp
sem_UnOp_ANot :: T_UnOp
sem_UnOp_ANot =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1200 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText (if cStyle _lhsIppconf then "!" else "not ")
{-# LINE 8406 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1201 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8411 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
ANot
{-# LINE 8416 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8421 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8426 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_UnOp_AHash :: T_UnOp
sem_UnOp_AHash :: T_UnOp
sem_UnOp_AHash =
(\ [MToken]
_lhsIcomments
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOisMultiline :: Bool
_lhsOcopy :: UnOp
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 1203 "src/GLua/AG/PrettyPrint.ag" #-}
zeroWidthText "#"
{-# LINE 8441 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 1204 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8446 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
AHash
{-# LINE 8451 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8456 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8461 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOisMultiline,_lhsOpretty)))
sem_VarsList :: VarsList ->
T_VarsList
sem_VarsList :: [(PrefixExp, Maybe MExpr)] -> T_VarsList
sem_VarsList [(PrefixExp, Maybe MExpr)]
list =
(forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
Prelude.foldr T_Declaration -> T_VarsList -> T_VarsList
sem_VarsList_Cons T_VarsList
sem_VarsList_Nil (forall a b. (a -> b) -> [a] -> [b]
Prelude.map (PrefixExp, Maybe MExpr) -> T_Declaration
sem_Declaration [(PrefixExp, Maybe MExpr)]
list))
type T_VarsList = ([MToken]) ->
Bool ->
Int ->
PrettyPrintConfig ->
( ([MToken]),VarsList,Bool,Doc,Bool,Bool,Bool,Doc,Bool,Doc)
data Inh_VarsList = Inh_VarsList { :: ([MToken]),Inh_VarsList -> Bool
forceMultiline_Inh_VarsList :: Bool,Inh_VarsList -> Int
indent_Inh_VarsList :: Int,Inh_VarsList -> PrettyPrintConfig
ppconf_Inh_VarsList :: PrettyPrintConfig}
data Syn_VarsList = Syn_VarsList { :: ([MToken]),Syn_VarsList -> [(PrefixExp, Maybe MExpr)]
copy_Syn_VarsList :: VarsList,Syn_VarsList -> Bool
endsWithPrefixExpression_Syn_VarsList :: Bool,Syn_VarsList -> Doc
exprPretty_Syn_VarsList :: Doc,Syn_VarsList -> Bool
isDefined_Syn_VarsList :: Bool,Syn_VarsList -> Bool
isLast_Syn_VarsList :: Bool,Syn_VarsList -> Bool
isMultiline_Syn_VarsList :: Bool,Syn_VarsList -> Doc
pretty_Syn_VarsList :: Doc,Syn_VarsList -> Bool
startsWithExprPrefixExpression_Syn_VarsList :: Bool,Syn_VarsList -> Doc
varPretty_Syn_VarsList :: Doc}
wrap_VarsList :: T_VarsList ->
Inh_VarsList ->
Syn_VarsList
wrap_VarsList :: T_VarsList -> Inh_VarsList -> Syn_VarsList
wrap_VarsList T_VarsList
sem (Inh_VarsList [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf) =
(let ( [MToken]
_lhsOcomments,[(PrefixExp, Maybe MExpr)]
_lhsOcopy,Bool
_lhsOendsWithPrefixExpression,Doc
_lhsOexprPretty,Bool
_lhsOisDefined,Bool
_lhsOisLast,Bool
_lhsOisMultiline,Doc
_lhsOpretty,Bool
_lhsOstartsWithExprPrefixExpression,Doc
_lhsOvarPretty) = T_VarsList
sem [MToken]
_lhsIcomments Bool
_lhsIforceMultiline Int
_lhsIindent PrettyPrintConfig
_lhsIppconf
in ([MToken]
-> [(PrefixExp, Maybe MExpr)]
-> Bool
-> Doc
-> Bool
-> Bool
-> Bool
-> Doc
-> Bool
-> Doc
-> Syn_VarsList
Syn_VarsList [MToken]
_lhsOcomments [(PrefixExp, Maybe MExpr)]
_lhsOcopy Bool
_lhsOendsWithPrefixExpression Doc
_lhsOexprPretty Bool
_lhsOisDefined Bool
_lhsOisLast Bool
_lhsOisMultiline Doc
_lhsOpretty Bool
_lhsOstartsWithExprPrefixExpression Doc
_lhsOvarPretty))
sem_VarsList_Cons :: T_Declaration ->
T_VarsList ->
T_VarsList
sem_VarsList_Cons :: T_Declaration -> T_VarsList -> T_VarsList
sem_VarsList_Cons T_Declaration
hd_ T_VarsList
tl_ =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_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 :: Doc
_lhsOpretty =
({-# LINE 532 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty
<-> if _isDefined then zchr '=' <-> _exprPretty else empty
{-# LINE 8533 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 535 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIstartsWithExprPrefixExpression
{-# LINE 8538 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 536 "src/GLua/AG/PrettyPrint.ag" #-}
if _tlIisDefined then _tlIendsWithPrefixExpression else _hdIendsWithPrefixExpression
{-# LINE 8543 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 543 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisMultiline || _tlIisMultiline
{-# LINE 8548 "src/GLua/AG/PrettyPrint.hs" #-}
)
_isDefined =
({-# LINE 544 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIisDefined || _tlIisDefined
{-# LINE 8553 "src/GLua/AG/PrettyPrint.hs" #-}
)
_varPretty =
({-# LINE 545 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIvarPretty
<> (if _tlIisLast then empty else _comma )
<> _tlIvarPretty
{-# LINE 8560 "src/GLua/AG/PrettyPrint.hs" #-}
)
_exprPretty =
({-# LINE 549 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIexprPretty
<> (if not _tlIisLast && _tlIisDefined then _comma else empty)
<> _tlIexprPretty
{-# LINE 8567 "src/GLua/AG/PrettyPrint.hs" #-}
)
_comma =
({-# LINE 553 "src/GLua/AG/PrettyPrint.ag" #-}
(if spaceBeforeComma _lhsIppconf then zchr ' ' else empty)
<> zchr ','
<> (if spaceAfterComma _lhsIppconf then zchr ' ' else empty)
{-# LINE 8574 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 557 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8579 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 288 "src/GLua/AG/PrettyPrint.ag" #-}
_exprPretty
{-# LINE 8584 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 291 "src/GLua/AG/PrettyPrint.ag" #-}
_isDefined
{-# LINE 8589 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
_varPretty
{-# LINE 8594 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
(:) _hdIcopy _tlIcopy
{-# LINE 8599 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8604 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_tlIcomments
{-# LINE 8609 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8614 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8619 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8624 "src/GLua/AG/PrettyPrint.hs" #-}
)
_hdOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8629 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_hdIcomments
{-# LINE 8634 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOforceMultiline =
({-# LINE 363 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIforceMultiline
{-# LINE 8639 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOindent =
({-# LINE 265 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIindent
{-# LINE 8644 "src/GLua/AG/PrettyPrint.hs" #-}
)
_tlOppconf =
({-# LINE 267 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIppconf
{-# LINE 8649 "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 :: T_VarsList
sem_VarsList_Nil =
(\ [MToken]
_lhsIcomments
Bool
_lhsIforceMultiline
Int
_lhsIindent
PrettyPrintConfig
_lhsIppconf ->
(let _lhsOpretty :: Doc
_lhsOstartsWithExprPrefixExpression :: Bool
_lhsOendsWithPrefixExpression :: Bool
_lhsOisMultiline :: Bool
_lhsOisLast :: Bool
_lhsOexprPretty :: Doc
_lhsOisDefined :: Bool
_lhsOvarPretty :: Doc
_lhsOcopy :: VarsList
_lhsOcomments :: ([MToken])
_lhsOpretty :: Doc
_lhsOpretty =
({-# LINE 559 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8675 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOstartsWithExprPrefixExpression =
({-# LINE 560 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8680 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOendsWithPrefixExpression =
({-# LINE 561 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8685 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisMultiline =
({-# LINE 562 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8690 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisLast =
({-# LINE 563 "src/GLua/AG/PrettyPrint.ag" #-}
True
{-# LINE 8695 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOexprPretty =
({-# LINE 288 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8700 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOisDefined =
({-# LINE 291 "src/GLua/AG/PrettyPrint.ag" #-}
False
{-# LINE 8705 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOvarPretty =
({-# LINE 287 "src/GLua/AG/PrettyPrint.ag" #-}
empty
{-# LINE 8710 "src/GLua/AG/PrettyPrint.hs" #-}
)
_copy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
[]
{-# LINE 8715 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcopy =
({-# LINE 268 "src/GLua/AG/PrettyPrint.ag" #-}
_copy
{-# LINE 8720 "src/GLua/AG/PrettyPrint.hs" #-}
)
_lhsOcomments =
({-# LINE 315 "src/GLua/AG/PrettyPrint.ag" #-}
_lhsIcomments
{-# LINE 8725 "src/GLua/AG/PrettyPrint.hs" #-}
)
in ( _lhsOcomments,_lhsOcopy,_lhsOendsWithPrefixExpression,_lhsOexprPretty,_lhsOisDefined,_lhsOisLast,_lhsOisMultiline,_lhsOpretty,_lhsOstartsWithExprPrefixExpression,_lhsOvarPretty)))