<commit_before>module CCode (CCode (..),
              CVarSpec (..),
              Id (..),
              embedCType,
              CType,
              show) where

{- to be moved into a separate file later -}

import qualified AST
import Data.Char

newtype CType = CType String
type Id = String

instance Show CType where
  show (CType ct) = ct

embedCType :: String -> CType
embedCType = CType

newtype CVarSpec = CVarSpec (CType, Id)

data CCode = 
     Includes [String]
   | Decl CVarSpec
   | HashDefine String
   | Switch Id [(CCode, CCode)]
   | StructDecl Id [CVarSpec]
   | Record [CCode]
   | Static CCode
   | Assign CCode CCode
   | Statement CCode -- for putting a semi-colon on the end.
   | C [CCode]
   | Call Id [CCode]
   | TypeDef Id CCode
   | Var Id
   | SEMI CCode          -- need to get rid of this
   | Embed String  -- for C code that doesn't match other patterns
   | Function { fun_ret :: CType,
                fun_name :: String,
                fun_args :: [CVarSpec],
                fun_body :: [CCode] }

<commit_msg>Removed the SEMI constructor (again).<commit_after>module CCode (CCode (..),
              CVarSpec (..),
              Id (..),
              embedCType,
              CType,
              show) where

{- to be moved into a separate file later -}

import qualified AST
import Data.Char

newtype CType = CType String
type Id = String

instance Show CType where
  show (CType ct) = ct

embedCType :: String -> CType
embedCType = CType

newtype CVarSpec = CVarSpec (CType, Id)

data CCode = 
     Includes [String]
   | Decl CVarSpec
   | HashDefine String
   | Switch Id [(CCode, CCode)]
   | StructDecl Id [CVarSpec]
   | Record [CCode]
   | Static CCode
   | Assign CCode CCode
   | Statement CCode -- for putting a semi-colon on the end.
   | C [CCode]
   | Call Id [CCode]
   | TypeDef Id CCode
   | Var Id
   | Embed String  -- for C code that doesn't match other patterns
   | Function { fun_ret :: CType,
                fun_name :: String,
                fun_args :: [CVarSpec],
                fun_body :: [CCode] }


{'fraction_non_alphanumeric': 0.09423076923076923, 'fraction_numerical': 0.0, 'mean_word_length': 1.9728571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7613907', 'n_tokens_mistral': 678, 'n_tokens_neox': 654, 'n_words': 226}