<commit_before>" Based on @kamichidu code

"
" public api
"
function! dein#toml#syntax() abort
  if has('nvim') && exists(':TSBufDisable')
    TSBufDisable highlight
  endif

  syntax clear

  unlet! b:current_syntax
  runtime! syntax/toml.vim

  unlet! b:current_syntax
  syntax include @tomlVim syntax/vim.vim

  syntax region tomlVim matchgroup=tomlString
        \ start=+\<\w*\s*=\s*'''+
        \ end=+'''+ contains=@tomlVim keepend
  syntax region tomlVim matchgroup=tomlString
        \ start=+\<\w*\s*=\s*"""+
        \ end=+"""+ contains=@tomlVim keepend
endfunction

function! dein#toml#parse(text) abort
  let input = {
  \   'text': a:text,
  \   'p': 0,
  \   'length': strlen(a:text),
  \}
  return s:_parse(input)
endfunction

function! dein#toml#parse_file(filename) abort
  if !filereadable(a:filename)
    throw printf("Text.TOML: No such file `%s'.", a:filename)
  endif

  let text = join(readfile(a:filename), "\n")
  " fileencoding is always utf8
  return dein#toml#parse(iconv(text, 'utf8', &encoding))
endfunction

"
" private api
"
" work around: '[^\r\n]*' doesn't work well in old-vim, but "[^\r\n]*" works well
let s:skip_pattern = '\C^\%(\_s\+\|' . "#[^\r\n]*" . '\)'<commit_msg>Update syntax<commit_after>" Based on @kamichidu code

"
" public api
"
function! dein#toml#syntax() abort
  if has('nvim') && exists(':TSBufDisable')
    TSBufDisable highlight
  endif

  syntax clear

  unlet! b:current_syntax
  runtime! syntax/toml.vim

  unlet! b:current_syntax
  syntax include @tomlVim syntax/vim.vim
  syntax region tomlVim matchgroup=tomlString
        \ start=+\<hook_\w*\s*=\s*'''+
        \ end=+'''+ contains=@tomlVim keepend
  syntax region tomlVim matchgroup=tomlString
        \ start=+\<hook_\w*\s*=\s*"""+
        \ end=+"""+ contains=@tomlVim keepend

  unlet! b:current_syntax
  syntax include @tomlLua syntax/lua.vim
  syntax region tomlLua matchgroup=tomlString
        \ start=+\<lua_\w*\s*=\s*'''+
        \ end=+'''+ contains=@tomlLua keepend
  syntax region tomlLua matchgroup=tomlString
        \ start=+\<lua_\w*\s*=\s*"""+
        \ end=+"""+ contains=@tomlLua keepend
endfunction

function! dein#toml#parse(text) abort
  let input = {
  \   'text': a:text,
  \   'p': 0,
  \   'length': strlen(a:text),
  \}
  return s:_parse(input)
endfunction

function! dein#toml#parse_file(filename) abort
  if !filereadable(a:filename)
    throw printf("Text.TOML: No such file `%s'.", a:filename)
  endif

  let text = join(readfile(a:filename), "\n")
  " fileencoding is always utf8
  return dein#toml#parse(iconv(text, 'utf8', &encoding))
endfunction

"
" private api
"
" work around: '[^\r\n]*' doesn't work well in old-vim, but "[^\r\n]*" works well
let s:skip_pattern = '\C^\%(\_s\+\|' . "#[^\r\n]*" . '\)'
{'fraction_non_alphanumeric': 0.1753176043557169, 'fraction_numerical': 0.002177858439201452, 'mean_word_length': 3.5933333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1964531', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1035, 'n_words': 229}