From 224f62a843c2d478e3de70e44d07f3b91a7afae5 Mon Sep 17 00:00:00 2001 From: Rika Ichinose Date: Wed, 22 Mar 2023 13:37:47 +0300 Subject: [PATCH] Report correct error positions inside macros (at least more often). --- compiler/scanner.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/scanner.pas b/compiler/scanner.pas index dd7b70e774..6177186a63 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -2564,7 +2564,6 @@ type else begin mac.defined:=true; - mac.fileinfo:=current_tokenpos; mac.is_compiler_var:=false; { delete old definition } mac.free_buftext; @@ -2591,6 +2590,9 @@ type if is_keyword(hs) then Message(scan_e_keyword_cant_be_a_macro); + current_scanner.gettokenpos; + mac.fileinfo:=current_tokenpos; + macropos:=0; { parse macro, brackets are counted so it's possible to have a $ifdef etc. in the macro }