<commit_before>type case_interface = Ethereum.function_signature

let case_interface_of (raw : unit Syntax.case) : case_interface =
  failwith "case_inter not implemented"

type contract_interface =
  { contract_interface_name : string
    (** [contract_interface_name] is the name of the contract. *)
  ; contract_interface_args : Ethereum.interface_typ list
  ; contract_interface_cases : case_interface list
  ; contract_interface_continuations : string list
    (** [contract_interface_transitions] lists the names of contracts that
        this one can continue into *)
  }

let collect_continuation_in_contract (raw : unit Syntax.contract) : string list =
  failwith "colelct_cont not implemented"

let contract_interface_of (raw : unit Syntax.contract) : contract_interface =
  Syntax.
  { contract_interface_name = raw.contract_name
  ; contract_interface_args = Ethereum.get_interface_typs raw.contract_arguments
  ; contract_interface_cases = List.map case_interface_of raw.contract_cases
  ; contract_interface_continuations = collect_continuation_in_contract raw
  }<commit_msg>Collecting continuations from the syntax tree<commit_after>type case_interface = Ethereum.function_signature

let case_interface_of (raw : unit Syntax.case) : case_interface =
  failwith "case_inter not implemented"

type contract_interface =
  { contract_interface_name : string
    (** [contract_interface_name] is the name of the contract. *)
  ; contract_interface_args : Ethereum.interface_typ list
  ; contract_interface_cases : case_interface list
  ; contract_interface_continuations : string list
    (** [contract_interface_transitions] lists the names of contracts that
        this one can continue into *)
  }

let collect_continuation_in_sentence (raw : unit Syntax.sentence) : string list =
  failwith "collect_continuation_in_sentence"

let collect_continuation_in_case (raw : unit Syntax.case) : string list =
  List.concat (List.map collect_continuation_in_sentence raw.case_body)

let collect_continuation_in_contract (raw : unit Syntax.contract) : string list =
  List.concat (List.map collect_continuation_in_case raw.contract_cases)

let contract_interface_of (raw : unit Syntax.contract) : contract_interface =
  Syntax.
  { contract_interface_name = raw.contract_name
  ; contract_interface_args = Ethereum.get_interface_typs raw.contract_arguments
  ; contract_interface_cases = List.map case_interface_of raw.contract_cases
  ; contract_interface_continuations = collect_continuation_in_contract raw
  }
{'fraction_non_alphanumeric': 0.06272330289797538, 'fraction_numerical': 0.0, 'mean_word_length': 5.702127659574468, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '309754', 'n_tokens_mistral': 715, 'n_tokens_neox': 696, 'n_words': 175}