Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/ast/comment.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![warn(missing_docs)]
use oxc_allocator::CloneIn;
use oxc_ast_macros::ast;
use oxc_span::{cmp::ContentEq, hash::ContentHash, Span};
use oxc_span::{cmp::ContentEq, Span};

/// Indicates a line or block comment.
#[ast]
#[generate_derive(CloneIn, ContentEq, ContentHash)]
#[generate_derive(CloneIn, ContentEq)]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
pub enum CommentKind {
/// Line comment
Expand All @@ -17,7 +17,7 @@ pub enum CommentKind {

/// Information about a comment's position relative to a token.
#[ast]
#[generate_derive(CloneIn, ContentEq, ContentHash)]
#[generate_derive(CloneIn, ContentEq)]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
pub enum CommentPosition {
/// Comments prior to a token until another token or trailing comment.
Expand All @@ -40,7 +40,7 @@ pub enum CommentPosition {

/// A comment in source code.
#[ast]
#[generate_derive(CloneIn, ContentEq, ContentHash)]
#[generate_derive(CloneIn, ContentEq)]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
pub struct Comment {
/// The span of the comment text, with leading and trailing delimiters.
Expand Down
256 changes: 128 additions & 128 deletions crates/oxc_ast/src/ast/js.rs

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions crates/oxc_ast/src/ast/jsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use oxc_allocator::{Box, CloneIn, GetAddress, Vec};
use oxc_ast_macros::ast;
use oxc_estree::ESTree;
use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, Span};
use oxc_span::{cmp::ContentEq, Atom, GetSpan, GetSpanMut, Span};

use super::{inherit_variants, js::*, literal::*, ts::*};

Expand All @@ -32,7 +32,7 @@ use super::{inherit_variants, js::*, literal::*, ts::*};
/// See: [JSX Syntax](https://facebook.github.io/jsx/)
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXElement<'a> {
/// Node location in source code
pub span: Span,
Expand Down Expand Up @@ -61,7 +61,7 @@ pub struct JSXElement<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXOpeningElement<'a> {
/// Node location in source code
pub span: Span,
Expand Down Expand Up @@ -95,7 +95,7 @@ pub struct JSXOpeningElement<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXClosingElement<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -113,7 +113,7 @@ pub struct JSXClosingElement<'a> {
/// See: [`React.Fragment`](https://react.dev/reference/react/Fragment)
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXFragment<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -128,7 +128,7 @@ pub struct JSXFragment<'a> {
/// JSX Opening Fragment (`<>`)
#[ast]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXOpeningFragment {
/// Node location in source code
pub span: Span,
Expand All @@ -137,7 +137,7 @@ pub struct JSXOpeningFragment {
/// JSX Closing Fragment (`</>`)
#[ast]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXClosingFragment {
/// Node location in source code
pub span: Span,
Expand All @@ -146,7 +146,7 @@ pub struct JSXClosingFragment {
/// JSX Element Name
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq)]
pub enum JSXElementName<'a> {
/// `<div />`
Identifier(Box<'a, JSXIdentifier<'a>>) = 0,
Expand All @@ -169,7 +169,7 @@ pub enum JSXElementName<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXNamespacedName<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -196,7 +196,7 @@ pub struct JSXNamespacedName<'a> {
/// [`member expression`]: JSXMemberExpressionObject::MemberExpression
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXMemberExpression<'a> {
/// Node location in source code
pub span: Span,
Expand Down Expand Up @@ -224,7 +224,7 @@ pub struct JSXMemberExpression<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq)]
pub enum JSXMemberExpressionObject<'a> {
/// `<Apple.Orange />`
IdentifierReference(Box<'a, IdentifierReference<'a>>) = 0,
Expand All @@ -249,7 +249,7 @@ pub enum JSXMemberExpressionObject<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXExpressionContainer<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -266,7 +266,7 @@ inherit_variants! {
/// [`ast` module docs]: `super`
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub enum JSXExpression<'a> {
/// An empty expression
///
Expand All @@ -284,7 +284,7 @@ pub enum JSXExpression<'a> {
/// An empty JSX expression (`{}`)
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXEmptyExpression {
/// Node location in source code
pub span: Span,
Expand All @@ -303,7 +303,7 @@ pub struct JSXEmptyExpression {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)]
pub enum JSXAttributeItem<'a> {
/// A `key="value"` attribute
Attribute(Box<'a, JSXAttribute<'a>>) = 0,
Expand All @@ -324,7 +324,7 @@ pub enum JSXAttributeItem<'a> {
/// // name ^^^ ^^^^ value
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXAttribute<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -345,7 +345,7 @@ pub struct JSXAttribute<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXSpreadAttribute<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -370,7 +370,7 @@ pub struct JSXSpreadAttribute<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)]
pub enum JSXAttributeName<'a> {
/// An attribute name without a namespace prefix, e.g. `foo` in `foo="bar"`.
Identifier(Box<'a, JSXIdentifier<'a>>) = 0,
Expand Down Expand Up @@ -398,7 +398,7 @@ pub enum JSXAttributeName<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)]
pub enum JSXAttributeValue<'a> {
/// `<Component foo="bar" />`
StringLiteral(Box<'a, StringLiteral<'a>>) = 0,
Expand All @@ -417,7 +417,7 @@ pub enum JSXAttributeValue<'a> {
/// [`IdentifierName`]: super::IdentifierName
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXIdentifier<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -432,7 +432,7 @@ pub struct JSXIdentifier<'a> {
/// Part of a [`JSXElement`].
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, GetAddress, ContentEq, ESTree)]
pub enum JSXChild<'a> {
/// `<Foo>Some Text</Foo>`
Text(Box<'a, JSXText<'a>>) = 0,
Expand All @@ -451,7 +451,7 @@ pub enum JSXChild<'a> {
/// Variant of [`JSXChild`] that represents an object spread (`{...expression}`).
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXSpreadChild<'a> {
/// Node location in source code
pub span: Span,
Expand All @@ -471,7 +471,7 @@ pub struct JSXSpreadChild<'a> {
/// ```
#[ast(visit)]
#[derive(Debug)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct JSXText<'a> {
/// Node location in source code
pub span: Span,
Expand Down
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/ast/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use oxc_allocator::{Box, CloneIn};
use oxc_ast_macros::ast;
use oxc_estree::ESTree;
use oxc_regular_expression::ast::Pattern;
use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, GetSpan, GetSpanMut, Span};
use oxc_span::{cmp::ContentEq, Atom, GetSpan, GetSpanMut, Span};
use oxc_syntax::number::{BigintBase, NumberBase};

/// Boolean literal
///
/// <https://tc39.es/ecma262/#prod-BooleanLiteral>
#[ast(visit)]
#[derive(Debug, Clone)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(type = "Literal", via = crate::serialize::ESTreeLiteral, add_ts = "raw: string | null")]
pub struct BooleanLiteral {
/// Node location in source code
Expand All @@ -33,7 +33,7 @@ pub struct BooleanLiteral {
/// <https://tc39.es/ecma262/#sec-null-literals>
#[ast(visit)]
#[derive(Debug, Clone)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(type = "Literal", via = crate::serialize::ESTreeLiteral, add_ts = "value: null, raw: \"null\" | null")]
pub struct NullLiteral {
/// Node location in source code
Expand Down Expand Up @@ -127,7 +127,7 @@ pub struct RegExpLiteral<'a> {
/// <https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects>
#[ast]
#[derive(Debug)]
#[generate_derive(CloneIn, ContentEq, ContentHash, ESTree)]
#[generate_derive(CloneIn, ContentEq, ESTree)]
#[estree(no_type)]
pub struct RegExp<'a> {
/// The regex pattern between the slashes
Expand Down
Loading
Loading