From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +ZwsNGK0AGvSOyUAWB0awg (envelope-from ) for ; Fri, 20 Nov 2026 15:58:10 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=cJLRNRy+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D26C21E0CA; Fri, 20 Nov 2026 15:58:10 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EB8891E023 for ; Fri, 20 Nov 2026 15:58:09 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26086409FCA5 for ; Fri, 20 Nov 2026 20:58:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26086409FCA5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=cJLRNRy+ Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id F363F40A00FD for ; Fri, 20 Nov 2026 20:57:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F363F40A00FD Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F363F40A00FD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795208265; cv=none; b=AX7FTCC225j62rold8XTArnB/pyLnJPZbhyO1cWUR6xuV/QbxWqzCax0oobZ88gn04CUompk8pNwXkUXTc2u6fvY7nphc2sYY9Ts4SUxDtp1n/GcVLIwUO8CVHGcvZZXmWwGqOt51dK2UyAzYN4MOy7hRnQmYF7+T/tNAoXdDog= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795208265; c=relaxed/simple; bh=GdBlYAekCXLgICHyVRmDmoBGmgTdcSUOPEnSUvzDivw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=P2LleZj1EVIdYHtGKdHLa382JjXLd5yYefIdVuKTjLahTgf9xn4Ic4/leXxrRMzi12wG4rEjAje2+ZnkxdxYzA3QsT6UE0CyM0MiTavqrZMjX6fnqrRGJHc+mKUFUhml4lgUCJg5tDPlVSiKeNFckDB8FQ0lNHh6XebTFbZ01Ls= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=cJLRNRy+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F363F40A00FD Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-843cf077f10so1760667a34.1 for ; Fri, 20 Nov 2026 12:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1795208264; x=1795813064; darn=sourceware.org; h=content-type:mime-version:user-agent:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=aO8NBsj/9qVssD1mg/p3v1vd9LunQx2f/6fVRTZYaQI=; b=cJLRNRy+O7Lj4prB4i2H/7lOBZOD8zA6G6KzXvO89Y3MSadoKn2QQd91HBITZ6cXOv qsBYTvuqvZ0GPPPKfRrO6122cPFUhFuhB+8AixSPm4Kk1TpB22KRUF51rpJXhWekBvYR Td42krMTMgO4IGVXm0Fn8QS8LU6BNTXyt+8KxJjaEO6gVHBdSB44epV4PHl4+DP0PmBS 8WDTxfNK54P3b3RA3JfTgPYaCiZCSV6k3N5XezLq5gzpJIPZSNKT6hYCu8h2s9+eRjkn 3FKB7hoNTIoO9/Uj0CbuHEVxfYqVSKQTGXRJudxkBfiObLsQTyx+nLp5mMapgd8cjfSs mt0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795208264; x=1795813064; h=content-type:mime-version:user-agent:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=aO8NBsj/9qVssD1mg/p3v1vd9LunQx2f/6fVRTZYaQI=; b=SVJxvskivnjluWbFkoBlLgtGX78O2Nqu5laNad8BCUmO8fm+g3PJ7qjx6Dknr41BfS bp714sEv/AgBfi8F+2jUcO8H0e7tR0rydBwDUjwr1viqBccn0UK3aDp7kzc4TsYaQt1q KsT1p/052ri2M9Nc6cfR1JvwnwpIObI21U8EbXc+UMonV+lI/8RDykfLndNARQuOsZ5E NvDEcaVRJpsFZhFvsB0fs8RtXsUVcdkI2zcQ5mgVhbnLGKrGFdO6SZ/OP337I257mRAC 3S49bwlavIi/CHymqrtxTjGIloijsgzkJ2b9AavEDb1/SQJKSZ9WhZSVYQ5tqrZf3Ihz B5zA== X-Forwarded-Encrypted: i=1; AL+hErGGSHcM7qru281T/6I9ZV686fRDU7TfiFMaBIiiUZopP5P7vlWuQqqs9qbCoRPKCmiMZWwdNF4n4/X/gg==@sourceware.org X-Gm-Message-State: APuU4Z+SvnFZwGUq5AjL367JobYF1cTuQH7JunUUwPRbI9vyh93ZpeGk T9zsr5XvHyfMiDkKgDQhVkehs9HaiJYoPLcrCsEps38/RF4k/uikc/rNT14nSUOCSg== X-Gm-Gg: AYBFou2wnIozRdGJ8/Yu8xXiEEvpN7B3ihCXq314webyLIr6O/uyBZDMnP6cLuS81z2 pkpvSOC0eUn9zn+G+sStHSepIzLFb2SPPagKuVIiZHrmT0jtNLaxthlkPVPMeTFJQPCdGhtEWHR bHJJ04hPlZcJXcTWTdp/SCvVV5pGTlCt6XOqTpp8JYLtqqwep0PasYvdcdXT3jyD+J3zrzYLXW2 1Hf3TWCany8DXKal5rrnHvBRUSiSZhKNz2Mgd76kAz7wGCZTQXIJ43KLLesY62n0EKgID1+xMDL P6WYyhFKkQnNOUgXugrjucnYYVTzOuQk4yXVBf3AH5MNgzTejXnrGRRpT2QNwbnRY4+/ClPJDLM BJDtyvtYzoUrSuZheIrq7wvwY+gJ4JD2eXr+AvN0iOX684Q5uzGBaoM7d16JcVnjlMp3PkDfY7C ZsgPtatex69XYJMvhkqWRy3plrbSfBof0JI3DiBUzMVzIBdu5tuzcD4Ro5rS/wOdYYWk/epcsBC Ocu92DnnydOUG2WQHOJoxWWm6F6g2nSp+em9SuHFYh0jCdAPOA7/tt/8WpZAC6IK27DI5ns9Dd0 t9TPkKM9NNY+lWKt052H4hcEOgqvc1sy6SFOTZTbfgdJ8XEqbEU= X-Received: by 2002:a05:6830:3143:b0:834:b015:aed2 with SMTP id 46e09a7af769-8631562219fmr5943642a34.6.1795208264274; Fri, 20 Nov 2026 12:57:44 -0800 (PST) Received: from bapiya (97-122-110-129.hlrn.qwest.net. [97.122.110.129]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-863168bdba0sm3171565a34.7.2026.11.20.12.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2026 12:57:43 -0800 (PST) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 3/7] Change some Ada parser functions into methods In-Reply-To: <7a117c30-a4fa-4d33-b89f-98f3baa8e7f0@simark.ca> (Simon Marchi's message of "Thu, 19 Nov 2026 13:48:58 -0500") References: <20261119-more-parser-cleanups-v1-0-d85241f3fede@adacore.com> <20261119-more-parser-cleanups-v1-3-d85241f3fede@adacore.com> <7a117c30-a4fa-4d33-b89f-98f3baa8e7f0@simark.ca> X-Attribution: Tom Date: Fri, 20 Nov 2026 13:57:41 -0700 Message-ID: <87pkvzxltm.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Simon> Do you plan on switching more functions to become methods and working Simon> your way towards making ada-expt.y a "pure" parser? Is that what you Simon> mean by "resemble how the Rust parser works"? Yeah, I would like to do that. I personally find debugging and modifying recursive descent parsers much easier than dealing with yacc. That said who knows how long it will take. It's kind of involved. For Ada it would probably let us remove some lexing hacks though. >> @@ -378,14 +378,13 @@ ada_parse_state::process_id (std::string_view name0) >> /* See ada-exp-parser.h. */ >> >> struct stoken >> -processString (const char *text, int len) >> +ada_parse_state::process_string (const char *text, const char *lim) Simon> Sounds like that should take a string_view. I had tried this before, but it's a pain due to the inner part of the loop. I guess the loop could remain and just use .data(), but that doesn't really seem like much of an improvement in the end. >> + int process_int (const char *base0, const char *num0, const char *exp0); Simon> The names in the comment don't have the "0" suffix. Does the 0 have a Simon> meaning, like to indicate we expect this string to be null-terminated? No idea, these were just leftovers. I'll look and change them. Tom