pub enum Literal {
BooleanLiteral(BooleanLiteral),
IntegerLiteral(IntegerLiteral),
HexLiteral(IntegerLiteral),
BinaryLiteral(IntegerLiteral),
FloatLiteral(FloatLiteral),
CharLiteral(CharLiteral),
StringLiteral(StringLiteral),
FunctionCall(Identifier),
Null,
}Variants§
BooleanLiteral(BooleanLiteral)
IntegerLiteral(IntegerLiteral)
HexLiteral(IntegerLiteral)
BinaryLiteral(IntegerLiteral)
FloatLiteral(FloatLiteral)
CharLiteral(CharLiteral)
StringLiteral(StringLiteral)
FunctionCall(Identifier)
Null
Implementations§
Source§impl Literal
impl Literal
Sourcepub fn is_boolean_literal(&self) -> bool
pub fn is_boolean_literal(&self) -> bool
Returns true if this is a Literal::BooleanLiteral, otherwise false
Sourcepub fn as_boolean_literal_mut(&mut self) -> Option<&mut BooleanLiteral>
pub fn as_boolean_literal_mut(&mut self) -> Option<&mut BooleanLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::BooleanLiteral, otherwise None
Sourcepub fn as_boolean_literal(&self) -> Option<&BooleanLiteral>
pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral>
Optionally returns references to the inner fields if this is a Literal::BooleanLiteral, otherwise None
Sourcepub fn into_boolean_literal(self) -> Result<BooleanLiteral, Self>
pub fn into_boolean_literal(self) -> Result<BooleanLiteral, Self>
Returns the inner fields if this is a Literal::BooleanLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_integer_literal(&self) -> bool
pub fn is_integer_literal(&self) -> bool
Returns true if this is a Literal::IntegerLiteral, otherwise false
Sourcepub fn as_integer_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
pub fn as_integer_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::IntegerLiteral, otherwise None
Sourcepub fn as_integer_literal(&self) -> Option<&IntegerLiteral>
pub fn as_integer_literal(&self) -> Option<&IntegerLiteral>
Optionally returns references to the inner fields if this is a Literal::IntegerLiteral, otherwise None
Sourcepub fn into_integer_literal(self) -> Result<IntegerLiteral, Self>
pub fn into_integer_literal(self) -> Result<IntegerLiteral, Self>
Returns the inner fields if this is a Literal::IntegerLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_hex_literal(&self) -> bool
pub fn is_hex_literal(&self) -> bool
Returns true if this is a Literal::HexLiteral, otherwise false
Sourcepub fn as_hex_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
pub fn as_hex_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::HexLiteral, otherwise None
Sourcepub fn as_hex_literal(&self) -> Option<&IntegerLiteral>
pub fn as_hex_literal(&self) -> Option<&IntegerLiteral>
Optionally returns references to the inner fields if this is a Literal::HexLiteral, otherwise None
Sourcepub fn into_hex_literal(self) -> Result<IntegerLiteral, Self>
pub fn into_hex_literal(self) -> Result<IntegerLiteral, Self>
Returns the inner fields if this is a Literal::HexLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_binary_literal(&self) -> bool
pub fn is_binary_literal(&self) -> bool
Returns true if this is a Literal::BinaryLiteral, otherwise false
Sourcepub fn as_binary_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
pub fn as_binary_literal_mut(&mut self) -> Option<&mut IntegerLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::BinaryLiteral, otherwise None
Sourcepub fn as_binary_literal(&self) -> Option<&IntegerLiteral>
pub fn as_binary_literal(&self) -> Option<&IntegerLiteral>
Optionally returns references to the inner fields if this is a Literal::BinaryLiteral, otherwise None
Sourcepub fn into_binary_literal(self) -> Result<IntegerLiteral, Self>
pub fn into_binary_literal(self) -> Result<IntegerLiteral, Self>
Returns the inner fields if this is a Literal::BinaryLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_float_literal(&self) -> bool
pub fn is_float_literal(&self) -> bool
Returns true if this is a Literal::FloatLiteral, otherwise false
Sourcepub fn as_float_literal_mut(&mut self) -> Option<&mut FloatLiteral>
pub fn as_float_literal_mut(&mut self) -> Option<&mut FloatLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::FloatLiteral, otherwise None
Sourcepub fn as_float_literal(&self) -> Option<&FloatLiteral>
pub fn as_float_literal(&self) -> Option<&FloatLiteral>
Optionally returns references to the inner fields if this is a Literal::FloatLiteral, otherwise None
Sourcepub fn into_float_literal(self) -> Result<FloatLiteral, Self>
pub fn into_float_literal(self) -> Result<FloatLiteral, Self>
Returns the inner fields if this is a Literal::FloatLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_char_literal(&self) -> bool
pub fn is_char_literal(&self) -> bool
Returns true if this is a Literal::CharLiteral, otherwise false
Sourcepub fn as_char_literal_mut(&mut self) -> Option<&mut CharLiteral>
pub fn as_char_literal_mut(&mut self) -> Option<&mut CharLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::CharLiteral, otherwise None
Sourcepub fn as_char_literal(&self) -> Option<&CharLiteral>
pub fn as_char_literal(&self) -> Option<&CharLiteral>
Optionally returns references to the inner fields if this is a Literal::CharLiteral, otherwise None
Sourcepub fn into_char_literal(self) -> Result<CharLiteral, Self>
pub fn into_char_literal(self) -> Result<CharLiteral, Self>
Returns the inner fields if this is a Literal::CharLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_string_literal(&self) -> bool
pub fn is_string_literal(&self) -> bool
Returns true if this is a Literal::StringLiteral, otherwise false
Sourcepub fn as_string_literal_mut(&mut self) -> Option<&mut StringLiteral>
pub fn as_string_literal_mut(&mut self) -> Option<&mut StringLiteral>
Optionally returns mutable references to the inner fields if this is a Literal::StringLiteral, otherwise None
Sourcepub fn as_string_literal(&self) -> Option<&StringLiteral>
pub fn as_string_literal(&self) -> Option<&StringLiteral>
Optionally returns references to the inner fields if this is a Literal::StringLiteral, otherwise None
Sourcepub fn into_string_literal(self) -> Result<StringLiteral, Self>
pub fn into_string_literal(self) -> Result<StringLiteral, Self>
Returns the inner fields if this is a Literal::StringLiteral, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_function_call(&self) -> bool
pub fn is_function_call(&self) -> bool
Returns true if this is a Literal::FunctionCall, otherwise false
Sourcepub fn as_function_call_mut(&mut self) -> Option<&mut Identifier>
pub fn as_function_call_mut(&mut self) -> Option<&mut Identifier>
Optionally returns mutable references to the inner fields if this is a Literal::FunctionCall, otherwise None
Sourcepub fn as_function_call(&self) -> Option<&Identifier>
pub fn as_function_call(&self) -> Option<&Identifier>
Optionally returns references to the inner fields if this is a Literal::FunctionCall, otherwise None
Sourcepub fn into_function_call(self) -> Result<Identifier, Self>
pub fn into_function_call(self) -> Result<Identifier, Self>
Returns the inner fields if this is a Literal::FunctionCall, otherwise returns back the enum in the Err case of the result