colors in gdc errors

Iain Buclaw ibuclaw at ubuntu.com
Mon Sep 30 20:36:00 PDT 2013


On 3 September 2013 17:03, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
> On 3 September 2013 16:54, eles <eles at eles.com> wrote:
>> It would be possible to implement this for gdc, too:
>>
>> http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html#index-fdiagnostics-color-239
>>
>> ?
>> Also, error messages more similar to those spitted out by gcc. Compare:
>>
>> test01.c:3:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
>> ‘int’
>>  int main() {
>>  ^
>>
>> with
>>
>> test01.d:3: Error: no identifier for declarator eroare
>> test01.d:3: Error: semicolon expected, not 'int'
>>
>> that is: also provide column, display the offending line, add a caret on the
>> next line.
>>
>> I know it is not the end of the world, but it would be nice. Did not test
>> with ldc...
>
> The front-end would have to track column numbering for to allow use to
> use carets in errors.
>
> As for errors, only errors that go through the gcc error system shows
> in colours.  So would have to modify the frontend accordingly in that
> case...
>

https://github.com/D-Programming-GDC/GDC/commit/b2a4421180f70475b52497a75ab0fe760ebc82d7

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list