<commit_before>// Copyright (c) 2018 <NAME>
// 
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

namespace Farkle.Grammar.GOLDParser

/// What can go wrong with reading an EGT file.
[<Struct>]
type EGTReadError =
    /// The grammar file is not recognized.
    | InvalidEGTFile
    /// You have tried to read a CGT file instead of an EGT file.
    /// The former is _not_ supported.
    | ReadACGTFile
    with
        override x.ToString() =
            match x with
            | InvalidEGTFile -> "The given grammar file is not recognized."
            | ReadACGTFile ->
                "The given file is a CGT file, not an EGT one."
                + " You should update to the latest version of GOLD Parser Builder (at least over Version 5.0.0)"
                + " and save the tables as \"Enhanced Grammar tables (Version 5.0)\"."

/// An entry of an EGT file.
type internal Entry =
    /// [omit]
    | Empty
    /// [omit]
    | Byte of byte
    /// [omit]
    | Boolean of bool
    /// [omit]
    | UInt16 of uint16
    /// [omit]
    | String of string<commit_msg>Make EGT entries structs.<commit_after>// Copyright (c) 2018 <NAME>
// 
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

namespace Farkle.Grammar.GOLDParser

/// What can go wrong with reading an EGT file.
[<Struct>]
type EGTReadError =
    /// The grammar file is not recognized.
    | InvalidEGTFile
    /// You have tried to read a CGT file instead of an EGT file.
    /// The former is _not_ supported.
    | ReadACGTFile
    with
        override x.ToString() =
            match x with
            | InvalidEGTFile -> "The given grammar file is not recognized."
            | ReadACGTFile ->
                "The given file is a CGT file, not an EGT one."
                + " You should update to the latest version of GOLD Parser Builder (at least over Version 5.0.0)"
                + " and save the tables as \"Enhanced Grammar tables (Version 5.0)\"."

/// An entry of an EGT file.
[<Struct>]
type internal Entry =
    /// [omit]
    | Empty
    /// [omit]
    | Byte of byteValue: byte
    /// [omit]
    | Boolean of boolValue: bool
    /// [omit]
    | UInt16 of intValue: uint16
    /// [omit]
    | String of stringValue: string
{'fraction_non_alphanumeric': 0.10537727666955768, 'fraction_numerical': 0.011274934952298352, 'mean_word_length': 1.9576923076923076, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, 'https://': 2, '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': '7125389', 'n_tokens_mistral': 713, 'n_tokens_neox': 672, 'n_words': 273}