From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 8KWTCAxv32auoAAAe85BDQ:P1 (envelope-from ) for ; Mon, 09 Sep 2024 23:56:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8KWTCAxv32auoAAAe85BDQ (envelope-from ) for ; Mon, 09 Sep 2024 23:56:28 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=hz4EcTNz; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=SDHoZCdT; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1725918988; 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=4Uw8N378/kU4k5o5+2tGizxGb5qyXKNC2C5EZHcgHCY=; b=gw7QaqUACdI6tPGtcl7e+zvYkH+W8qkPI2l5H2gZ87ViFwVMW/WByryK9DJwHa74zMXIbT lqwM+desq678505VzTsTP3DpmWJv74Ry+xfe5Tyorgc8g0Ql4ZMsTaAWK95uXUjuTZs+lz lgyaNfLbhUpRBhKqMReBho/zgqBHEOX3EvULmhN3PNs20u13ld5FQi/gSIcco3C4823fHO ZdaH4BlUVDCgu6vCW+/YbmQlwUBDu8yYnMg6+IWQ7DIJ4Uthy3+OIQTPz7qS2CRotLYVxn iLmiM1jmqw1rf7TtGlPwoYI34itSsI761t5HqYnFx5tw3ViNr6BIl/FQRoW+ww== ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1725918988; a=rsa-sha256; cv=none; b=iclcl3FxS6SgUcXdcxzKitKGOOFL/29NxPUwIeDFREeDs2pBfuwSky9Jm/Brnd6YAy8hgy bt4P4ZCbmEtKFCPVyJxZUXgTcHoOUxEOayAAwkEOJTwOUKBw0b0pG2CJJG2FOnFd2cvxu8 pMYkkiWxcuVIx4JmTerEuK8gE4orHgiUN8mNXLGWCDAzlMGEMzXgpk4k4KiV7X4M9usY/E bsk8EdXX0mp2NfNyqlKZBPs875cgG2SbVRAtDcFLSe/b8jWInofis9WWwCUiThnBi43B7C KlJIc8uMx1lJfvEDFGp+CK8KW1r5XM/K4t16oLu6g20AfuroGC19uVkCKM/qzg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=hz4EcTNz; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=SDHoZCdT; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht 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 A5D6981D19 for ; Mon, 09 Sep 2024 23:56:24 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=/82+fwDeOBcL+cJSkN6sX8RWK1r0u/g3+sczbU99Y8E=; 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=1725918983; v=1; b=hz4EcTNzAtMwz3Rw7khTJW3lGrVkPzvoQuDWgqb8guw/iGTpE9yRX05ySIBwnFsoiS22ScM8 mQd/dKyvd4eBQUCqzKoneMlM5WKJprKMsLxAc5PetbH3h5HGVWAasiHCc9Xz0gzjbJqgTwNo0HC XeMs8pA0Uiub6MQfZAeKMTVOmcw1kxl3TJyAzebX+hdPz9mnVmb8pP2953V71T8OFsYTsWN6ilA mYQx/2tdNrU5Iay7fRzJoDVRYIKsd3wxDNBke9fvtIslOSFy3iEwYr1w1j00Gzp5AGZUrzvdCL2 EZxeWc92jfzfyCbAmoozUgdWL2ADYn620dzzXw/YcJYQA== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 1B2EB20155 for ; Mon, 09 Sep 2024 21:56:23 +0000 (UTC) Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) by mail-a.sr.ht (Postfix) with ESMTPS id 53722200B4 for <~johnnyrichard/olang-devel@lists.sr.ht>; Mon, 09 Sep 2024 21:56:22 +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=1725918980; 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=4Uw8N378/kU4k5o5+2tGizxGb5qyXKNC2C5EZHcgHCY=; b=SDHoZCdTOnKVVER2vV04PeHzlvFFXz/fl1ESe70c+H3JVz4IBHP0uRU9C5CB3M+wNErbeU T5nn10lTEjC3XxAXk2wgQ7cysSTZmaWkSwjBlJeCwbauYN9FTaxfIQj5lRldoVQHp53MTH cWSagQBZrbfV/4thb1AWglqDVR9aMAzkzAFfbfIvmT0EuHyCZ4mA0TuGaSQ5iy029ptCmN w5BU99MN6kt6m++mpPeHchGbOOrLysN3lXm1OBgvQXtHXUX6iUDLzOUOvRo88mA4M4jW1H Z8Qx/ebbXrnMqkfo4jONGSM7euiqxSjsuy87oW4jQS4VWQI3zKHQvrJMCRYR3A== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v1 0/2] parser: implement else branching Date: Tue, 10 Sep 2024 01:54:57 +0200 Message-ID: <20240909235611.84414-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: -2.79 X-Spam-Score: -2.79 X-Migadu-Queue-Id: A5D6981D19 X-Migadu-Scanner: mx11.migadu.com X-TUID: ceB/LgiU3k5K We still need to implement the codegen to get it fully functional. Johnny Richard (2): lexer: add support to else keyword token parser: add support to else branch src/ast.c | 3 +- src/ast.h | 3 +- src/lexer.c | 5 +++ src/lexer.h | 1 + src/parser.c | 40 ++++++++++++++---- src/pretty_print_ast.c | 5 +++ .../integration/tests/0023_else_statement.ol | 42 +++++++++++++++++++ 7 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 tests/integration/tests/0023_else_statement.ol base-commit: 705f54e830e50d0c069cf1e2c76bda4204bd9dcc -- 2.46.0