<commit_before>{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
{-# OPTIONS -Wall #-}

import           Data.Dynamic
import           Language.Paraiso.Generator (generate)
import qualified Language.Paraiso.Generator.Claris as C
import           Language.Paraiso.Name
import           Language.Paraiso.Prelude


main :: IO ()
main = do
  _ <- generate (sampleProgram 5 8) "./" 
  return ()

sampleProgram :: Int -> Int -> C.Program
sampleProgram x1 x2 = 
  C.Program {
    C.progName = mkName "main",
    C.topLevel = 
      [C.PrprInst $ C.Include C.SourceFile C.Chevron "iostream" ,
       C.FuncDecl $ (C.function tInt (mkName "main")){C.funcBody= mainBody}, 
       C.FuncDecl $ (C.function tInt (mkName "calc"))
         { C.funcArgs = [varX, varY] ,
           C.funcBody = calcBody
         }
       ]
    }
  where
    varX = C.Var tInt (mkName "x") 
    varY = C.Var tInt (mkName "y")
    varZ = C.Var tInt (mkName "z")
    mainBody = 
      [C.StmtExpr   $ cout << message << endl,
       C.StmtReturn $ C.Imm $ toDyn (0::Int) ]
    
    calcBody = 
      [C.StmtDeclInit varZ (C.Imm $ toDyn(2::Int)),
       C.StmtExpr $ C.Op2Infix "+=" (C.VarExpr varZ) 
       $ C.Op2Infix "*" (C.VarExpr varX) (C.VarExpr varY),<commit_msg>few spaces<commit_after>{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
{-# OPTIONS -Wall #-}

import           Data.Dynamic
import           Language.Paraiso.Generator (generate)
import qualified Language.Paraiso.Generator.Claris as C
import           Language.Paraiso.Name
import           Language.Paraiso.Prelude


main :: IO ()
main = do
  _ <- generate (sampleProgram 5 8) "./" 
  return ()

sampleProgram :: Int -> Int -> C.Program
sampleProgram x1 x2 = 
  C.Program {
    C.progName = mkName "main",
    C.topLevel = 
      [ C.PrprInst $ C.Include C.SourceFile C.Chevron "iostream" ,
        C.FuncDecl $ (C.function tInt (mkName "main"))
          { C.funcBody= mainBody }, 
        C.FuncDecl $ (C.function tInt (mkName "calc"))
          { C.funcArgs = [varX, varY] ,
            C.funcBody = calcBody
          }
      ]
    }
  where
    varX = C.Var tInt (mkName "x") 
    varY = C.Var tInt (mkName "y")
    varZ = C.Var tInt (mkName "z")
    mainBody = 
      [C.StmtExpr   $ cout << message << endl,
       C.StmtReturn $ C.Imm $ toDyn (0::Int) ]
    
    calcBody = 
      [C.StmtDeclInit varZ (C.Imm $ toDyn(2::Int)),
       C.StmtExpr $ C.Op2Infix "+=" (C.VarExpr varZ) 
       $ C.Op2Infix "*" (C.VarExpr varX) (C.VarExpr varY),
{'fraction_non_alphanumeric': 0.1402805611222445, 'fraction_numerical': 0.006412825651302605, 'mean_word_length': 2.1918158567774935, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507238', 'n_tokens_mistral': 925, 'n_tokens_neox': 899, 'n_words': 203}