From e91006b59a143ad0083b3fb303a493f9d97e6c9b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 14 Aug 2022 16:13:49 -0700 Subject: Apply new formatting --- clox/src/compiler.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'clox/src/compiler.c') diff --git a/clox/src/compiler.c b/clox/src/compiler.c index 4dded64..18ad4a7 100644 --- a/clox/src/compiler.c +++ b/clox/src/compiler.c @@ -208,8 +208,8 @@ static void initCompiler(Compiler *compiler, FunctionType type) { compiler->function = newFunction(); current = compiler; if (type != TYPE_SCRIPT) { - current->function->name = - copyString(parser.previous.start, parser.previous.length); + current->function->name + = copyString(parser.previous.start, parser.previous.length); } Local *local = ¤t->locals[current->localCount++]; @@ -245,8 +245,9 @@ static void beginScope() { current->scopeDepth++; } static void endScope() { current->scopeDepth--; - while (current->localCount > 0 && - current->locals[current->localCount - 1].depth > current->scopeDepth) { + while (current->localCount > 0 + && current->locals[current->localCount - 1].depth + > current->scopeDepth) { if (current->locals[current->localCount - 1].isCaptured) { emitByte(OP_CLOSE_UPVALUE); } else { @@ -399,8 +400,8 @@ static void method() { uint8_t constant = identifierConstant(&parser.previous); FunctionType type = TYPE_METHOD; - if (parser.previous.length == 4 && - memcmp(parser.previous.start, "init", 4) == 0) { + if (parser.previous.length == 4 + && memcmp(parser.previous.start, "init", 4) == 0) { type = TYPE_INITIALIZER; } -- cgit v1.2.3-54-g00ecf