From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kJcCIXJU92UlCQAA62LTzQ:P1 (envelope-from ) for ; Sun, 17 Mar 2024 21:37:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id kJcCIXJU92UlCQAA62LTzQ (envelope-from ) for ; Sun, 17 Mar 2024 21:37:06 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=gtOyQw4g; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=nb+3oVP1; 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=1710707826; 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=NnPxtXXvNsHXufipFM3XNje12OszkszL07t62lnAtL4=; b=Dur2+nzD2DVxC9r8qSUq8dy1W4692mA2He3vjpQORG0rMcagD+ukS84XUM5zbJqq3fhW8s uPeuMrmSRvph+uMsSRdUte5Gkdotg4gSuko2O+n6D/EOz154VFxm+jpX9FWF/41vlkQzmO xRqi+vyvoGIpVNrUhsJ7nVoGV5RKGiSSrfMBwaBPLoAn/AbrReO6eFu/en+NvLDO4i8rjT HoYdO2UWpBju8J32oqbo3dV6uEIP0KIAbAgF0gZI3nhlMZDAEz5IG26PoMbwxakC7ooXTC +qHutD/aZxbARgT3q6vuDoQq2T8Ec51EsWspasj+q+ILAati6vgUORLITSfezw== ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1710707826; a=rsa-sha256; cv=none; b=CvyWDn3yfmS/njagy3G4iNjljWFXVctGCrtJc5ExqMCwpDo7xjiz5QWyjeqczo/u358N+6 vNPBzFuA5tZB1HmFxB1S/ZHNMdJ57Uh2pxNe5rTbIWO864QRs9+k1LhSszAhK3JWmgVeIv cafQbVvz2ZNM8vX2nTb1rs8XXzss7UJ7UnstYofILFlqoj9P/nwZWOE+nSTAxV414/uLbn sqEW/9duvloPHDd97G/8AIPGObLPEDt0mHiuKjYVH4HAg0fsBfMi8cEFzGq8BsmJfgGE1o 3RU+074yW5HoPLjsC6QVMDlZEkhmTjls0YCSMVhDfA13Xzab+7+uokpZqDhmhA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=gtOyQw4g; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=nb+3oVP1; 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 3C55458995 for ; Sun, 17 Mar 2024 21:37:06 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=6QRn2nTIWqpXEVEysvZ777BfTs+6L8Oz0DR8P0jfkM4=; 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=1710707826; v=1; b=gtOyQw4guF5QU9NKHHorr3Vr4T+TZyiK6ooL2glnAUxjad6FD3Gf8+CqYH9O95sk8YBuDIxH ZcXRg4v90bgXfvamc8MVVHjd+Wnlwfv5Ytu+QP74QCwWjsKELNEMtHPvczpkTY65us61QT3P2MN Q5vJz1T5g01qnpP00nr5YI2IwV7++1F5Wv+tan8IlDlBMy59CyrwniUsFqLxreljFoFWNt0L2db zkDGNc1sqMggafxMa0o5GZGP5KxHgnHLuCXFAusuj5RsIhorBpHbvPUb4j8BZTcRlgUJvOPaoIy GtoYiT1fkpv5z9yR4KIv7c+BRS928VH84ErqJ6wEX3ydA== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id EFD9320123 for ; Sun, 17 Mar 2024 20:37:05 +0000 (UTC) Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) by mail-a.sr.ht (Postfix) with ESMTPS id 2906620110 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 17 Mar 2024 20:37:05 +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=1710707824; 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=NnPxtXXvNsHXufipFM3XNje12OszkszL07t62lnAtL4=; b=nb+3oVP1tx18IDMSVODWU4McacMY17GZiWjFh+o/rsdDRRnRvJo69RjrDdRDMP8AUD6Wmg NMR+sxg0PKC8dyZ8JZODKJ0BHBW4paQIdc6IFbTeZRqWU3QDp5ix9JsSdhHDGLpXZC9kOT po80WHfgW1KbzRDKDFpE0k38fGLpkPGTqgcelvxSAexn6pOr/urkrottB3Dx4STOHKulmJ d0WsZVsMUaBsXv4AFJ4qvcPRnx/7WUeIE5lWj+/nce8qOK9yh+aKILAb1qIDErRvdu+4bh e8Fg1w3vrAVjZTOAlpf7kXQ7dzWrjAEFvOTh2OjBYpBtTHlTR0cE+Slm49Tdzg== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v2 0/3] frontend: add binary operation expr support Date: Sun, 17 Mar 2024 22:29:21 +0100 Message-ID: <20240317213638.131057-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: -9.08 X-Spam-Score: -9.08 X-Migadu-Queue-Id: 3C55458995 X-Migadu-Scanner: mx11.migadu.com X-TUID: bZ1RZwdrxNSA This patchset implements the frontend for parsing binary operation expressions. The backend implementation is not implemented on this patch series. Johnny Richard (3): lexer: add tokenize support to binary op tokens ast: create binary operation ast node parser: add all binary operation expressions examples/expression.ol | 3 + src/ast.c | 14 +++ src/ast.h | 34 ++++++ src/lexer.c | 210 +++++++++++++++++++++++++++++++++- src/lexer.h | 29 +++++ src/parser.c | 209 ++++++++++++++++++++++++++++++--- tests/integration/cli_test.c | 56 ++++++++- tests/integration/proc_exec.h | 3 +- 8 files changed, 536 insertions(+), 22 deletions(-) create mode 100644 examples/expression.ol base-commit: b34e6e1e8dde2852c2d1b050b6ac882605959180 -- 2.44.0