From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EFAqJe4uB2e1JgAA62LTzQ:P1 (envelope-from ) for ; Thu, 10 Oct 2024 03:33:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id EFAqJe4uB2e1JgAA62LTzQ (envelope-from ) for ; Thu, 10 Oct 2024 03:33:34 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=Mz8gaScq; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=vpYdXgZh; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Seal: i=2; s=key1; d=johnnyrichard.com; t=1728524014; a=rsa-sha256; cv=pass; b=rsNebdvYOV2Phn4DLioDdytXsju9sU5XT5BvxxpWpqc+Oega8GHLsRTbZZFzbrUYbpXjh9 yeRz4GKt5G1fOJd7Qz860yhy6K8Jfr5B+VGjDhX9ZxPZgzQnlR9SZ5f1n7E9ykwH43U3C5 tgKS5U27eKk7XeVOO3UoVwryM5RrBwCrSvNyvkaVpnJN429/GliW9z+LeJ7XNOUpqvOnLm LwHINKbTSvA3PFMZE907VTltJLP+8I6+qB1wW5dP4Z9N98+U1qZry218z1SzOGbqB3cDve 8SPjYm6ZX9FDIot67F6pJLRncmPR8y0afPi4CKSaGBm+Z6pyLMAhKZjpaQSptA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=Mz8gaScq; dkim=pass header.d=maniero.me header.s=hostingermail1 header.b=vpYdXgZh; dmarc=pass (policy=none) header.from=maniero.me; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; arc=pass ("mailchannels.net:s=arc-2022:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1728524014; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=swDLBzOOpkX71WW379IuGvSe+ubhYgLLvnKN2Ta0l1Q=; b=HhWyHk/2tpj4Ee0ZLvfGNPoDUOOkq74R0YMjWWPKZvvcgfzD720NxUcjw1Vc+h2L/aN4t7 4M7eUlC8m9sBIGXv3sUaE7jYWb3iMMy+P9oy9rFy9KOykvQXjN3XPz7X+lPIaljBnE5uz5 Vb0hsfBDcr0NwilL+zKdvWCQc95togvLR4WqFpXPZY1WN+TYs+7gFuIYVuYTBScwROJVNn dfQJ/f8ZrVnMD9egdMyCcN2eCcjh/3XVfx5eKPmDBVImpJ2gPRRudVtIhM72B2oZphVOFO pi5lPOEXYA3jxlItyB4V5nKS44OfMvx+HNNtY4JGjuV8QboZ8ZJySvYyPRDrjg== Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 22CA463437 for ; Thu, 10 Oct 2024 03:33:34 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=/m0xUcuLj3tdx6PWffIW77I0NgJo/RAjaX4MX27M+bA=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1728524013; v=1; b=Mz8gaScq9KLRLuDjL4kL1igw46W8tAH5TBxiRuNabzHrBKcwYwuvnMCVKy5009ewORTLZH8+ rtppUDzy0Q2aVv4SnmBfQuCuOc6mIHEiPRNgWBkW0IgApdEfd8taSgnhjJPsE5ksP9DvnYLA3b2 BHfwj5aGoBdRslU7euXvsxzu/Mzw+mmOv7LVlNhLAMdY/Zkc2hu0ZR8y/PR/QF0Q1hEzBZHdMKW PjQUq2N8TmYVtODDLkkrUTPMa4OJLdK/j5bndi5A3TyzOMGMqt4liwxo26S6ETbkSsK3A6oKv3i yjJAVXmh0gy7XNhM2mHaAsbhhQtHf4TKWZwj0df8+2i6g== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 5D95D20201 for ; Thu, 10 Oct 2024 01:33:33 +0000 (UTC) Received: from serval.cherry.relay.mailchannels.net (serval.cherry.relay.mailchannels.net [23.83.223.163]) by mail-a.sr.ht (Postfix) with ESMTPS id C13E3201E1 for <~johnnyrichard/olang-devel@lists.sr.ht>; Thu, 10 Oct 2024 01:33:30 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 08F034E445F for <~johnnyrichard/olang-devel@lists.sr.ht>; Thu, 10 Oct 2024 01:33:26 +0000 (UTC) Received: from nl-srv-smtpout1.hostinger.io (100-101-175-84.trex-nlb.outbound.svc.cluster.local [100.101.175.84]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 47B374E4494 for <~johnnyrichard/olang-devel@lists.sr.ht>; Thu, 10 Oct 2024 01:33:25 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1728524005; a=rsa-sha256; cv=none; b=qvhHnndKMt2daXx6HUJYjxrDaw2+A1xftcscTxl3kFjnV9Mfe25KbbP0KGcwiaMytuvFRs jG+IELX2zDfytk30FJjHcD1YVyx8O0B0t5LleLYpCZUoN9mDde+KJ9N8DByO8rSYRbyehQ D/CxpIpLjALS+M1cxrhdETkBDhpiwnQjFy2PSFl8UK2rZbT2YHvh6kGU8DkAgRZQOfb25E ieaXfxlY0sU8Rtu9MWbmZLp+T5yRsz16bv3YpPQSEuYoFwK1O4u+yC9cnChThQsZTSRQIh uZgWPcc/2R3sFnA3NFD49JAopRqQI0irZWOqgkWeDGFgYE6/X6Qtmtz8/aCZKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1728524005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=swDLBzOOpkX71WW379IuGvSe+ubhYgLLvnKN2Ta0l1Q=; b=GV1ZEIWsE9e93Ck/GY5QF1OiPVFlsjnxqvcLO2c3HDPRBA8pqCIgHOp00VA4DObZda+tFn zd0J1+8z6sSwPu8+TOM3slrnao9vmpexQe6itLZAoAcO14YIt7B9sWDOk+wGXzf2rzBprA PtaapxY5FjRHSXb7OUBN3Jou444xwp3RkP7BOal3t4SEEo5f42iN7w08ATeMUcPQBwz4W5 Y3C+TPj5SDE65wuZWZ6zyHmgLn3GxnOgFSKSh0MiURd9PpcO78Dyg0CrXDoakBTktQZWBl bjBX69U+suLnMW0+u+EUKAE6wY2A6tXYLL5TnqE1eetcR5hhMCBdXffJBLM4/A== ARC-Authentication-Results: i=1; rspamd-585564d48b-j8c4f; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Invention-Minister: 2f39986b10680c7a_1728524005770_104624161 X-MC-Loop-Signature: 1728524005769:3934034882 X-MC-Ingress-Time: 1728524005769 Received: from nl-srv-smtpout1.hostinger.io (nl-srv-smtpout1.hostinger.io [145.14.150.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.101.175.84 (trex/7.0.2); Thu, 10 Oct 2024 01:33:25 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1728524003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=swDLBzOOpkX71WW379IuGvSe+ubhYgLLvnKN2Ta0l1Q=; b=vpYdXgZhOJMnvY6vBnyUA4r36ewF8TqUUvrxMB/Aoj18Yf2eSlqjqkXGERk6Ymage8yb+d 5NYMb6ieY05kLdnOXo8K+7LPR1ifG6sjc74qGSJpZq8DzCMeLhgybGsTrK+OIBU4rM5oo0 E3qeC2SEU+glg8fJY1R1miLxD9XpJqE05TT10l+XltUcjzxa0rOU9K+66YC7nFHYyqnV6a oY9mksfy070MEY0yQb+vzKTjxB4zTpqSPjqdlUlW0R4dVc0Gl7eCcQs7zz8BQJA0AoPFeh DHfW/od8bLIib/SC2+Q/oGIgAoGvvMPFm7RnQYxBTP5R3kHKviv9iVoGkUcaGw== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang 0/6] Suggestions in code style Message-ID: <20241010013318.222905-1-carlos@maniero.me> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Thu, 10 Oct 2024 01:33:23 +0000 (UTC) X-CM-Analysis: v=2.4 cv=bZY5U/PB c=1 sm=1 tr=0 ts=67072ee3 a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=LpZ21dQeNymwXaRAtWoA:9 a=BXDaF_L80NY05PYiAFlV:22 X-CM-Envelope: MS4xfD6df+irNEdUWi3Q/0fwpVWyHrjxZi3m5MVLEkg0QkqaKQt7HxIs3JhnWYC0RFfk9BjWCk4+Doqyedt+4ZkkNdWBohzZ9G8Q3N0V4XJUXASasKB9J5zF w2o5RJa0y2UKCMSFzAZDhhNZrlg1lTQPT9xjhdkjKqVHrzQkduObyq30c8T9IksYbdYJm/0Sl7GsiKExaAk6nML2foOIAngRQItpEW7woyxPAXWalF0Jy+k/ X-AuthUser: carlos@maniero.me List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Migadu-Spam-Score: -0.80 X-Spam-Score: -0.80 X-Migadu-Queue-Id: 22CA463437 X-Migadu-Scanner: mx12.migadu.com X-TUID: vxfWOqI2L5/5 I split it into small changes so it is possible to be avaliated case by case. Since this is a very opinionated and is more about preference than anything, just let me know which changes you agree on and I send a new patch. Carlos Maniero (6): codestyle: change AlignAfterOpenBracket to BlockIndent codestyle: never BreakBeforeBraces codestyle: prevent extra empty lines at EOF codestyle: do not allow single line enums codestyle: add trailing comma on struct initializer codestyle: limit the code to 80 characters .clang-format | 27 +- src/arena.c | 15 +- src/arena.h | 3 +- src/ast.c | 122 ++++--- src/ast.h | 132 ++++---- src/checker.c | 28 +- src/checker.h | 3 +- src/cli.c | 55 +-- src/cli.h | 9 +- src/codegen_linux_aarch64.c | 9 +- src/codegen_linux_x86_64.c | 615 ++++++++++++++++++++++++---------- src/codegen_linux_x86_64.h | 8 +- src/lexer.c | 164 +++++---- src/lexer.h | 18 +- src/list.c | 18 +- src/list.h | 6 +- src/main.c | 73 ++-- src/map.c | 53 +-- src/map.h | 9 +- src/parser.c | 179 ++++++---- src/parser.h | 3 +- src/pretty_print_ast.c | 133 +++++--- src/scope.c | 31 +- src/scope.h | 6 +- src/string_view.c | 14 +- src/string_view.h | 3 +- src/type.c | 6 +- src/type.h | 21 +- tests/unit/arena_test.c | 35 +- tests/unit/list_test.c | 45 ++- tests/unit/map_test.c | 35 +- tests/unit/string_view_test.c | 55 ++- 32 files changed, 1219 insertions(+), 714 deletions(-) base-commit: d45df92d81f00059ecd1f6478bac7e4511d9fd8d -- 2.46.0