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

--- Comment #3 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:074937c853850cef4281931b6709f95098a486c9

commit r17-4679-g074937c853850cef4281931b6709f95098a486c9
Author: Gaius Mulley <[email protected]>
Date:   Sat Sep 26 12:18:44 2026 +0100

    PR modula2/127622: spell checking candidates should include base module and
types

    This patch ensures that the base module is pushed first and that the
    scope check code does not stop at a module boundary.  The patch also
    allows symbols to be filtered on variables, types and constants.

    gcc/m2/ChangeLog:

            PR modula2/127622
            * gm2-compiler/M2Base.mod (CheckCompatible): Rename t1 to left.
            Rename t2 to right.
            Add spellcheck hint format specifiers to unknown types.
            * gm2-compiler/M2MetaError.mod (ConfigureFilter): New procedure.
            (errorBlock): filterVar new field.
            filterType new field.
            filterConst new field.
            (continuation): Add T V C filter modifiers.
            (FilterOnType): New procedure.
            (FilterOnVariable): Ditto.
            (FilrerOnConst): Ditto.
            (SpellHint): Call ConfigureFilter.
            * gm2-compiler/M2StackSpell.def (FilterType): New procedure.
            (FilterVariable): Ditto.
            (FilrerConst): Ditto.
            * gm2-compiler/M2StackSpell.mod (FilterKind): New type.
            (FilterSet): Ditto.
            (CurrentFilter): New variable.
            (PushNameFilter): New procedure.
            (PushCandidates): Pass PushNameFilter as callback.
            (GetSpellHintFilter): New procedure.
            (GetSpellHint): Reimplement.
            (FilterType): New procedure.
            (FilterVariable): Ditto.
            (FilterConst): Ditto.
            (Init): Initialize CurrentFilter.
            * gm2-compiler/P3SymBuild.mod (P3StartBuildDefModule): Push base
            module.
            (P3EndBuildDefModule): Pop base module.
            (P3StartBuildImpModule): Push base module.
            (P3EndBuildImpModule): Pop base module.
            (P3StartBuildProgModule): Push base module.
            (P3EndBuildProgModule): Pop base module.
            (StartBuildInnerModule): Push base module.
            (EndBuildInnerModule): Pop base module.
            * gm2-compiler/PCSymBuild.mod (PCEndBuildDefModule): Pop
            base module.
            (PCStartBuildImpModule): Push base module.
            (PCEndBuildImpModule): Pop base module.
            (PCStartBuildProgModule): Push base module.
            (PCEndBuildProgModule): Pop base module.
            (StartBuildInnerModule): Push base module.
            (EndBuildInnerModule): Pop base module.

    gcc/testsuite/ChangeLog:

            PR modula2/127622
            * gm2.dg/spell/iso/fail/badspelltype.mod: New test.
            * gm2.dg/spell/iso/fail/badspelltype2.mod: New test.

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

Reply via email to