GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
modula2

Modula-2: Improve spell-checking for symbols and types

Enhances Modula-2 compiler's spell-checking to include base modules, types, and constants.

This patch improves the Modula-2 compiler’s symbol spell-checking capabilities. It ensures that the base module is considered first during scope checks and allows filtering of symbols to include only variables, types, or constants. This prevents the scope check from incorrectly stopping at module boundaries and provides more accurate suggestions for misspelled identifiers.

In Details

The Modula-2 compiler's symbol resolution and spell-checking mechanisms have been enhanced. The P3SymBuild and PCSymBuild modules now correctly push and pop the base module, ensuring it's always considered. The M2MetaError module gains a ConfigureFilter procedure and associated filter fields (filterVar, filterType, filterConst) to allow SpellHint to narrow down candidates to specific symbol kinds. This addresses issues where scope checks halted prematurely at module boundaries and improves the quality of spell-checking suggestions by restricting them to relevant symbol types.

For Context
Modula-2
A procedural programming language, developed by Niklaus Wirth, designed for systems programming and teaching. It emphasizes modularity and strong typing.
spell checking
In a compiler context, this refers to the process of identifying and suggesting corrections for mistyped identifiers (variable names, function names, etc.) that are not recognized in the current scope.
scope check
The process by which the compiler verifies that identifiers (variables, functions, etc.) are used within the region of code where they are declared and visible.
base module
In Modula-2, a module that serves as a foundational unit or library from which other modules may import definitions.
symbol
A name that represents an identifier in a program, such as a variable, function, type, or constant.
Filed Under: modula2compilersyntax errorsymbol resolution