gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improved error headings


From: Gaius Mulley
Subject: Improved error headings
Date: Wed, 17 Nov 2021 22:20:21 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hello,

a small email to say that I've pushed changes to the gcc-12 branch of
gnu modula-2 which enable improved headings for errors.  They look quite
similar to GCC C and C++ headings for example:

$ cat overflow2.mod
MODULE overflow2 ;

CONST
   a = 1 ;

VAR
   c: CARDINAL ;
BEGIN
   IF a = 1
   THEN
      c := -1
   END
END overflow2.

$ gm2 -g overflow2.mod 
overflow2.mod:11:9: warning: overflow2.mod: In program module ‘overflow2’:
attempting to assign a value to a designator ‘c’ which will exceed the range of 
type ‘CARDINAL’
   11 |       c := -1
      |       ~~^~~~~

$ cat error.mod
MODULE error ;

BEGIN
   foo
END error.

$ gm2 -g error.mod 
error.mod:4:4: error: error.mod: In program module ‘error’:
‘foo’ is not recognised as a procedure, check declaration or import
    4 |    foo
      |    ^~~
error.mod:4:4: error: unknown symbol ‘foo’
error.mod:5:10: error: the following unknown symbols in module ‘error’ were 
unresolved
    5 | END error.
      |          ^

the headings it recognises are:  program module, definition module,
implementation module, inner module and procedure - which hopefully
improve initial visual clues as to where errors are located.

git clone git://gcc.gnu.org/git/gcc.git gcc-git
cd gcc-git
git checkout devel/modula-2

https://www.nongnu.org/gm2/download.html

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]