From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5AEF3858D1E; Thu, 28 Mar 2024 16:50:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5AEF3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711644650; bh=D/MVGCTbaiyVvHlCtSJIM24JNfz7zHow5yOyx+EYUco=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pX4hBPYA1M7fVyHehqmJ1aOfDi+fmANonzljpidMl5z2a8XnFdqbjipULaWy0vnuX cbftO+MonRHk8VVVDz0gqWLRPyd3lO23Yx8Hv9AE3971elCdPrJpsVB9Wl/HfgPy+X wgoOGGBjA2WUxf8Kn2gaIt89P51cDkb4zEDnml3M= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug modula2/114520] Incorrect ordering of import/export statements cause confusing error messages Date: Thu, 28 Mar 2024 16:50:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: modula2 X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: gaius at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114520 --- Comment #4 from GCC Commits --- The master branch has been updated by Gaius Mulley : https://gcc.gnu.org/g:aeee63ffbf4f4fbc4d90d8aae808d6b67f0148a3 commit r14-9710-gaeee63ffbf4f4fbc4d90d8aae808d6b67f0148a3 Author: Gaius Mulley Date: Thu Mar 28 16:49:44 2024 +0000 PR modula2/114520 Incorrect ordering of import/export statements cause confusion The error recovery causes misleading error messages to appear if an EXPORT and IMPORT statement are in the wrong order. This patch detects the incorrect order and issues an error message and prevents error recovery. The fix should be improved and made more general if another similar case is required. gcc/m2/ChangeLog: PR modula2/114520 * gm2-compiler/P0SyntaxCheck.bnf (DetectImport): New procedure. (EnableImportCheck): New boolean. (Expect): Call DetectImport. (Export): Set EnableImportCheck TRUE before ';' and FALSE afterwards. Signed-off-by: Gaius Mulley =