<commit_before># - Configure texinfo file
# This function is very similar to configure_file except that it takes care to
# escape @ characters. Prefers to use ${var} expansion form instead of @var@

if(NOT COMMAND CONFIGURE_TEXINFO)

function(CONFIGURE_TEXINFO input output)
  # Collect all variables ${var} in the file.
  file(READ ${input} inbuf)
  # We write [{] instead of { to avoid pattern like ${..} that cmake tries to
  # expand.
  string(REGEX MATCHALL "\\$[{]([^}]+)}" varlist ${inbuf})
  # Removes $, { and } from the variables list.
  set(tmpvarlist "")
  foreach(i ${varlist})
    string(REGEX REPLACE "[$}{]" "" tmp ${i})
    list(APPEND tmpvarlist ${tmp})
  endforeach(i)
  set(varlist ${tmpvarlist})
  set(tmpvarlist)
  # Save and escape variables.
  foreach(i ${varlist})
    set(__configure_textinfo_copy__${i} ${${i}})
    string(REGEX REPLACE "@([^@])" "@@\\1" tmp "${${i}}")
    set(${i} ${tmp})<commit_msg>Fix @ escaping bug.<commit_after># - Configure texinfo file
# This function is very similar to configure_file except that it takes care to
# escape @ characters. Prefers to use ${var} expansion form instead of @var@.

if(NOT COMMAND CONFIGURE_TEXINFO)

function(CONFIGURE_TEXINFO input output)
  # Collect all variables ${var} in the file.
  file(READ ${input} inbuf)
  # We write [{] instead of { to avoid pattern like ${..} that cmake tries to
  # expand.
  string(REGEX MATCHALL "\\$[{]([^}]+)}" varlist ${inbuf})
  # Removes $, { and } from the variables list.
  set(tmpvarlist "")
  foreach(i ${varlist})
    string(REGEX REPLACE "[$}{]" "" tmp ${i})
    list(APPEND tmpvarlist ${tmp})
  endforeach(i)
  set(varlist ${tmpvarlist})
  set(tmpvarlist)
  list(REMOVE_DUPLICATES varlist)
  # Save and escape variables.
  foreach(i ${varlist})
    set(__configure_textinfo_copy__${i} ${${i}})
    string(REGEX REPLACE "@" "@@" tmp "${${i}}")
    set(${i} ${tmp})
{'fraction_non_alphanumeric': 0.16243386243386243, 'fraction_numerical': 0.0005291005291005291, 'mean_word_length': 4.282122905027933, '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': '3622781', 'n_tokens_mistral': 651, 'n_tokens_neox': 633, 'n_words': 194}