trailing spaces
This commit is contained in:
parent
a10fbc77a3
commit
61c25c3fbf
|
|
@ -132,7 +132,7 @@ private:
|
|||
// Consume {% token
|
||||
prev_cur = current;
|
||||
expect(token::open_statement, "Expected {%");
|
||||
|
||||
|
||||
if (peek().t != token::identifier) {
|
||||
throw std::runtime_error("Unknown statement");
|
||||
}
|
||||
|
|
@ -183,15 +183,15 @@ private:
|
|||
}
|
||||
auto callee = parse_primary_expression();
|
||||
if (!is_type<identifier>(callee)) throw std::runtime_error("Expected identifier");
|
||||
|
||||
|
||||
auto call_args = parse_args();
|
||||
expect(token::close_statement, "Expected %}");
|
||||
|
||||
|
||||
statements body;
|
||||
while (!is_statement({"endcall"})) {
|
||||
body.push_back(parse_any());
|
||||
}
|
||||
|
||||
|
||||
expect(token::open_statement, "Expected {%");
|
||||
expect_identifier("endcall");
|
||||
expect(token::close_statement, "Expected %}");
|
||||
|
|
@ -205,12 +205,12 @@ private:
|
|||
filter_node = parse_call_expression(std::move(filter_node));
|
||||
}
|
||||
expect(token::close_statement, "Expected %}");
|
||||
|
||||
|
||||
statements body;
|
||||
while (!is_statement({"endfilter"})) {
|
||||
body.push_back(parse_any());
|
||||
}
|
||||
|
||||
|
||||
expect(token::open_statement, "Expected {%");
|
||||
expect_identifier("endfilter");
|
||||
expect(token::close_statement, "Expected %}");
|
||||
|
|
@ -227,7 +227,7 @@ private:
|
|||
auto left = parse_expression_sequence();
|
||||
statement_ptr value = nullptr;
|
||||
statements body;
|
||||
|
||||
|
||||
prev_cur = current;
|
||||
|
||||
if (is(token::equals)) {
|
||||
|
|
@ -311,7 +311,7 @@ private:
|
|||
// `messages` in `for message in messages`
|
||||
auto iterable = parse_expression();
|
||||
expect(token::close_statement, "Expected %}");
|
||||
|
||||
|
||||
statements body;
|
||||
statements alternate;
|
||||
|
||||
|
|
@ -486,7 +486,7 @@ private:
|
|||
arg = parse_expression();
|
||||
if (is(token::equals)) {
|
||||
// keyword argument
|
||||
// e.g., func(x = 5, y = a or b)
|
||||
// e.g., func(x = 5, y = a or b)
|
||||
++current; // consume equals
|
||||
arg = mk_stmt<keyword_argument_expression>(std::move(arg), parse_expression());
|
||||
}
|
||||
|
|
@ -525,7 +525,7 @@ private:
|
|||
prev_cur = current;
|
||||
if (is(token::colon)) {
|
||||
// A case where a default is used
|
||||
// e.g., [:2] will be parsed as [undefined, 2]
|
||||
// e.g., [:2] will be parsed as [undefined, 2]
|
||||
slices.push_back(nullptr);
|
||||
++current; // consume colon
|
||||
is_slice = true;
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ value for_statement::execute_impl(context & ctx) {
|
|||
scope_update_fns.push_back(scope_update_fn);
|
||||
}
|
||||
JJ_DEBUG("For loop: %zu items after filtering", filtered_items.size());
|
||||
|
||||
|
||||
auto result = mk_val<value_array>();
|
||||
|
||||
bool noIteration = true;
|
||||
|
|
@ -558,7 +558,7 @@ value macro_statement::execute_impl(context & ctx) {
|
|||
const func_handler func = [this, name, &ctx](const func_args & args) -> value {
|
||||
size_t expected_count = this->args.size();
|
||||
size_t input_count = args.args.size();
|
||||
|
||||
|
||||
JJ_DEBUG("Invoking macro '%s' with %zu input arguments (expected %zu)", name.c_str(), input_count, expected_count);
|
||||
context macro_ctx(ctx); // new scope for macro execution
|
||||
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ struct for_statement : public statement {
|
|||
statements default_block; // if no iteration took place
|
||||
|
||||
for_statement(statement_ptr && loopvar, statement_ptr && iterable, statements && body, statements && default_block)
|
||||
: loopvar(std::move(loopvar)), iterable(std::move(iterable)),
|
||||
: loopvar(std::move(loopvar)), iterable(std::move(iterable)),
|
||||
body(std::move(body)), default_block(std::move(default_block)) {
|
||||
chk_type<identifier, tuple_literal>(this->loopvar);
|
||||
chk_type<expression>(this->iterable);
|
||||
|
|
@ -278,7 +278,7 @@ struct identifier : public expression {
|
|||
|
||||
// Literals
|
||||
|
||||
struct integer_literal : public expression {
|
||||
struct integer_literal : public expression {
|
||||
int64_t val;
|
||||
explicit integer_literal(int64_t val) : val(val) {}
|
||||
std::string type() const override { return "IntegerLiteral"; }
|
||||
|
|
@ -327,7 +327,7 @@ struct tuple_literal : public array_literal {
|
|||
|
||||
struct object_literal : public expression {
|
||||
std::vector<std::pair<statement_ptr, statement_ptr>> val;
|
||||
explicit object_literal(std::vector<std::pair<statement_ptr, statement_ptr>> && val)
|
||||
explicit object_literal(std::vector<std::pair<statement_ptr, statement_ptr>> && val)
|
||||
: val(std::move(val)) {
|
||||
for (const auto & pair : this->val) {
|
||||
chk_type<expression>(pair.first);
|
||||
|
|
|
|||
Loading…
Reference in New Issue