]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR modula2/110019 Reported line numbers off by 1 when cpp invoked.
authorGaius Mulley <gaiusmod2@gmail.com>
Wed, 7 Jun 2023 00:21:19 +0000 (01:21 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Wed, 7 Jun 2023 00:21:19 +0000 (01:21 +0100)
commit29c82c6ca929e0f5eccfe038dea71177d814c6b7
tree6b65112e9a6715a0a417e0c01c1517a914c8335b
parent4f0d4825fa489cc1875c94ab405a800a8d76e506
PR modula2/110019 Reported line numbers off by 1 when cpp invoked.

Fix off by one in m2.flex when the line number is set via cpp.

gcc/m2/ChangeLog:

PR modula2/110019
* gm2-compiler/SymbolKey.mod (SearchAndDo): Reformatted.
(ForeachNodeDo): Reformatted.
* gm2-compiler/SymbolTable.mod (AddListify): Join list
with "," or "and" if more than one word is in the list.
* m2.flex: Remove -1 from atoi(yytext) line number.

gcc/testsuite/ChangeLog:

PR modula2/110019
* gm2/cpp/fail/cpp-fail.exp: New test.
* gm2/cpp/fail/foocpp.mod: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/SymbolKey.mod
gcc/m2/gm2-compiler/SymbolTable.mod
gcc/m2/m2.flex
gcc/testsuite/gm2/cpp/fail/cpp-fail.exp [new file with mode: 0644]
gcc/testsuite/gm2/cpp/fail/foocpp.mod [new file with mode: 0644]