luau_parser/types/name.rs
1//! The [`Name`] struct
2
3use luau_lexer::prelude::Token;
4use luau_parser_derive::{Print, Range};
5
6use crate::types::{Pointer, TypeValue};
7
8/// A variable name.
9#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Range, Print)]
10#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
11pub struct Name {
12 /// The actual name.
13 pub name: Token,
14
15 /// The optional `:` character.
16 pub colon: Option<Token>,
17
18 /// The type that was with this name, defined with the `: type` syntax.
19 #[range_or = "name"]
20 pub r#type: Option<Pointer<TypeValue>>,
21}