From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aWdaKxor/2qkpSAAWB0awg (envelope-from ) for ; Thu, 19 Nov 2026 12:00: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=Ss8IFPdz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AA02F1E0BC; Thu, 19 Nov 2026 12:00: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 31D3E1E023 for ; Thu, 19 Nov 2026 12:00:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9107E4BA2E26 for ; Thu, 19 Nov 2026 17:00:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9107E4BA2E26 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=Ss8IFPdz Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 96E324BA2E05 for ; Thu, 19 Nov 2026 16:59:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96E324BA2E05 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 96E324BA2E05 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795107584; cv=none; b=loGtamcq2a6QDk+dROzQiXXNK9FyF4CYv9hXepTP4+UoLsedkAHUD+DfuteAqUQKZh2HH7BDAyrjCyJIIsDaWm4dpmAcOpOG7aRrIz6EyC46tYGVHUdgUei6bpXVbNlnvdDPfhd3FJvHdf4txkL3RFtFXgTMvHtd+QhkMS7rEWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795107584; c=relaxed/simple; bh=9i3BIBC3oBpGauMOWMus8G+AVZa1oKyyIleZ+O5dIpU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=SmUXFzMAy6UM2J1lPuZxHjrWRJOV+NeI2ZYSfKcMUPwVDKUe7eMCKyxe67q2ptcbRR3aAQoVqKK8n2mhpH6xZgaqoWwqUJCnLFUKkElS3ZmKhZT0H06DKLIu9VqCYe0kiUOQ2Yyvv1741h/Jxq+aMlFQRbZvKN6UfiQRws0GCBw= 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=Ss8IFPdz DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96E324BA2E05 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-843b6f8e2c7so2630314a34.1 for ; Thu, 19 Nov 2026 08:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1795107583; x=1795712383; 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=ZgaOpV6xKxAQn+C4sM2B4HfPmvFQMOcbI/HKPNJ+P1U=; b=Ss8IFPdzhIykK6rIzdpGeOXafqUMvkbgWXWLReF2CiKZKRX17LfhOzAXtpfujHS3Wi u1Z3X3eclXO/y2kN1/Nyv9S09EUf8uB4pxtiYMrR+CW5eN+XTMp3H+W9MfsIkczXUcWd fMws7YvSepgyXz02Cty8AwLy9U+stXVgUlTEGGHCQrBKf3U4sqTbD5Nku1Xsx3iTUx2O HgItIt+8GENGsIZlrqnp04i96AMHCLY3dDPiZeOi19yq4U7QuNq9vYcH3duX/XORhnBV GupiLFQ+nwO19xRU5XdD6x7XoMfPzkqVkfUxEfWghrgAJUo5q/FZ9FRjWb0gFaoV40Ig hAWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795107583; x=1795712383; 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=ZgaOpV6xKxAQn+C4sM2B4HfPmvFQMOcbI/HKPNJ+P1U=; b=0oWC1aFhA2qAQ7fxDv/Rx25SDrneyvPqu6ZzKv619qW/9/4l2DnftY7yI73kkTiNnm st1aepVUPhpXZWIHo8FdtpxMZ1D5DZAOJCMoEs4LxASfO+toaQPdEy+Ge3K47xj/oI8u kyLPRqy/sudLOsgcRcT9kOfNsGBKICL0HDE+0Sa1zKFkvxkgnVOBi0fKI9wkBRoxEg3c YyO7byZWxCffsxzDIG1sh5eLT1gsYFIGiDDSv3z+uAbrVxYoYYBeeba7uw7M2oVWDh8q ew9Ij74oMFomcwZ2J/pc8ekkGIvXxX7iRJP0xYrXfrZRQwmsFJVnLaUCPbIe0JPyL1Fh zdkw== X-Forwarded-Encrypted: i=1; AL+hErEDspBTe5J7JGPDYFgOaOrACzQPl94FsBCMHrSD4ZomStjAtzbZS8I9bKKrzcabsGH/BYypaSVxv4oRuw==@sourceware.org X-Gm-Message-State: APuU4Z+GsatODFltzCiL4vR85jxCHNvpAwes+b4A9W9i3NJmO4mPviNE oR+zCUEVy8Dz3IUnfdld4vDzw6eUU8/90/WNcEFRhkURIfa9EVRSOBx0QHN4c6rbJA== X-Gm-Gg: AYBFou0yNHc7iwAxTNg7VCQwFoaZqfppWFcVJXZqMI2ia4QVM/xlp7dM7hErKLmNUUW AgYoczFo8eMBZX84KSWma/D46nxIXyo8HYcpdKFryTVjQf7UCY33eukTJoBUdiWxG5ZRtjxpMo3 yqV8cvZ4b6E8ILMUaah7vKNwGd0ra+IKk7ePSIyoXIkuMf+QPBB/pNLxI6h+K0IKbxOPinOknXe Y5/ksbk9TiveH1TKsa4WihFt0h4NCINCS/qBb+H04lOM5+vR8oU0yg5aRfrwLJC+1UpWhlRu3FP fUeFUe86howlre0agrG6FiBUQig4qm7lpGkO+PmSaPZQD0h1v3FY8kREFAqu56dgehFc5En9vH5 6EzOtye9KgpD1PQsd7imycihEvk1wluGtR+Ac0LaWwI2cfzR1qJDZpovqO0xQ9pG6qNlGwGuB1l KuqCSgTlZA3u5vRL2UkcAWpXOrFo01ah4flVvXv9xUpJM+qFbDGcpfoJgRv9TZZnWZJV1qiubc3 THhNBnZUUM6L0/5wzm79odgNAa2SYCODH1JBD+RTPCYuYmagGZmqPq3Z5ZlIAsGVgLIVpHVOKCN ApZEpS6RuP/qvctjhTAeOB2m9hyytRFGSk6ODqDJEq9RNvdkVazA X-Received: by 2002:a05:6830:25d0:b0:862:aca4:1158 with SMTP id 46e09a7af769-86315a33059mr583669a34.22.1795107583598; Thu, 19 Nov 2026 08:59:43 -0800 (PST) Received: from bapiya (97-122-110-129.hlrn.qwest.net. [97.122.110.129]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-8631690fd36sm46816a34.20.2026.11.19.08.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2026 08:59:43 -0800 (PST) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH v2] Rewrite the Ada lexer In-Reply-To: (Simon Marchi's message of "Thu, 19 Nov 2026 00:00:37 -0500") References: <20261117191854.2893194-1-tromey@adacore.com> X-Attribution: Tom Date: Thu, 19 Nov 2026 09:59:42 -0700 Message-ID: <87jym8zri9.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" == Simon Marchi writes: Simon> Some cleanup that could be part of this patch, of a later one: Simon> - remove ada-lex-gen.{c,h} from .gitignore Simon> - ECHO_LEX can be removed from silent-rules.mk I did this. Simon> - post-process-parser-output.sh can be simplified But not this. >> +/* The number of subexpressions to allocate space for, including the >> + "0th" whole match subexpression. */ >> +#define NUM_OPER_SUBEXPRESSIONS 2 Simon> NUM_OPER_SUBEXPRESSIONS is unused, I don't know if it should? Yes, I fixed this oversight. >> + while (!name0.empty () && c_isspace (name0.back ())) >> + name0 = name0.substr (0, name0.size () - 1); Simon> Can use name0.remove_suffix(1). Done. >> ada_yylval.sval.ptr = obstack_strndup (&ada_parser->temp_space, Simon> Should be just temp_space (or this->temp_space), instead of going Simon> through the `ada_parser` global. There is another instance at line 280 Simon> in ada_parse_state::process_id. Fixed. Simon> This predates the patch, so maybe a TODO cleanup, we can overflow this Simon> static buffer: Yeah. I intentionally left this alone since it's already there. >> + error (_("Invalid character '%s' in expression."), pstate->lexptr); Simon> %s or %c? I thought this was also pre-existing though I suppose yytext is \0 terminated, so I will change it. ... Simon> Indentation is off for the first element. Fixed. >> + code = regcomp (&operator_regex, operator_regex_text, >> + REG_EXTENDED | REG_ICASE); >> + gdb_assert (code == 0); Simon> Can these use compiled_regex? Yeah, I did this. Tom