]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/117660: Errors referring to variables of type array could display full...
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 18 Nov 2024 17:51:37 +0000 (17:51 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 18 Nov 2024 17:51:37 +0000 (17:51 +0000)
commitab7abf1db09519a92f4a02af30ed6b834264c45e
tree21ad2e5fedb87c81f8cd57ce3142ee94d4431307
parentbba27015f2815a8fa6fae46a29a70644e868341c
PR modula2/117660: Errors referring to variables of type array could display full declaration

This patch ensures that the tokens defining the full declaration of an
ARRAY type is stored in the symbol table and used during production of
error messages.

gcc/m2/ChangeLog:

PR modula2/117660
* gm2-compiler/P2Build.bnf (ArrayType): Update tok with the
composite token produced during array type declaration.
* gm2-compiler/P2SymBuild.mod (EndBuildArray): Create the
combinedtok and store it into the symbol table.
Also ensure combinedtok is pushed to the quad stack.
(BuildFieldArray): Preserve typetok.
* gm2-compiler/SymbolTable.def (PutArray): Rename parameters.
* gm2-compiler/SymbolTable.mod (PutArray): Rename parameters.

gcc/testsuite/ChangeLog:

PR modula2/117660
* gm2/iso/fail/arraymismatch.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/P2Build.bnf
gcc/m2/gm2-compiler/P2SymBuild.mod
gcc/m2/gm2-compiler/SymbolTable.def
gcc/m2/gm2-compiler/SymbolTable.mod
gcc/testsuite/gm2/iso/fail/arraymismatch.mod [new file with mode: 0644]