<commit_before>import * as _ from "lodash";
import Job from "./Job";
import {
    choice, token, executable, decorate, sequence, string, many1,
    optionalContinuation, spacesWithoutSuggestion, many, noisySuggestions, InputMethod, Parser,
} from "./Parser";
import {commandDescriptions} from "./plugins/autocompletion_providers/Executable";
import {description, style, styles} from "./plugins/autocompletion_providers/Suggestions";
import {makeAlias} from "./plugins/autocompletion_providers/Alias";
import {relativeFilePath} from "./plugins/autocompletion_providers/File";
import {compose, mapObject} from "./utils/Common";
import {command} from "./plugins/autocompletion_providers/Command";
import Aliases from "./Aliases";
import {redirect} from "./plugins/autocompletion_providers/Redirect";
import {environmentVariable} from "./plugins/autocompletion_providers/EnvironmentVariable";

export const makeGrammar = (aliases: Dictionary<string>) => {
    const exec = sequence(
        choice(mapObject(commandDescriptions, (key, value) => decorate(string(key), compose(description(value), style(styles.executable))))),
        optionalContinuation(many1(choice([relativeFilePath, environmentVariable])))<commit_msg>[Fix] [Parser] Require a space between path arguments.<commit_after>import * as _ from "lodash";
import Job from "./Job";
import {
    choice, token, executable, decorate, sequence, string, many1,
    optionalContinuation, spacesWithoutSuggestion, many, noisySuggestions, InputMethod, Parser,
} from "./Parser";
import {commandDescriptions} from "./plugins/autocompletion_providers/Executable";
import {description, style, styles} from "./plugins/autocompletion_providers/Suggestions";
import {makeAlias} from "./plugins/autocompletion_providers/Alias";
import {relativeFilePath} from "./plugins/autocompletion_providers/File";
import {compose, mapObject} from "./utils/Common";
import {command} from "./plugins/autocompletion_providers/Command";
import Aliases from "./Aliases";
import {redirect} from "./plugins/autocompletion_providers/Redirect";
import {environmentVariable} from "./plugins/autocompletion_providers/EnvironmentVariable";

export const makeGrammar = (aliases: Dictionary<string>) => {
    const exec = sequence(
        choice(mapObject(commandDescriptions, (key, value) => decorate(string(key), compose(description(value), style(styles.executable))))),
        optionalContinuation(many1(sequence(
            choice([
                relativeFilePath,
                environmentVariable,
            ]),
            spacesWithoutSuggestion
        )))
{'fraction_non_alphanumeric': 0.1231184870706291, 'fraction_numerical': 0.0015438054805094559, 'mean_word_length': 5.5125628140703515, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5862128', 'n_tokens_mistral': 686, 'n_tokens_neox': 665, 'n_words': 167}