Skip to content

Commit

Permalink
Review comments and formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere committed Oct 31, 2024
1 parent 65bc834 commit e03ffb1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion cpp/src/slice2cpp/Gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,14 @@ namespace Slice
void visitConst(const ConstPtr&) final;

private:
MetadataList validate(const SyntaxTreeBasePtr&, MetadataList, const std::string&, bool = false);
/// Validates any 'cpp' specific metadata that's been applied to `cont`.
/// Additional metadata to validate can also be passed in with the `metadata` field.
/// For example, type metadata applied to a sequence where it's being used instead of just defined.
MetadataList validate(
const SyntaxTreeBasePtr& cont,
MetadataList metadata,
const std::string& file,
bool operation);
};

static void validateMetadata(const UnitPtr&);
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/slice2java/JavaUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ namespace
return result;
}

MetadataList
validateType(const SyntaxTreeBasePtr& p, const MetadataList& metadata, const string& file)
MetadataList validateType(const SyntaxTreeBasePtr& p, const MetadataList& metadata, const string& file)
{
const UnitPtr unt = p->unit();
const DefinitionContextPtr dc = unt->findDefinitionContext(file);
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/slice2py/PythonUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3056,7 +3056,8 @@ Slice::Python::MetadataVisitor::visitConst(const ConstPtr& p)
}

MetadataList
Slice::Python::MetadataVisitor::validateSequence(const ContainedPtr& cont, const TypePtr& type) {
Slice::Python::MetadataVisitor::validateSequence(const ContainedPtr& cont, const TypePtr& type)
{
const UnitPtr ut = type->unit();
const DefinitionContextPtr dc = ut->findDefinitionContext(cont->file());
assert(dc);
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/slice2swift/SwiftUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,8 @@ SwiftGenerator::MetadataVisitor::visitConst(const ConstPtr& p)
}

MetadataList
SwiftGenerator::MetadataVisitor::validate(const SyntaxTreeBasePtr& p, const ContainedPtr& cont) {
SwiftGenerator::MetadataVisitor::validate(const SyntaxTreeBasePtr& p, const ContainedPtr& cont)
{
MetadataList newMetadata = cont->getMetadata();
const UnitPtr ut = p->unit();
const DefinitionContextPtr dc = ut->findDefinitionContext(cont->file());
Expand Down

0 comments on commit e03ffb1

Please sign in to comment.