From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IGDjLdraBmfUhAAA62LTzQ:P1 (envelope-from ) for ; Wed, 09 Oct 2024 21:34:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id IGDjLdraBmfUhAAA62LTzQ (envelope-from ) for ; Wed, 09 Oct 2024 21:34:50 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=Rbx01VWL; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=B862zl4Z; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1728502490; 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=1Ts1CIE3nI9ffYrJjeGLNCcIHLtjER0/L0gshx1RguE=; b=uKEj05FG5ntU6P7ck3tR9jK8B3u+6W85ma75xOhEooJK8v2ZK2DQOkAlQ36l9VZqENndz/ aAPWoM8Qn00kvcfXn6UIYK8wwHgRqa8tygp4OHZJyl032mYQ33yHBNrpoNlOb924Mj7KKj uUXDyE2OVJWK6gNj86ngx5fPNmeU43fqIbZq/Lj1703Aw+3APmwc/JGOS2Yt7jCWHM5uDc v4zH8WYGo0blIgIzobA9jltBWYMYXu1IY93B0DFUvKjcDz++ijHWgI3NthP6/oE+IM6OYK QE4oI43AVpN4V3NaDycDQkNNBDKofuwN7q9IdtdOXCOuBfwIKrVlG+kZ6azByA== ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1728502490; a=rsa-sha256; cv=none; b=CIHAMYiPOdiisoSQVl4Dd44jlJ5Yi7FCPmDCCgWpLEFgxn/3EFLN/Mx2rxs8h3WtUwl0IV OOb8uSbAiCYHTOnytzPDJIq3qDzopA4t56FHIx13uogS6+CCM2vEkPPaOeiFkABf9F7ava FkmruYyTIrfJ8B+pUhf/Q1bMynIelBOnDXEnsgSOAczGQktbTmnQv+j3kkgOYCPheg0Bai rX4ANqrWdgqXAYTJvO2/Pylov8J9wmI3Z126TLq0SqYSX0ZCZYngCt4+mTDMAiPErtD4po +CBqtD9bVJv+PKi1bXvfqYqwLxIZetX2vYOGNRCkZo8f7648VW+b425eCqm1MA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=Rbx01VWL; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=B862zl4Z; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com 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 5EC1D46E03 for ; Wed, 09 Oct 2024 21:34:50 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=hAoVm04fgpQhebKGTZODmOwakiHFP4Wnuba/tHlGx2k=; 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=1728502490; v=1; b=Rbx01VWLxRkdm70I3xgRpdIymvmyk/Qe/h9sFtgdRewkulqDcbmkD+oSAIdhSku7dluUS3Ej s0C4GufAMliOej9pMSjVL5B1VKgkXCEE4E/HcvO6h7xv1iSLhtx2f4/Y7I1Im18bBgmZ2BoNRBw 7yD7DPyyaLyTP3X8x9hsJ8FV//CJU75N03EESsILLEFYLbOVQCk9fzfTOnXT1kk4OfZ4RZ0gB2B 5gPF3flDUDljzxJDIddrfI3OokycgPKlwJq6MzSzbLSkgudecsqpiL2FOcWaWu6QQoHezXaMqMM sVaIux5+pRuOxNP9bUBuI2Zpe8/PBvuFOvAv/5cSSdUJg== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 366B7201E1 for ; Wed, 09 Oct 2024 19:34:50 +0000 (UTC) Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) by mail-a.sr.ht (Postfix) with ESMTPS id 7CC7E20134 for <~johnnyrichard/olang-devel@lists.sr.ht>; Wed, 09 Oct 2024 19:34:49 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1728502489; 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=1Ts1CIE3nI9ffYrJjeGLNCcIHLtjER0/L0gshx1RguE=; b=B862zl4ZGg52cGjxDlrBrylnJwYql3gR2DnLveaWcT9ohkShgldpe08h3ojgPDJotYnlu/ CQvPMBBeigKuKAJ0R4Av4ARykAUoipF6Z4DFjtKzCFyNcTs59BY3gU7/RAwaWAGXDSU25C q9CKcj3stuP+vvpjFn4pvg31KKwNqxU2zAru+WP9L8Zy3tFI0Gz9ndX9TpqaT1gGWqnbJV XW8YxsZd/qlJw5/EZek7t7H7gG8eitdDDkrDUEI2OZI/PNz3ykvu7eVgWTD/omAksyH8QS h+Bq0d6fqhvH5ujMWlOyYLsBbCIrs13uie9Yc6nGMqf88hH2lklwYpbxIjiEHA== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v1 0/3] implement unary operator for bitwise not Date: Wed, 9 Oct 2024 23:18:26 +0200 Message-ID: <20241009213425.412949-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: -4.89 X-Spam-Score: -4.89 X-Migadu-Queue-Id: 5EC1D46E03 X-Migadu-Scanner: mx13.migadu.com X-TUID: ke0DIGzBpx7h This patchset implements the parsing of most unary operations we will need in the future. However the full implementation (until the codegen) is only done for bitwise-not operator. Johnny Richard (3): doc: add unary expression to language spec lexer: add tilde token support parser: codegen(x86_64): add bitwise not unary op support docs/info/specification.texi | 9 +++++ src/ast.c | 14 +++++++ src/ast.h | 22 +++++++++++ src/checker.c | 7 ++++ src/codegen_linux_x86_64.c | 18 +++++++++ src/lexer.c | 6 +++ src/lexer.h | 1 + src/parser.c | 35 ++++++++++++++++++ src/pretty_print_ast.c | 22 ++++++++++- tests/olc/0033_unary_operator_bitwise_not.ol | 39 ++++++++++++++++++++ 10 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 tests/olc/0033_unary_operator_bitwise_not.ol base-commit: 02149b6ddd0bfc6f4e4774eb928e41031889cd73 -- 2.46.0