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: Loretta.CodeAnalysis.Lua.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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    FiveM

    The FiveM preset.

    Declaration
    public static readonly LuaSyntaxOptions FiveM
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    GMod

    The GLua preset.

    Declaration
    public static readonly LuaSyntaxOptions GMod
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Lua51

    The Lua 5.1 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua51
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Lua52

    The Lua 5.2 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua52
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Lua53

    The Lua 5.3 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua53
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Lua54

    The Lua 5.4 preset.

    Declaration
    public static readonly LuaSyntaxOptions Lua54
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    LuaJIT20

    The LuaJIT 2.0 preset.

    Declaration
    public static readonly LuaSyntaxOptions LuaJIT20
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    LuaJIT21

    The LuaJIT 2.1-beta3 preset.

    Declaration
    public static readonly LuaSyntaxOptions LuaJIT21
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Luau

    The Luau preset.

    Declaration
    public static readonly LuaSyntaxOptions Luau
    Field Value
    Type Description
    LuaSyntaxOptions
    | Improve this Doc View Source

    Roblox

    The Luau preset.

    Declaration
    public static readonly LuaSyntaxOptions Roblox
    Field Value
    Type Description
    LuaSyntaxOptions

    Properties

    | Improve this Doc View Source

    AcceptBinaryNumbers

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

    Declaration
    public bool AcceptBinaryNumbers { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptBitwiseOperators

    Whether to accept 5.3 bitwise operators.

    Declaration
    public bool AcceptBitwiseOperators { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptCBooleanOperators

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

    Declaration
    public bool AcceptCBooleanOperators { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptCCommentSyntax

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

    Declaration
    public bool AcceptCCommentSyntax { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptCompoundAssignment

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

    Declaration
    public bool AcceptCompoundAssignment { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptEmptyStatements

    Whether to accept empty statements (lone semicolons).

    Declaration
    public bool AcceptEmptyStatements { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptFloorDivision

    Whether to accept floor division or not

    Declaration
    public bool AcceptFloorDivision { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptGoto

    Whether to accept goto labels and statements.

    Declaration
    public bool AcceptGoto { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptHashStrings

    Whether to accept FiveM hash strings.

    Declaration
    public bool AcceptHashStrings { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptHexEscapesInStrings

    Whether to accept hexadecimal escapes in strings.

    Declaration
    public bool AcceptHexEscapesInStrings { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    AcceptIfExpressions

    Whether to accept Luau if expressions.

    Declaration
    public bool AcceptIfExpressions { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    AcceptLocalVariableAttributes

    Whether to accept Lua 5.4 variable attributes.

    Declaration
    public bool AcceptLocalVariableAttributes { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptLuaJITNumberSuffixes

    Whether to accept LuaJIT number suffixes or not

    Declaration
    public bool AcceptLuaJITNumberSuffixes { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    AcceptOctalNumbers

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

    Declaration
    public bool AcceptOctalNumbers { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptShebang

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

    Declaration
    public bool AcceptShebang { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptTypedLua

    Whether to accept typed lua syntax or not

    Declaration
    public bool AcceptTypedLua { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    AcceptUnicodeEscape

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

    Declaration
    public bool AcceptUnicodeEscape { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AcceptWhitespaceEscape

    Whether to accept \z escapes.

    Declaration
    public bool AcceptWhitespaceEscape { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    AllPresets

    All presets that are preconfigured in LuaSyntaxOptions.

    Declaration
    public static ImmutableArray<LuaSyntaxOptions> AllPresets { get; }
    Property Value
    Type Description
    ImmutableArray<LuaSyntaxOptions>
    | Improve this Doc View Source

    BacktickStringType

    Defines how strings with ` delimiters will be parsed.

    Declaration
    public BacktickStringType BacktickStringType { get; }
    Property Value
    Type Description
    BacktickStringType
    | Improve this Doc View Source

    BinaryIntegerFormat

    Format binary numeric literals are stored as.

    Declaration
    public IntegerFormats BinaryIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats
    | Improve this Doc View Source

    ContinueType

    The type of continue to be recognized by the parser.

    Declaration
    public ContinueType ContinueType { get; }
    Property Value
    Type Description
    ContinueType
    | Improve this Doc View Source

    DecimalIntegerFormat

    Format decimal integer literals are stored as.

    Declaration
    public IntegerFormats DecimalIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats
    | Improve this Doc View Source

    HexIntegerFormat

    Format hexadecimal integer literals are stored as.

    Declaration
    public IntegerFormats HexIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats
    | Improve this Doc View Source

    OctalIntegerFormat

    Format octal numeric literals are stored as.

    Declaration
    public IntegerFormats OctalIntegerFormat { get; }
    Property Value
    Type Description
    IntegerFormats
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    Equals(LuaSyntaxOptions)

    Declaration
    public bool Equals(LuaSyntaxOptions other)
    Parameters
    Type Name Description
    LuaSyntaxOptions other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾