pub enum Literal {
Number(LuauNumber),
String(LuauString),
Boolean(bool),
}Expand description
A Luau literal value
Variants§
Implementations§
Source§impl Literal
impl Literal
Sourcepub fn parse_number(lexer: &mut Lexer) -> Option<Literal>
pub fn parse_number(lexer: &mut Lexer) -> Option<Literal>
Parses a Literal::Number.
Sourcepub fn parse_string(lexer: &mut Lexer) -> Option<Literal>
pub fn parse_string(lexer: &mut Lexer) -> Option<Literal>
Parses a Literal::String.
Trait Implementations§
Source§impl From<LuauNumber> for Literal
impl From<LuauNumber> for Literal
Source§fn from(value: LuauNumber) -> Literal
fn from(value: LuauNumber) -> Literal
Converts to this type from the input type.
Source§impl From<LuauString> for Literal
impl From<LuauString> for Literal
Source§fn from(value: LuauString) -> Literal
fn from(value: LuauString) -> Literal
Converts to this type from the input type.
Source§impl Lexable for Literal
impl Lexable for Literal
Source§fn try_lex(_: &mut Lexer) -> Option<Literal>
fn try_lex(_: &mut Lexer) -> Option<Literal>
This just marks literals as lexable, refrain from using it. Use
Literal::parse_number, or Literal::parse_string, or the more
specific LuauString::try_lex, and LuauNumber::try_lex instead.
Source§impl Ord for Literal
impl Ord for Literal
Source§impl PartialOrd for Literal
impl PartialOrd for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more