Re: [NTG-context] Parsing ConTeXt errors

2016-10-13 Thread Nicola

On 2016-10-13 18:37:38 +, Hans Hagen said:


On 10/12/2016 9:30 AM, Nicola wrote:

On 2016-10-11 22:13:12 +, Hans Hagen said:


On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings


Would it be possible to report at least the location of the enclosing
\...MP... block?


it will always be the line where such a block ends, i adapted the
message a bit

tex error   > mp error on line 51 in file e:/tmp/oeps.tex:

 >> foo
! Isolated expression.

;
<*> ...draw fullcircle scaled (i) ; endfor ; foo ;

I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.

(the extra details at the end will be available in the next luatex
binary as it needs an updated mplibrary).


Looks good, looking forward to trying it!

Nicola


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Parsing ConTeXt errors

2016-10-13 Thread Hans Hagen

On 10/12/2016 9:30 AM, Nicola wrote:

On 2016-10-11 22:13:12 +, Hans Hagen said:


On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings


Would it be possible to report at least the location of the enclosing
\...MP... block?


it will always be the line where such a block ends, i adapted the 
message a bit


tex error   > mp error on line 51 in file e:/tmp/oeps.tex:

>> foo
! Isolated expression.

;
<*> ...draw fullcircle scaled (i) ; endfor ; foo ;

I couldn't find an `=' or `:=' after the
expression that is shown above this error message,
so I guess I'll just ignore it and carry on.

(the extra details at the end will be available in the next luatex 
binary as it needs an updated mplibrary).


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Parsing ConTeXt errors

2016-10-12 Thread Nicola

On 2016-10-11 22:13:12 +, Hans Hagen said:


On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings


Would it be possible to report at least the location of the enclosing
\...MP... block?

Nicola


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Parsing ConTeXt errors

2016-10-11 Thread Hans Hagen

On 10/11/2016 9:37 PM, Nicola wrote:

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:


because there are no lines ... the library gets strings

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Parsing ConTeXt errors

2016-10-11 Thread Nicola

On 2016-10-11 18:52:32 +, Alan Braslau said:


Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error:


Sure. But there is no line number. Compare with a typical TeX error:

tex error   > tex error on line 210 in file /path/to/main.tex: ! 
Undefined control sequence


l.210 \sdkjdkjhkdkkjk

In the same line you see:

1) the type of error (tex error);
2) the line number;
3) the file in which the error occurs;
4) the error message.

For MetaPost errors, only 1) and 4) are given with the error; 3) may be 
inferred

(by tracking `open source`/`close source` lines). But I see no trace of 2).

Nicola


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Parsing ConTeXt errors

2016-10-11 Thread Alan Braslau
Of course, I *never* make MetaPost errors... ;-)

However, you can search the log file for
metapost> error: 


Alan


> On Oct 11, 2016, at 07:27, Nicola  wrote:
> 
> Hello,
> 
> I'm trying to parse ConTeXt errors. TeX and Lua errors seem easy to parse
> (search for 'tex error' and 'lua error', respectively), but I have a couple of
> problems with MetaPost messages.
> 
> First, when there are MetaPost errors, context/mtxrun exits with a zero exit
> code. Is that intentional?
> 
> Second, as far as I see, there is no way to locate the error in the source
> from the log. I can only retrieve the file causing the error (by searching for
> an 'open source' line - very useful, btw), but no line number.
> 
> Am I missing something? I think it would be very useful to have at least an
> approximate indication of the position of a MetaPost error.
> 
> Nicola
> 
> 
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___