<commit_before>import Prism from '../../tmp/prism.js'

const CELL = /\b([a-z0-9_]+[!])?([A-Z]{1,3}[1-9][0-9]*)(?:[:]([A-Z]{1,3}[1-9][0-9]*))?\b/
const DEF = /(^|\n)[a-zA-Z_$][a-zA-Z_$0-9]*(?=\s*[=])/
const KEY = /\b[a-zA-Z_$][a-zA-Z_$0-9]*(?=\s*[=:])/
const ID = /\b[a-zA-Z_$][a-zA-Z_$0-9]*\b/

let languages = {}

languages['mini'] = {
  // taken from Prism.languages.clike.string
  'string': {
    pattern: /(["])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
    greedy: true
  },
  'boolean': /\b(?:true|false)\b/,
  'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
}

Prism.languages.insertBefore('r', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['r'] = Prism.languages.r

Prism.languages.insertBefore('python', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['python'] = languages['py'] = Prism.languages.python


Prism.languages.insertBefore('javascript', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['js'] = languages['javascript'] = Prism.languages.javascript

Prism.languages.insertBefore('sql', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})<commit_msg>Language alias for Node.js contexts<commit_after>import Prism from '../../tmp/prism.js'

const CELL = /\b([a-z0-9_]+[!])?([A-Z]{1,3}[1-9][0-9]*)(?:[:]([A-Z]{1,3}[1-9][0-9]*))?\b/
const DEF = /(^|\n)[a-zA-Z_$][a-zA-Z_$0-9]*(?=\s*[=])/
const KEY = /\b[a-zA-Z_$][a-zA-Z_$0-9]*(?=\s*[=:])/
const ID = /\b[a-zA-Z_$][a-zA-Z_$0-9]*\b/

let languages = {}

languages['mini'] = {
  // taken from Prism.languages.clike.string
  'string': {
    pattern: /(["])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
    greedy: true
  },
  'boolean': /\b(?:true|false)\b/,
  'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
}

Prism.languages.insertBefore('r', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['r'] = Prism.languages.r

Prism.languages.insertBefore('python', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['python'] = languages['py'] = Prism.languages.python

Prism.languages.insertBefore('javascript', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
languages['js'] = languages['node'] = languages['javascript'] = Prism.languages.javascript

Prism.languages.insertBefore('sql', 'punctuation', {
  'function': /[a-z0-9_]+(?=\()/i,
  'lparen': /[(]/,
  'rparen': /[)]/,
  'comma': /[,]/,
  'cell': CELL,
  'def': { pattern: DEF, greedy: true },
  'key': { pattern: KEY, greedy: true },
  'id': { pattern: ID, greedy: true }
})
{'fraction_non_alphanumeric': 0.32829574517554055, 'fraction_numerical': 0.015345268542199489, 'mean_word_length': 3.4123076923076923, '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': '1650836', 'n_tokens_mistral': 2020, 'n_tokens_neox': 1961, 'n_words': 319}