Class LuaSyntaxOptions
The options used by Loretta to adapt to the syntax of the lua flavor being parsed.
Inheritance
System.Object
LuaSyntaxOptions
Assembly: Loretta.CodeAnalysis.Lua.dll
Syntax
public class LuaSyntaxOptions : IEquatable<LuaSyntaxOptions>
Constructors
|
Improve this Doc
View Source
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 acceptHashStrings, bool acceptInvalidEscapes, bool acceptLocalVariableAttributes, IntegerFormats binaryIntegerFormat, IntegerFormats octalIntegerFormat, IntegerFormats decimalIntegerFormat, IntegerFormats hexIntegerFormat, bool acceptTypedLua, bool acceptFloorDivision, bool acceptLuaJITNumberSuffixes, bool acceptNestingOfLongStrings)
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 |
acceptHashStrings |
|
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 |
|
Fields
|
Improve this Doc
View Source
All
Declaration
public static readonly LuaSyntaxOptions All
Field Value
|
Improve this Doc
View Source
AllWithIntegers
Declaration
public static readonly LuaSyntaxOptions AllWithIntegers
Field Value
|
Improve this Doc
View Source
FiveM
Declaration
public static readonly LuaSyntaxOptions FiveM
Field Value
|
Improve this Doc
View Source
GMod
Declaration
public static readonly LuaSyntaxOptions GMod
Field Value
|
Improve this Doc
View Source
Lua51
Declaration
public static readonly LuaSyntaxOptions Lua51
Field Value
|
Improve this Doc
View Source
Lua52
Declaration
public static readonly LuaSyntaxOptions Lua52
Field Value
|
Improve this Doc
View Source
Lua53
Declaration
public static readonly LuaSyntaxOptions Lua53
Field Value
|
Improve this Doc
View Source
Lua54
Declaration
public static readonly LuaSyntaxOptions Lua54
Field Value
|
Improve this Doc
View Source
LuaJIT20
Declaration
public static readonly LuaSyntaxOptions LuaJIT20
Field Value
|
Improve this Doc
View Source
LuaJIT21
The LuaJIT 2.1-beta3 preset.
Declaration
public static readonly LuaSyntaxOptions LuaJIT21
Field Value
|
Improve this Doc
View Source
Luau
Declaration
public static readonly LuaSyntaxOptions Luau
Field Value
|
Improve this Doc
View Source
Roblox
Declaration
public static readonly LuaSyntaxOptions Roblox
Field Value
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 bitise 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
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
Declaration
public static ImmutableArray<LuaSyntaxOptions> AllPresets { get; }
Property Value
|
Improve this Doc
View Source
Format binary numeric literals are stored as.
Declaration
public IntegerFormats BinaryIntegerFormat { get; }
Property Value
|
Improve this Doc
View Source
ContinueType
The type of continue to be recognized by the parser.
Declaration
public ContinueType ContinueType { get; }
Property Value
|
Improve this Doc
View Source
Format decimal integer literals are stored as.
Declaration
public IntegerFormats DecimalIntegerFormat { get; }
Property Value
|
Improve this Doc
View Source
Format hexadecimal integer literals are stored as.
Declaration
public IntegerFormats HexIntegerFormat { get; }
Property Value
|
Improve this Doc
View Source
Format octal numeric literals are stored as.
Declaration
public IntegerFormats OctalIntegerFormat { get; }
Property Value
|
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
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
Creates a new lua options changing the provided fields.
Declaration
public LuaSyntaxOptions With(Option<bool> acceptBinaryNumbers = default(Option<bool>), Option<bool> acceptCCommentSyntax = default(Option<bool>), Option<bool> acceptCompoundAssignment = default(Option<bool>), Option<bool> acceptEmptyStatements = default(Option<bool>), Option<bool> acceptCBooleanOperators = default(Option<bool>), Option<bool> acceptGoto = default(Option<bool>), Option<bool> acceptHexEscapesInStrings = default(Option<bool>), Option<bool> acceptHexFloatLiterals = default(Option<bool>), Option<bool> acceptOctalNumbers = default(Option<bool>), Option<bool> acceptShebang = default(Option<bool>), Option<bool> acceptUnderscoreInNumberLiterals = default(Option<bool>), Option<bool> useLuaJitIdentifierRules = default(Option<bool>), Option<bool> acceptBitwiseOperators = default(Option<bool>), Option<bool> acceptWhitespaceEscape = default(Option<bool>), Option<bool> acceptUnicodeEscape = default(Option<bool>), Option<ContinueType> continueType = default(Option<ContinueType>), Option<bool> acceptIfExpression = default(Option<bool>), Option<bool> acceptHashStrings = default(Option<bool>), Option<bool> acceptInvalidEscapes = default(Option<bool>), Option<bool> acceptLocalVariableAttributes = default(Option<bool>), Option<IntegerFormats> binaryIntegerFormat = default(Option<IntegerFormats>), Option<IntegerFormats> octalIntegerFormat = default(Option<IntegerFormats>), Option<IntegerFormats> decimalIntegerFormat = default(Option<IntegerFormats>), Option<IntegerFormats> hexIntegerFormat = default(Option<IntegerFormats>), Option<bool> acceptTypedLua = default(Option<bool>), Option<bool> acceptFloorDivision = default(Option<bool>), Option<bool> acceptLuaJITNumberSuffixes = default(Option<bool>), Option<bool> acceptNestingOfLongStrings = default(Option<bool>))
Parameters
Returns
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
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
Returns
Type |
Description |
System.Boolean |
|