Skip to content

Commit d40af7b

Browse files
No public description
PiperOrigin-RevId: 963035276
1 parent 8deffa5 commit d40af7b

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

maldoca/astgen/type.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Type {
9898
return T::IsTheClassOf(*this);
9999
}
100100

101-
static bool IsTheClassOf(const Type &type) { return true; }
101+
static bool IsTheClassOf(const Type& type) { return true; }
102102

103103
TypeKind kind() const { return kind_; }
104104

@@ -363,7 +363,7 @@ class Type {
363363

364364
class NonListType : public Type {
365365
public:
366-
static bool IsTheClassOf(const Type &type) {
366+
static bool IsTheClassOf(const Type& type) {
367367
return type.kind() == TypeKind::kBuiltin ||
368368
type.kind() == TypeKind::kEnum || type.kind() == TypeKind::kClass ||
369369
type.kind() == TypeKind::kVariant;
@@ -405,12 +405,12 @@ class ListType : public Type {
405405
element_type_(std::move(element_type)),
406406
element_maybe_null_(element_maybe_null) {}
407407

408-
static bool IsTheClassOf(const Type &type) {
408+
static bool IsTheClassOf(const Type& type) {
409409
return type.kind() == TypeKind::kList;
410410
}
411411

412-
const NonListType &element_type() const { return *element_type_; }
413-
NonListType &element_type() { return *element_type_; }
412+
const NonListType& element_type() const { return *element_type_; }
413+
NonListType& element_type() { return *element_type_; }
414414

415415
MaybeNull element_maybe_null() const { return element_maybe_null_; }
416416

@@ -436,7 +436,7 @@ class ListType : public Type {
436436
// Scalar type: non-variant and non-list.
437437
class ScalarType : public NonListType {
438438
public:
439-
static bool IsTheClassOf(const Type &type) {
439+
static bool IsTheClassOf(const Type& type) {
440440
return type.kind() == TypeKind::kBuiltin ||
441441
type.kind() == TypeKind::kEnum || type.kind() == TypeKind::kClass;
442442
}
@@ -458,7 +458,7 @@ class VariantType : public NonListType {
458458
absl::string_view lang_name)
459459
: NonListType(TypeKind::kVariant, lang_name), types_(std::move(types)) {}
460460

461-
static bool IsTheClassOf(const Type &type) {
461+
static bool IsTheClassOf(const Type& type) {
462462
return type.kind() == TypeKind::kVariant;
463463
}
464464

@@ -497,7 +497,7 @@ class BuiltinType : public ScalarType {
497497
: ScalarType(TypeKind::kBuiltin, lang_name),
498498
builtin_kind_(builtin_kind) {}
499499

500-
static bool IsTheClassOf(const Type &type) {
500+
static bool IsTheClassOf(const Type& type) {
501501
return type.kind() == TypeKind::kBuiltin;
502502
}
503503

@@ -521,14 +521,14 @@ class BuiltinType : public ScalarType {
521521
// Represents an enum type defined elsewhere.
522522
class EnumType : public ScalarType {
523523
public:
524-
explicit EnumType(const Symbol &name, absl::string_view lang_name)
524+
explicit EnumType(const Symbol& name, absl::string_view lang_name)
525525
: ScalarType(TypeKind::kEnum, lang_name), name_(name) {}
526526

527-
static bool IsTheClassOf(const Type &type) {
527+
static bool IsTheClassOf(const Type& type) {
528528
return type.kind() == TypeKind::kEnum;
529529
}
530530

531-
const Symbol &name() const { return name_; }
531+
const Symbol& name() const { return name_; }
532532

533533
std::string JsType() const override;
534534

@@ -552,14 +552,14 @@ class EnumType : public ScalarType {
552552
// Represents an AST node type defined elsewhere.
553553
class ClassType : public ScalarType {
554554
public:
555-
explicit ClassType(const Symbol &name, absl::string_view lang_name)
555+
explicit ClassType(const Symbol& name, absl::string_view lang_name)
556556
: ScalarType(TypeKind::kClass, lang_name), name_(name) {}
557557

558-
static bool IsTheClassOf(const Type &type) {
558+
static bool IsTheClassOf(const Type& type) {
559559
return type.kind() == TypeKind::kClass;
560560
}
561561

562-
const Symbol &name() const { return name_; }
562+
const Symbol& name() const { return name_; }
563563

564564
std::string JsType() const override;
565565

@@ -578,13 +578,13 @@ class ClassType : public ScalarType {
578578

579579
private:
580580
Symbol name_;
581-
const NodeDef *absl_nullable node_def_ = nullptr;
581+
const NodeDef* absl_nullable node_def_ = nullptr;
582582

583583
friend class AstDef;
584584
};
585585

586586
// Converts from TypePb to Type.
587-
absl::StatusOr<std::unique_ptr<Type>> FromTypePb(const TypePb &pb,
587+
absl::StatusOr<std::unique_ptr<Type>> FromTypePb(const TypePb& pb,
588588
absl::string_view lang_name);
589589

590590
} // namespace maldoca

0 commit comments

Comments
 (0)