Class LuaSyntaxOptions
The options used by Loretta to adapt to the syntax of the lua flavor being parsed.
Inheritance
System.Object
LuaSyntaxOptions
Assembly: cs.temp.dll.dll
Syntax
public class LuaSyntaxOptions : IEquatable<LuaSyntaxOptions>
Constructors
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
Declaration
public static readonly LuaSyntaxOptions All
Field Value
AllWithIntegers
Declaration
public static readonly LuaSyntaxOptions AllWithIntegers
Field Value
FiveM
Declaration
public static readonly LuaSyntaxOptions FiveM
Field Value
GMod
Declaration
public static readonly LuaSyntaxOptions GMod
Field Value
Lua51
Declaration
public static readonly LuaSyntaxOptions Lua51
Field Value
Lua52
Declaration
public static readonly LuaSyntaxOptions Lua52
Field Value
Lua53
Declaration
public static readonly LuaSyntaxOptions Lua53
Field Value
Lua54
Declaration
public static readonly LuaSyntaxOptions Lua54
Field Value
LuaJIT20
Declaration
public static readonly LuaSyntaxOptions LuaJIT20
Field Value
LuaJIT21
The LuaJIT 2.1-beta3 preset.
Declaration
public static readonly LuaSyntaxOptions LuaJIT21
Field Value
Luau
Declaration
public static readonly LuaSyntaxOptions Luau
Field Value
Roblox
Declaration
public static readonly LuaSyntaxOptions Roblox
Field Value
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 |
|
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
Declaration
public static ImmutableArray<LuaSyntaxOptions> AllPresets { get; }
Property Value
BacktickStringType
Defines how strings with `
delimiters will be parsed.
Declaration
public BacktickStringType BacktickStringType { get; }
Property Value
Format binary numeric literals are stored as.
Declaration
public IntegerFormats BinaryIntegerFormat { get; }
Property Value
ContinueType
The type of continue to be recognized by the parser.
Declaration
public ContinueType ContinueType { get; }
Property Value
Format decimal integer literals are stored as.
Declaration
public IntegerFormats DecimalIntegerFormat { get; }
Property Value
Format hexadecimal integer literals are stored as.
Declaration
public IntegerFormats HexIntegerFormat { get; }
Property Value
Format octal numeric literals are stored as.
Declaration
public IntegerFormats OctalIntegerFormat { get; }
Property Value
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
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 |
|
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
Returns
Operators
Equality(LuaSyntaxOptions, LuaSyntaxOptions)
Checks whether two lua option sets are equal.
Declaration
public static bool operator ==(LuaSyntaxOptions left, LuaSyntaxOptions right)
Parameters
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
Returns
Type |
Description |
System.Boolean |
|