Search Results for

    Show / Hide Table of Contents

    Class LuaSyntaxOptions

    The options used by Loretta to adapt to the syntax of the lua flavor being parsed.

    Inheritance
    System.Object
    LuaSyntaxOptions
    Namespace: Loretta.CodeAnalysis.Lua
    Assembly: cs.temp.dll.dll
    Syntax
    public class LuaSyntaxOptions : IEquatable<LuaSyntaxOptions>
    Remarks

    Otherwise when noted, "Accept" in this class means not generating an error when parsing, but the syntax behind the option will still be parsed normally.

    Constructors

    LuaSyntaxOptions(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, ContinueType, Boolean, Boolean, Boolean, IntegerFormats, IntegerFormats, IntegerFormats, IntegerFormats, Boolean, Boolean, Boolean, Boolean, BacktickStringType)

    Initializes a new lua options set.

    Declaration
    public LuaSyntaxOptions(bool acceptBinaryNumbers, bool acceptCCommentSyntax, bool acceptCompoundAssignment, bool acceptEmptyStatements, bool acceptCBooleanOperators, bool acceptGoto, bool acceptHexEscapesInStrings, bool acceptHexFloatLiterals, bool acceptOctalNumbers, bool acceptShebang, bool acceptUnderscoreInNumberLiterals, bool useLuaJitIdentifierRules, bool acceptBitwiseOperators, bool acceptWhitespaceEscape, bool acceptUnicodeEscape, ContinueType continueType, bool acceptIfExpression, bool acceptInvalidEscapes, bool acceptLocalVariableAttributes, IntegerFormats binaryIntegerFormat, IntegerFormats octalIntegerFormat, IntegerFormats decimalIntegerFormat, IntegerFormats hexIntegerFormat, bool acceptTypedLua, bool acceptFloorDivision, bool acceptLuaJITNumberSuffixes, bool acceptNestingOfLongStrings, BacktickStringType backtickStringType)
    Parameters
    Type Name Description
    System.Boolean acceptBinaryNumbers

    System.Boolean acceptCCommentSyntax

    System.Boolean acceptCompoundAssignment

    System.Boolean acceptEmptyStatements

    System.Boolean acceptCBooleanOperators

    System.Boolean acceptGoto

    System.Boolean acceptHexEscapesInStrings

    System.Boolean acceptHexFloatLiterals

    System.Boolean acceptOctalNumbers

    System.Boolean acceptShebang

    System.Boolean acceptUnderscoreInNumberLiterals

    System.Boolean useLuaJitIdentifierRules

    System.Boolean acceptBitwiseOperators

    System.Boolean acceptWhitespaceEscape

    System.Boolean acceptUnicodeEscape

    ContinueType continueType

    System.Boolean acceptIfExpression

    System.Boolean acceptInvalidEscapes

    System.Boolean acceptLocalVariableAttributes

    IntegerFormats binaryIntegerFormat

    IntegerFormats octalIntegerFormat

    IntegerFormats decimalIntegerFormat

    IntegerFormats hexIntegerFormat

    System.Boolean acceptTypedLua

    System.Boolean acceptFloorDivision

    System.Boolean acceptLuaJITNumberSuffixes

    System.Boolean acceptNestingOfLongStrings

    BacktickStringType backtickStringType

    Fields

    All

    The preset that sets everything to true, continue to ContextualKeyword, integer options to NotSupported, BacktickStringType to InterpolatedStringLiteral.

    Declaration
    public static readonly LuaSyntaxOptions All
    Field Value
    Type Description
    LuaSyntaxOptions

    AllWithIntegers

    Same as All but with integer settings set to Int64, AcceptFloorDivision set to true and AcceptCCommentSyntax set to false.

    Declaration
    public static readonly LuaSyntaxOptions AllWithIntegers
    Field Value
    Type Description
    LuaSyntaxOptions

    FiveM

    The FiveM preset.

    Declaration
    public static readonly LuaSyntaxOptions FiveM
    Field Value
    Type Description
    LuaSyntaxOptions

    GMod

    The GLua preset.

    Declaration
    public static readonly LuaSyntaxOptions GMod
    Field Value
    Type Description
    LuaSyntaxOptions

    Lua51

    The Lua 5.1 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua51
    Field Value
    Type Description
    LuaSyntaxOptions

    Lua52

    The Lua 5.2 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua52
    Field Value
    Type Description
    LuaSyntaxOptions

    Lua53

    The Lua 5.3 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua53
    Field Value
    Type Description
    LuaSyntaxOptions

    Lua54

    The Lua 5.4 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua54
    Field Value
    Type Description
    LuaSyntaxOptions

    LuaJIT20

    The LuaJIT 2.0 preset.

    Declaration
    public static readonly LuaSyntaxOptions LuaJIT20
    Field Value
    Type Description
    LuaSyntaxOptions

    LuaJIT21

    The LuaJIT 2.1-beta3 preset.

    Declaration
    public static readonly LuaSyntaxOptions LuaJIT21
    Field Value
    Type Description
    LuaSyntaxOptions

    Luau

    The Luau preset.

    Declaration
    public static readonly LuaSyntaxOptions Luau
    Field Value
    Type Description
    LuaSyntaxOptions

    Roblox

    The Luau preset.

    Declaration
    public static readonly LuaSyntaxOptions Roblox
    Field Value
    Type Description
    LuaSyntaxOptions

    Properties

    AcceptBinaryNumbers

    Whether to accept binary numbers (format: /0b[10]+/).

    Declaration
    public bool AcceptBinaryNumbers { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptBitwiseOperators

    Whether to accept 5.3 bitwise operators.

    Declaration
    public bool AcceptBitwiseOperators { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptCBooleanOperators

    Whether to accept C boolean operators (&&, ||, != and !).

    Declaration
    public bool AcceptCBooleanOperators { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptCCommentSyntax

    Whether to accept C comment syntax (formats: "//..." and "/* ... */").

    Declaration
    public bool AcceptCCommentSyntax { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptCompoundAssignment

    Whether to accept compound assignment syntax (format: <expr> ("+=" | "-=" | "*=" | "/=" | "^=" | "%=" | "..=") <expr>).

    Declaration
    public bool AcceptCompoundAssignment { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptEmptyStatements

    Whether to accept empty statements (lone semicolons).

    Declaration
    public bool AcceptEmptyStatements { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptFloorDivision

    Whether to accept floor division or not

    Declaration
    public bool AcceptFloorDivision { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptGoto

    Whether to accept goto labels and statements.

    Declaration
    public bool AcceptGoto { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptHashStrings

    Whether to accept FiveM hash strings.

    Declaration
    public bool AcceptHashStrings { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptHexEscapesInStrings

    Whether to accept hexadecimal escapes in strings.

    Declaration
    public bool AcceptHexEscapesInStrings { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptHexFloatLiterals

    Whether to accept hexadecimal floating point literals (format: /0x[a-fA-F0-9]+(.[a-fA-F0-9])?([+-]?p[0-9]+)/).

    Declaration
    public bool AcceptHexFloatLiterals { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptIfExpressions

    Whether to accept Luau if expressions.

    Declaration
    public bool AcceptIfExpressions { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptInvalidEscapes

    Whether to support the Lua 5.1 lexer bug where invalid escapes in strings are read as the character in the escape.

    NO ERROR WILL BE EMITTED IF AN INVALID ESCAPE IS ENCOUNTERED IF THIS IS true.

    Declaration
    public bool AcceptInvalidEscapes { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptLocalVariableAttributes

    Whether to accept Lua 5.4 variable attributes.

    Declaration
    public bool AcceptLocalVariableAttributes { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptLuaJITNumberSuffixes

    Whether to accept LuaJIT number suffixes or not

    Declaration
    public bool AcceptLuaJITNumberSuffixes { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptNestingOfLongStrings

    Whether to accept nesting of [[...]]

    AN ERROR WILL BE GENERATED FOR NESTED LONG STRINGS IF THIS IS false.

    Declaration
    public bool AcceptNestingOfLongStrings { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptOctalNumbers

    Whether to accept octal numbers (format: /0o[0-7]+/).

    Declaration
    public bool AcceptOctalNumbers { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptShebang

    Whether to accept shebangs (format: "#!...").

    Declaration
    public bool AcceptShebang { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptTypedLua

    Whether to accept typed lua syntax or not

    Declaration
    public bool AcceptTypedLua { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptUnderscoreInNumberLiterals

    Whether to accept underscores in any number literals (will be ignored when parsing the number).

    Declaration
    public bool AcceptUnderscoreInNumberLiterals { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptUnicodeEscape

    Whether to accept Unicode (\u{XXX}) escapes.

    Declaration
    public bool AcceptUnicodeEscape { get; }
    Property Value
    Type Description
    System.Boolean

    AcceptWhitespaceEscape

    Whether to accept \z escapes.

    Declaration
    public bool AcceptWhitespaceEscape { get; }
    Property Value
    Type Description
    System.Boolean

    AllPresets

    All presets that are preconfigured in LuaSyntaxOptions.

    Declaration
    public static ImmutableArray<LuaSyntaxOptions> AllPresets { get; }
    Property Value
    Type Description
    ImmutableArray<LuaSyntaxOptions>

    BacktickStringType

    Defines how strings with ` delimiters will be parsed.

    Declaration
    public BacktickStringType BacktickStringType { get; }
    Property Value
    Type Description
    BacktickStringType

    BinaryIntegerFormat

    Format binary numeric literals are stored as.

    Declaration
    public IntegerFormats BinaryIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats

    ContinueType

    The type of continue to be recognized by the parser.

    Declaration
    public ContinueType ContinueType { get; }
    Property Value
    Type Description
    ContinueType

    DecimalIntegerFormat

    Format decimal integer literals are stored as.

    Declaration
    public IntegerFormats DecimalIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats

    HexIntegerFormat

    Format hexadecimal integer literals are stored as.

    Declaration
    public IntegerFormats HexIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats

    OctalIntegerFormat

    Format octal numeric literals are stored as.

    Declaration
    public IntegerFormats OctalIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats

    UseLuaJitIdentifierRules

    Whether to use LuaJIT's identifier character rules (accepts any character greater than or equal to 0xF7).

    Declaration
    public bool UseLuaJitIdentifierRules { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Equals(LuaSyntaxOptions)

    Declaration
    public bool Equals(LuaSyntaxOptions other)
    Parameters
    Type Name Description
    LuaSyntaxOptions other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    With(Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<ContinueType>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<IntegerFormats>, Option<IntegerFormats>, Option<IntegerFormats>, Option<IntegerFormats>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<Boolean>, Option<BacktickStringType>)

    Creates a new lua options changing the provided fields.

    Declaration
    public LuaSyntaxOptions With(Option<bool> acceptBinaryNumbers = null, Option<bool> acceptCCommentSyntax = null, Option<bool> acceptCompoundAssignment = null, Option<bool> acceptEmptyStatements = null, Option<bool> acceptCBooleanOperators = null, Option<bool> acceptGoto = null, Option<bool> acceptHexEscapesInStrings = null, Option<bool> acceptHexFloatLiterals = null, Option<bool> acceptOctalNumbers = null, Option<bool> acceptShebang = null, Option<bool> acceptUnderscoreInNumberLiterals = null, Option<bool> useLuaJitIdentifierRules = null, Option<bool> acceptBitwiseOperators = null, Option<bool> acceptWhitespaceEscape = null, Option<bool> acceptUnicodeEscape = null, Option<ContinueType> continueType = null, Option<bool> acceptIfExpression = null, Option<bool> acceptInvalidEscapes = null, Option<bool> acceptLocalVariableAttributes = null, Option<IntegerFormats> binaryIntegerFormat = null, Option<IntegerFormats> octalIntegerFormat = null, Option<IntegerFormats> decimalIntegerFormat = null, Option<IntegerFormats> hexIntegerFormat = null, Option<bool> acceptTypedLua = null, Option<bool> acceptFloorDivision = null, Option<bool> acceptLuaJITNumberSuffixes = null, Option<bool> acceptNestingOfLongStrings = null, Option<BacktickStringType> backtickStringType = null)
    Parameters
    Type Name Description
    Option<System.Boolean> acceptBinaryNumbers

    If None uses the value of AcceptBinaryNumbers.

    Option<System.Boolean> acceptCCommentSyntax

    If None uses the value of AcceptCCommentSyntax.

    Option<System.Boolean> acceptCompoundAssignment

    If None uses the value of AcceptCompoundAssignment.

    Option<System.Boolean> acceptEmptyStatements

    If None uses the value of AcceptEmptyStatements.

    Option<System.Boolean> acceptCBooleanOperators

    If None uses the value of AcceptCBooleanOperators.

    Option<System.Boolean> acceptGoto

    If None uses the value of AcceptGoto.

    Option<System.Boolean> acceptHexEscapesInStrings

    If None uses the value of AcceptHexEscapesInStrings.

    Option<System.Boolean> acceptHexFloatLiterals

    If None uses the value of AcceptHexFloatLiterals.

    Option<System.Boolean> acceptOctalNumbers

    If None uses the value of AcceptOctalNumbers.

    Option<System.Boolean> acceptShebang

    If None uses the value of AcceptShebang.

    Option<System.Boolean> acceptUnderscoreInNumberLiterals

    If None uses the value of AcceptUnderscoreInNumberLiterals.

    Option<System.Boolean> useLuaJitIdentifierRules

    If None uses the value of UseLuaJitIdentifierRules.

    Option<System.Boolean> acceptBitwiseOperators

    If None uses the value of AcceptBitwiseOperators.

    Option<System.Boolean> acceptWhitespaceEscape

    If None uses the value of AcceptWhitespaceEscape.

    Option<System.Boolean> acceptUnicodeEscape

    If None uses the value of AcceptUnicodeEscape.

    Option<ContinueType> continueType

    If None uses the value of ContinueType.

    Option<System.Boolean> acceptIfExpression

    If None uses the value of AcceptIfExpressions.

    Option<System.Boolean> acceptInvalidEscapes

    If None uses the value of AcceptInvalidEscapes.

    Option<System.Boolean> acceptLocalVariableAttributes

    If None uses the value of AcceptLocalVariableAttributes.

    Option<IntegerFormats> binaryIntegerFormat

    If None uses the value of BinaryIntegerFormat.

    Option<IntegerFormats> octalIntegerFormat

    If None uses the value of OctalIntegerFormat.

    Option<IntegerFormats> decimalIntegerFormat

    If None uses the value of DecimalIntegerFormat.

    Option<IntegerFormats> hexIntegerFormat

    If None uses the value of HexIntegerFormat.

    Option<System.Boolean> acceptTypedLua

    If None uses the value of AcceptTypedLua.

    Option<System.Boolean> acceptFloorDivision

    If None uses the value of AcceptFloorDivision.

    Option<System.Boolean> acceptLuaJITNumberSuffixes

    If None uses the value of AcceptLuaJITNumberSuffixes.

    Option<System.Boolean> acceptNestingOfLongStrings

    If None uses the value of AcceptNestingOfLongStrings.

    Option<BacktickStringType> backtickStringType

    If None uses the value of BacktickStringType.

    Returns
    Type Description
    LuaSyntaxOptions

    Operators

    Equality(LuaSyntaxOptions, LuaSyntaxOptions)

    Checks whether two lua option sets are equal.

    Declaration
    public static bool operator ==(LuaSyntaxOptions left, LuaSyntaxOptions right)
    Parameters
    Type Name Description
    LuaSyntaxOptions left
    LuaSyntaxOptions right
    Returns
    Type Description
    System.Boolean

    Inequality(LuaSyntaxOptions, LuaSyntaxOptions)

    Checks whether two lua option sets are not equal.

    Declaration
    public static bool operator !=(LuaSyntaxOptions left, LuaSyntaxOptions right)
    Parameters
    Type Name Description
    LuaSyntaxOptions left
    LuaSyntaxOptions right
    Returns
    Type Description
    System.Boolean
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾