Skip to content

Commit

Permalink
Merge pull request #50 from yannick-was-taken/master
Browse files Browse the repository at this point in the history
ast: make some simple data types `Copy`
  • Loading branch information
vickenty authored Jul 4, 2024
2 parents 58e4ccf + b24597a commit 1ad5db9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct Integer {
/// Base of the integer literal
///
/// (C11 6.4.4.1)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum IntegerBase {
Decimal,
Octal,
Expand All @@ -70,7 +70,7 @@ pub enum IntegerBase {
/// Suffix of an integer literal
///
/// (C11 6.4.4.1)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct IntegerSuffix {
/// Minimum size of the integer literal
pub size: IntegerSize,
Expand Down Expand Up @@ -108,7 +108,7 @@ pub struct Float {
/// Floating point number base
///
/// (C11 6.4.4.2)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum FloatBase {
Decimal,
Hexadecimal,
Expand All @@ -117,7 +117,7 @@ pub enum FloatBase {
/// Floating point number suffix
///
/// (C11 6.4.4.2)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct FloatSuffix {
pub format: FloatFormat,
/// Integer literal is an imaginary part of a complex number
Expand All @@ -129,7 +129,7 @@ pub struct FloatSuffix {
/// Floating point literal format specified by the suffix
///
/// (C11 6.4.4.2)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum FloatFormat {
/// `f` suffix
Float,
Expand Down Expand Up @@ -268,7 +268,7 @@ pub enum Expression {
}

/// Struct or union member access
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum MemberOperator {
/// `expression.identifier`
Direct,
Expand Down Expand Up @@ -354,7 +354,7 @@ pub struct AlignOf(pub Box<Node<TypeName>>);
/// All operators with one operand
///
/// (C11 6.5)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum UnaryOperator {
/// `operand++`
PostIncrement,
Expand Down Expand Up @@ -404,7 +404,7 @@ pub struct CastExpression {
/// All operators with two operands
///
/// (C11 6.5)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum BinaryOperator {
/// `lhs[rhs]`
Index,
Expand Down Expand Up @@ -572,7 +572,7 @@ pub struct InitDeclarator {
/// Storage class
///
/// (C11 6.7.1)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum StorageClassSpecifier {
/// `typedef`
Typedef,
Expand Down Expand Up @@ -652,7 +652,7 @@ pub enum TypeSpecifier {
/// Floating point type with guaranteed width and format
///
/// [ISO/IEC TS 18661-3:2015](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1945.pdf)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub struct TS18661FloatType {
pub format: TS18661FloatFormat,
pub width: usize,
Expand All @@ -661,7 +661,7 @@ pub struct TS18661FloatType {
/// Floating point formats
///
/// [ISO/IEC TS 18661-3:2015](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1945.pdf)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum TS18661FloatFormat {
BinaryInterchange,
BinaryExtended,
Expand All @@ -687,7 +687,7 @@ pub struct StructType {
/// The only difference between a `struct` and a `union`
///
/// (C11 6.7.2.1)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum StructKind {
Struct,
Union,
Expand Down Expand Up @@ -756,7 +756,7 @@ pub struct Enumerator {
/// Type qualifier
///
/// (C11 6.7.3)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum TypeQualifier {
/// `const`
///
Expand Down Expand Up @@ -791,7 +791,7 @@ pub enum TypeQualifier {
/// Function specifier
///
/// (C11 6.7.4)
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum FunctionSpecifier {
/// `inline`
///
Expand Down Expand Up @@ -924,7 +924,7 @@ pub struct ParameterDeclaration {
}

/// Whether function signature ends with a `...`
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum Ellipsis {
Some,
None,
Expand Down

0 comments on commit 1ad5db9

Please sign in to comment.