docs(ast): correct doc comment for StringLiteral (#7255)

Correct doc comment for `StringLiteral`'s `value` field. The doc comment was wrong.
This commit is contained in:
overlookmotel 2024-11-12 13:47:16 +00:00
parent ef847dab9c
commit 740ba4bcbd
2 changed files with 13 additions and 11 deletions

View file

@ -137,7 +137,9 @@ pub enum RegExpPattern<'a> {
pub struct StringLiteral<'a> { pub struct StringLiteral<'a> {
/// Node location in source code /// Node location in source code
pub span: Span, pub span: Span,
/// The string as it appears in source code /// The value of the string.
///
/// Any escape sequences in the raw code are unescaped.
pub value: Atom<'a>, pub value: Atom<'a>,
} }

View file

@ -196,7 +196,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn string_literal<A>(self, span: Span, value: A) -> StringLiteral<'a> pub fn string_literal<A>(self, span: Span, value: A) -> StringLiteral<'a>
where where
@ -211,7 +211,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn alloc_string_literal<A>(self, span: Span, value: A) -> Box<'a, StringLiteral<'a>> pub fn alloc_string_literal<A>(self, span: Span, value: A) -> Box<'a, StringLiteral<'a>>
where where
@ -467,7 +467,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn expression_string_literal<A>(self, span: Span, value: A) -> Expression<'a> pub fn expression_string_literal<A>(self, span: Span, value: A) -> Expression<'a>
where where
@ -7165,7 +7165,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn import_attribute_key_string_literal<A>( pub fn import_attribute_key_string_literal<A>(
self, self,
@ -7552,7 +7552,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn module_export_name_string_literal<A>(self, span: Span, value: A) -> ModuleExportName<'a> pub fn module_export_name_string_literal<A>(self, span: Span, value: A) -> ModuleExportName<'a>
where where
@ -7766,7 +7766,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn ts_enum_member_name_string_literal<A>(self, span: Span, value: A) -> TSEnumMemberName<'a> pub fn ts_enum_member_name_string_literal<A>(self, span: Span, value: A) -> TSEnumMemberName<'a>
where where
@ -7929,7 +7929,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn ts_literal_string_literal<A>(self, span: Span, value: A) -> TSLiteral<'a> pub fn ts_literal_string_literal<A>(self, span: Span, value: A) -> TSLiteral<'a>
where where
@ -10979,7 +10979,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn ts_module_declaration_name_string_literal<A>( pub fn ts_module_declaration_name_string_literal<A>(
self, self,
@ -11377,7 +11377,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn ts_import_attribute_name_string_literal<A>( pub fn ts_import_attribute_name_string_literal<A>(
self, self,
@ -12771,7 +12771,7 @@ impl<'a> AstBuilder<'a> {
/// ///
/// ## Parameters /// ## Parameters
/// - span: Node location in source code /// - span: Node location in source code
/// - value: The string as it appears in source code /// - value: The value of the string.
#[inline] #[inline]
pub fn jsx_attribute_value_string_literal<A>( pub fn jsx_attribute_value_string_literal<A>(
self, self,