Modula2: Filter spelling hints for VAL intrinsic function parameters
Improves Modula2 compiler's VAL intrinsic function by filtering spelling hints based on parameter context.
This patch enhances the Modula2 compiler’s intrinsic procedure function VAL by adding context filtering for its parameters. The first parameter’s type and the second parameter’s usage (constants, expressions, or variables) are now considered to filter out incorrect spelling suggestions. This aims to reduce noise and improve the developer experience when using the VAL function.
In Details
The Modula2 compiler's semantic analysis pass, specifically within M2Quads.mod, has been updated to improve the spelling correction mechanism for the intrinsic VAL function. The BuildValFunction now filters spelling hints based on the type of the first argument and the kind of expression (constant, variable, or other expression) used for the second argument. This refines the error reporting and code completion for a frequently used intrinsic.
- VAL intrinsic function
- A built-in function in Modula2 used for value conversion or retrieval, potentially involving type casting or accessing specific data representations.
- spelling hints
- Suggestions provided by a compiler or IDE to correct typographical errors or identify potential misunderstandings of identifiers or keywords.