Skip to content

Commit

Permalink
docs(ast): correct doc comment for StringLiteral (#7255)
Browse files Browse the repository at this point in the history
Correct doc comment for `StringLiteral`'s `value` field. The doc comment was wrong.
  • Loading branch information
overlookmotel authored and Dunqing committed Nov 17, 2024
1 parent 6b8b96b commit 80395e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion crates/oxc_ast/src/ast/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ pub enum RegExpPattern<'a> {
pub struct StringLiteral<'a> {
/// Node location in source code
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>,
}

Expand Down
20 changes: 10 additions & 10 deletions crates/oxc_ast/src/generated/ast_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn string_literal<A>(self, span: Span, value: A) -> StringLiteral<'a>
where
Expand All @@ -211,7 +211,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn alloc_string_literal<A>(self, span: Span, value: A) -> Box<'a, StringLiteral<'a>>
where
Expand Down Expand Up @@ -467,7 +467,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn expression_string_literal<A>(self, span: Span, value: A) -> Expression<'a>
where
Expand Down Expand Up @@ -7165,7 +7165,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn import_attribute_key_string_literal<A>(
self,
Expand Down Expand Up @@ -7552,7 +7552,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn module_export_name_string_literal<A>(self, span: Span, value: A) -> ModuleExportName<'a>
where
Expand Down Expand Up @@ -7766,7 +7766,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn ts_enum_member_name_string_literal<A>(self, span: Span, value: A) -> TSEnumMemberName<'a>
where
Expand Down Expand Up @@ -7929,7 +7929,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn ts_literal_string_literal<A>(self, span: Span, value: A) -> TSLiteral<'a>
where
Expand Down Expand Up @@ -10979,7 +10979,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn ts_module_declaration_name_string_literal<A>(
self,
Expand Down Expand Up @@ -11377,7 +11377,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn ts_import_attribute_name_string_literal<A>(
self,
Expand Down Expand Up @@ -12771,7 +12771,7 @@ impl<'a> AstBuilder<'a> {
///
/// ## Parameters
/// - span: Node location in source code
/// - value: The string as it appears in source code
/// - value: The value of the string.
#[inline]
pub fn jsx_attribute_value_string_literal<A>(
self,
Expand Down

0 comments on commit 80395e0

Please sign in to comment.