https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122241

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <[email protected]>:

https://gcc.gnu.org/g:cafc877cc1ade3fea34f1ca32ab12126956fc5e8

commit r16-4598-gcafc877cc1ade3fea34f1ca32ab12126956fc5e8
Author: Gaius Mulley <[email protected]>
Date:   Fri Oct 24 13:04:10 2025 +0100

    PR modula2/122407: similar error messages are emitted for an unknown symbol

    This followup to PR modula2/122241 reduces error message clutter by
    filtering unknown symbol error ensuring that only one error message
    is emitted for an unknown symbol at a particular location.
    The filter is implemented using two binary trees.  A new generic
    (based on the address type) binary dictionary module is added to
    the base libraries.

    gcc/m2/ChangeLog:

            PR modula2/122407
            * Make-lang.in (GM2-LIBS-BOOT-DEFS): Add BinDict.def.
            (GM2-LIBS-BOOT-MODS): Add BinDict.mod.
            (GM2-COMP-BOOT-DEFS): Add FilterError.def.
            (GM2-COMP-BOOT-MODS): Add FilterError.mod.
            (GM2-LIBS-DEFS): Add BinDict.def.
            (GM2-LIBS-MODS): Add BinDict.mod.
            * gm2-compiler/M2Error.def (KillError): New procedure.
            * gm2-compiler/M2Error.mod (WriteFormat3): Reformat.
            (NewError): Rewrite and call AddToList.
            (AddToList): New procedure.
            (SubFromList): Ditto.
            (WipeReferences): Ditto.
            (KillError): Ditto.
            * gm2-compiler/M2LexBuf.mod (MakeVirtualTok): Return
            caret if all token positions are identical.
            * gm2-compiler/M2MetaError.mod (KillError): Import.
            (FilterError): Import.
            (FilterUnknown): New global.
            (initErrorBlock): Initialize symcause and token.
            (push): Capitalize comments.
            (pop): Copy symcause to toblock if discovered.
            (doError): Add parameter sym.
            (defaultError): Assign token if discovered.
            Pass NulSym to doError.
            (updateTokSym): New procedure.
            (chooseError): Call updateTokSym.
            (doErrorScopeModule): Pass sym to doError.
            (doErrorScopeForward): Ditto.
            (doErrorScopeMod): Ditto.
            (doErrorScopeFor): Ditto.
            (doErrorScopeDefinition): Ditto.
            (doErrorScopeDef): Ditto.
            (doErrorScopeProc): Ditto.
            (used): Pass sym[bol] to doError.
            (op): Assign symcause when encountering
            an error, warning or note.
            (MetaErrorStringT1): Rewrite.
            (MetaErrorStringT2): Ditto.
            (MetaErrorStringT3): Ditto.
            (MetaErrorStringT4): Ditto.
            (isUniqueError): New procedure function.
            (wrapErrors): Rewrite.
            (FilterUnknown): Initialize.
            * gm2-compiler/M2Quads.mod (BuildTSizeFunction): Add spell check
            hint specifier.
            * gm2-compiler/FilterError.def: New file.
            * gm2-compiler/FilterError.mod: New file.
            * gm2-libs/BinDict.def: New file.
            * gm2-libs/BinDict.mod: New file.

    libgm2/ChangeLog:

            PR modula2/122407
            * libm2pim/Makefile.am (M2MODS): Add BinDict.mod.
            (M2DEFS): Add BinDict.def.
            * libm2pim/Makefile.in: Regenerate.

    Signed-off-by: Gaius Mulley <[email protected]>

Reply via email to