mirror of
https://github.com/pantor/inja.git
synced 2026-02-17 09:03:58 +00:00
variable_counter to size_t
This commit is contained in:
@@ -63,7 +63,7 @@ class StatisticsVisitor : public NodeVisitor {
|
|||||||
void visit(const SetStatementNode&) {}
|
void visit(const SetStatementNode&) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unsigned int variable_counter;
|
size_t variable_counter;
|
||||||
|
|
||||||
explicit StatisticsVisitor(): variable_counter(0) {}
|
explicit StatisticsVisitor(): variable_counter(0) {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ struct Template {
|
|||||||
explicit Template(std::string content): content(std::move(content)) {}
|
explicit Template(std::string content): content(std::move(content)) {}
|
||||||
|
|
||||||
/// Return number of variables (total number, not distinct ones) in the template
|
/// Return number of variables (total number, not distinct ones) in the template
|
||||||
int count_variables() const {
|
size_t count_variables() const {
|
||||||
auto statistic_visitor = StatisticsVisitor();
|
auto statistic_visitor = StatisticsVisitor();
|
||||||
root.accept(statistic_visitor);
|
root.accept(statistic_visitor);
|
||||||
return statistic_visitor.variable_counter;
|
return statistic_visitor.variable_counter;
|
||||||
|
|||||||
@@ -803,7 +803,7 @@ class StatisticsVisitor : public NodeVisitor {
|
|||||||
void visit(const SetStatementNode&) {}
|
void visit(const SetStatementNode&) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unsigned int variable_counter;
|
size_t variable_counter;
|
||||||
|
|
||||||
explicit StatisticsVisitor(): variable_counter(0) {}
|
explicit StatisticsVisitor(): variable_counter(0) {}
|
||||||
};
|
};
|
||||||
@@ -827,7 +827,7 @@ struct Template {
|
|||||||
explicit Template(std::string content): content(std::move(content)) {}
|
explicit Template(std::string content): content(std::move(content)) {}
|
||||||
|
|
||||||
/// Return number of variables (total number, not distinct ones) in the template
|
/// Return number of variables (total number, not distinct ones) in the template
|
||||||
int count_variables() const {
|
size_t count_variables() const {
|
||||||
auto statistic_visitor = StatisticsVisitor();
|
auto statistic_visitor = StatisticsVisitor();
|
||||||
root.accept(statistic_visitor);
|
root.accept(statistic_visitor);
|
||||||
return statistic_visitor.variable_counter;
|
return statistic_visitor.variable_counter;
|
||||||
|
|||||||
Reference in New Issue
Block a user