From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 +OUGIGYzAmZx2wAAqHPOHw:P1 (envelope-from ) for ; Tue, 26 Mar 2024 03:31:02 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +OUGIGYzAmZx2wAAqHPOHw (envelope-from ) for ; Tue, 26 Mar 2024 03:31:02 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; none 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 6324D35686 for ; Tue, 26 Mar 2024 03:31:02 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=4EYYsjMVSWF6CsHjjGwEmV+DF2N6gHbZQJ44tNso/1c=; c=simple/simple; d=lists.sr.ht; h=Date:Subject:From:To:References:In-Reply-To:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1711420261; v=1; b=GH0qjuE0mqypcgwm1SBMYzqKzRjr7mZF1PCZnLtmDWiG9RgHXEeIYUANOWIBvN/IniwQmDnF vJwpJWSJ5erRJ/AtzuMHQ4wzUL6ERADFfs72Fa3WjhdN94Gpts++E3m6rZx11jYobGeZ+RfoQBg MWzgVMqVCOzmvq7RydvhTPpgWtYVC708P7sTcGbT5b6ZTLDv5lr7gjn1g7OZw88w1FzXb2XFoJq KTsjFJ6YaPJgqhLL46pnPLYqG4D+O22wLCJaL+4J3n3DtDS7uReeDYIrqEf8osJOUvMcfsXsEpz HxOr+MnlFwBC1LK0Z4EYcgdTHpHqU3IYNhJsP2cc6igTw== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 7B2ED20205 for ; Tue, 26 Mar 2024 02:31:01 +0000 (UTC) Received: from caracal.birch.relay.mailchannels.net (caracal.birch.relay.mailchannels.net [23.83.209.30]) by mail-a.sr.ht (Postfix) with ESMTPS id 7C7C420117 for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 26 Mar 2024 02:31:00 +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 574A1841C8C for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 26 Mar 2024 02:30:58 +0000 (UTC) Received: from nl-srv-smtpout3.hostinger.io (unknown [127.0.0.6]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 3CB8A841E1A for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 26 Mar 2024 02:30:56 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1711420256; a=rsa-sha256; cv=none; b=4UC74NbZgCdIG9wEe0z2NXFfRNsI2VCFwbzEi6qB+y2P2W0/BCqBz0Uko//4xm2wz+fTvd wNHb8r6nJZYkcy1BW1jzyr+0mjDMf8qDfmYK+LVsLNVTBhL/oC2tjLen9XCmJPPAe7/U8a zd9OQX1qRuZlCaBp7Cgu1alhANaW7bmkmUfSRx5LwqDtneznUvnVUKtPG65p/UOO8EphJV 4K/0l0C0HIEAa5cmOeRR8Ox5E7S7CHF7jvyw2qGNgI/JgHWSiMtKaO1D5jkPFENWir31ps inwqz6PYKFxsbDI4PWb1zc5VaZTEg9onqnvw2NuGrB4njIP5NbvBirEZ0NVMvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1711420256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YI5YlnEmP+LecrxEpbx5+sstfPM8vzbUe1UrbQkrs0U=; b=ulD4ASlqJiwAmi3rW39zvAS7SYR9/hqvVYNPY8tDLEeRmjtZ1raTC4q5Ma9+hpp/o3ryn1 1FUe9Ae3lYjy3lPRKnIQE/L8JbVYNbkdHNejqOaIPcwyfLZzUAETZlhzyYHFzqOwRJKFxw g6VZu9SOR7bNK/xvELGUBG7XCCITScl901fn4PQjFVjPyeqS00cSukYz5QfYeP/8uB4CBt jkXxqWR2gkgC5Leqvm56Os0sZ8KTkhMU2P+btTp4xQyganQ2NBcWaT6Jf8V+0+c5yR6Lxj Ba1q/gIucgNZK8hVceC5Ym+BUlHkBt9U+WfbCWvwOXLWVIGI74XS6jv2bSGkMg== ARC-Authentication-Results: i=1; rspamd-6c65898bb7-q4brg; 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-Descriptive-Cold: 12e7e303379b9c4e_1711420256740_34017057 X-MC-Loop-Signature: 1711420256740:168112881 X-MC-Ingress-Time: 1711420256739 Received: from nl-srv-smtpout3.hostinger.io (nl-srv-smtpout3.hostinger.io [145.14.159.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.203.156 (trex/6.9.2); Tue, 26 Mar 2024 02:30:56 +0000 Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1711420254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YI5YlnEmP+LecrxEpbx5+sstfPM8vzbUe1UrbQkrs0U=; b=SXAr86TybDK6vc0UiSrgzzUuNtoxgFoguwcVdyLQpHDAQ1sry+9OsDrAeEceQLKHKlmF4x WCnfYqk+ljwNKQ6e5OLvymxY3wBsiDsBvuisygyMX5T+txr2MngotDNrbMLrQ7GchMl5og g1XxHOCe9M42C5y/8sV7ScfN7oYHZBjgcYbHlSahqEUJQ72sDbuzqUi87sbbVop9abm0lR UDJGRs5dIgbSB3PqYWqIh233IFsFkbQdggBUpOfqWPwSM69PRbWZ/fSCuhLDLLG2c5QiII tUwhSKKi8rSniSX/gH2Iqv21brIXxas67h/MwuLaeIuQOdNqcsFOfJCS/Ym+pw== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 25 Mar 2024 23:30:48 -0300 Message-Id: X-Sourcehut-Patchset-Update: APPLIED Subject: Re: [PATCH olang v1 2/2] cli: remove code duplication From: "Carlos Maniero" To: "Johnny Richard" , <~johnnyrichard/olang-devel@lists.sr.ht> X-Mailer: aerc 0.15.2-211-g37d5fc691aff References: <20240325223715.459442-1-johnny@johnnyrichard.com> <20240325223715.459442-3-johnny@johnnyrichard.com> In-Reply-To: <20240325223715.459442-3-johnny@johnnyrichard.com> X-CM-Envelope: MS4xfEbtnvraUqMGxzqG2BNTqLZve4PkxZziL9CJN4CrU3D8axDH08UwgDH8yVOTWG7P6V01zqp+pgUfU2NRdX7v5A9jYIM5MvHx1Qwh0QqiKJIb7Q7W+6Lf LHO1HdBS+ZgFuMLTG51uyO8PaLpkYEkuWESbecZ9HuFpxZEaGhAn4Nth4KSnu5JZ1//fqhm4nP0qcjiIjc2jj6QOK2XN7gX7Lul1uZE+li5+Zc4L0kyDZVYz luiwAyjPezAiZUjvY2a9Iw== X-CM-Analysis: v=2.4 cv=YaC75RRf c=1 sm=1 tr=0 ts=6602335e a=WwxFCuf3mf1fs3oSi6/dng==:117 a=WwxFCuf3mf1fs3oSi6/dng==:17 a=IkcTkHD0fZMA:10 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=EU185XGUB0bFTVDirpkA:9 a=QEXdDO2ut3YA:10 a=BXDaF_L80NY05PYiAFlV:22 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-Spam-Score: -4.00 X-Migadu-Queue-Id: 6324D35686 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.00 X-TUID: ue1I01RtO+Er I tested the soluction and everything seems to be working fine. Tests I've executed: ./olang examples/main_exit.ol --dump-ast Translation_Unit `-Function_Definition `-Block `-Return_Statement `-Literal ./olang examples/main_exit.ol --dump-tokens examples/main_exit.ol:1:1: examples/main_exit.ol:1:4: examples/main_exit.ol:1:8: <(> examples/main_exit.ol:1:9: <)> examples/main_exit.ol:1:10: <:> examples/main_exit.ol:1:12: examples/main_exit.ol:1:16: <{> examples/main_exit.ol:1:17: examples/main_exit.ol:2:3: examples/main_exit.ol:2:10: examples/main_exit.ol:2:11: examples/main_exit.ol:3:1: <}> examples/main_exit.ol:3:2: examples/main_exit.ol:4:1: ./olang examples/expression.ol --dump-ast Translation_Unit `-Function_Definition `-Block `-Return_Statement `-Binary_Operation (-) |-Binary_Operation (+) | |-Literal | `-Binary_Operation (*) | |-Literal | `-Literal `-Binary_Operation (-) |-Literal `-Binary_Operation (/) |-Binary_Operation (+) | |-Literal | `-Literal `-Literal Nice work! Applied. To git.sr.ht:~johnnyrichard/olang ce5389c..117a068 main -> main