<commit_before>/* eslint-disable camelcase */
'use strict';
const compose = require('compose-function');
const utils = require('./utils');

const posixShellLexer = (mode, options) => ({
	lex() {
		const item = this.tokenizer.next();
		// console.log(item)
		const tk = item.value;

		const tkType = Object.keys(tk).filter(k =>
			k !== 'loc' && k !== 'expansion'
		)[0];

		const text = tk[tkType];

		this.yytext = {text};

		if (tk.expansion) {
			this.yytext.expansion = tk.expansion;
		}

		if (tk.originalText) {
			this.yytext.originalText = tk.originalText;
		}

		if (tk.type) {
			this.yytext.type = tk.type;
		}

		if (tk.maybeSimpleCommandName) {
			this.yytext.maybeSimpleCommandName = tk.maybeSimpleCommandName;
		}

		if (tk.joined) {
			this.yytext.joined = tk.joined;
		}

		if (tk.fieldIdx !== undefined) {
			this.yytext.fieldIdx = tk.fieldIdx;
		}

		if (options.insertLOC && tk.loc) {
			this.yytext.loc = tk.loc;
		}

		if (tk.loc) {
			this.yylineno = tk.loc.startLine;
		}

		return tkType;
	},

	setInput(source) {
		const phases = mode.lexerPhases
			.map(phase => phase(options))
			.concat(mode.tokenizer(options, utils));

		const tokenize = compose(...phases);
		this.tokenizer = tokenize(source);
	}
});

module.exports = posixShellLexer;<commit_msg>fix grammar build - 5°<commit_after>/* eslint-disable camelcase */
'use strict';
const compose = require('compose-function');
const utils = require('./utils');

const posixShellLexer = (mode, options) => ({
	lex() {
		const item = this.tokenizer.next();
		// console.log(item)
		const tk = item.value;

		const tkType = Object.keys(tk).filter(k =>
			k !== 'loc' && k !== 'expansion'
		)[0];

		const text = tk[tkType];

		this.yytext = {text};

		if (tk.expansion) {
			this.yytext.expansion = tk.expansion;
		}

		if (tk.originalText) {
			this.yytext.originalText = tk.originalText;
		}

		if (tk.type) {
			this.yytext.type = tk.type;
		}

		if (tk.maybeSimpleCommandName) {
			this.yytext.maybeSimpleCommandName = tk.maybeSimpleCommandName;
		}

		if (tk.joined) {
			this.yytext.joined = tk.joined;
		}

		if (tk.fieldIdx !== undefined) {
			this.yytext.fieldIdx = tk.fieldIdx;
		}

		if (options.insertLOC && tk.loc) {
			this.yytext.loc = tk.loc;
		}

		if (tk.loc) {
			this.yylineno = tk.loc.startLine;
		}

		return tkType;
	},

	setInput(source) {
		const phases = mode.lexerPhases
			.map(phase => phase(options))
			.concat(mode.tokenizer(options, utils));

		const tokenize = compose.apply(null, phases);
		this.tokenizer = tokenize(source);
	}
});

module.exports = posixShellLexer;
{'fraction_non_alphanumeric': 0.1648564778898371, 'fraction_numerical': 0.0011636927851047323, 'mean_word_length': 3.2348111658456484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7417522', 'n_tokens_mistral': 1112, 'n_tokens_neox': 978, 'n_words': 177}