ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Check for parity of pair tags on source file to be closed
@ 2020-01-09 12:00 context
  2020-01-09 12:08 ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: context @ 2020-01-09 12:00 UTC (permalink / raw)
  To: ConTeXt

Hello,

in most cases, when a source file is to be closed, pair elements (tags) 
should balanced.

This concerns e.g. { - }, \bgroup - \egroup, \startitemize - 
\stopitemize, \if - \fi etc.

When we have a complicated project structure and when compiling the 
topmost (root) source, a log for a disbalanced tag may appear, but the 
unbalanced tag however may be difficult to find.

Is there a way to enable "watching" pair tags (at least mentioned 
before) in the way that their disbalance would be reported (logged)?

Maybe a "enable tracker" could provide that...

Sample:

---- A.mkiv
\starttext
   A
   \input B.mkiv
\stoptext

---- B.mkiv
   \startitemize
     \item B
---- <- "\startitemize" is unbalanced (unfinished by \stopitemize) in 
the scope of B.mkiv,
         so a message/log ("unfinished \startitemize") should be printed 
when B.mkiv is to be closed.

Best regards,

Lukas
___________________________________________________________________________________
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  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Check for parity of pair tags on source file to be closed
  2020-01-09 12:00 Check for parity of pair tags on source file to be closed context
@ 2020-01-09 12:08 ` Pablo Rodriguez
  2020-01-10 12:46   ` context
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2020-01-09 12:08 UTC (permalink / raw)
  To: ntg-context

On 1/9/20 1:00 PM, context@vivaldi.net wrote:
> Hello,
>
> in most cases, when a source file is to be closed, pair elements (tags)
> should balanced.
>
> This concerns e.g. { - }, \bgroup - \egroup, \startitemize -
> \stopitemize, \if - \fi etc.
>
> When we have a complicated project structure and when compiling the
> topmost (root) source, a log for a disbalanced tag may appear, but the
> unbalanced tag however may be difficult to find.
>
> Is there a way to enable "watching" pair tags (at least mentioned
> before) in the way that their disbalance would be reported (logged)?

Hi Lukas,

maybe this helps you:

    mtxrunjit --autogenerate --script check file.tex

It only works with single files, since t doesn’t load other files (with
\input).

But it might fit your needs.

Just in case it helps,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Check for parity of pair tags on source file to be closed
  2020-01-09 12:08 ` Pablo Rodriguez
@ 2020-01-10 12:46   ` context
  2020-01-10 20:32     ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: context @ 2020-01-10 12:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

Hello Pablo,

thanks for your suggestion.

The "check" detected "\startitemize" which stayed open on the end of the 
file, but did not detect "\if++" without correspondng "\fi".

Thanks again -

Lukas


On 2020-01-09 13:08, Pablo Rodriguez wrote:
> On 1/9/20 1:00 PM, context@vivaldi.net wrote:
>> Hello,
>> 
>> in most cases, when a source file is to be closed, pair elements 
>> (tags)
>> should balanced.
>> 
>> This concerns e.g. { - }, \bgroup - \egroup, \startitemize -
>> \stopitemize, \if - \fi etc.
>> 
>> When we have a complicated project structure and when compiling the
>> topmost (root) source, a log for a disbalanced tag may appear, but the
>> unbalanced tag however may be difficult to find.
>> 
>> Is there a way to enable "watching" pair tags (at least mentioned
>> before) in the way that their disbalance would be reported (logged)?
> 
> Hi Lukas,
> 
> maybe this helps you:
> 
>     mtxrunjit --autogenerate --script check file.tex
> 
> It only works with single files, since t doesn’t load other files (with
> \input).
> 
> But it might fit your needs.
> 
> Just in case it helps,
> 
> Pablo
> --
> http://www.ousia.tk

[-- Attachment #2: c.mkiv --]
[-- Type: text/plain, Size: 39 bytes --]

\starttext
  \if++
    C
\stoptext

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Check for parity of pair tags on source file to be closed
  2020-01-10 12:46   ` context
@ 2020-01-10 20:32     ` Pablo Rodriguez
  2020-01-11 21:47       ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2020-01-10 20:32 UTC (permalink / raw)
  To: ntg-context

On 1/10/20 1:46 PM, context@vivaldi.net wrote:
> Hello Pablo,
>
> thanks for your suggestion.
>
> The "check" detected "\startitemize" which stayed open on the end of the
> file, but did not detect "\if++" without correspondng "\fi".

Hi Lukas,

I don’t know whether checking for \if...\fi pairs is even implemented.

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Check for parity of pair tags on source file to be closed
  2020-01-10 20:32     ` Pablo Rodriguez
@ 2020-01-11 21:47       ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2020-01-11 21:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Pablo Rodriguez

Pablo Rodriguez schrieb am 10.01.2020 um 21:32:
> On 1/10/20 1:46 PM, context@vivaldi.net wrote:
>> Hello Pablo,
>>
>> thanks for your suggestion.
>>
>> The "check" detected "\startitemize" which stayed open on the end of the
>> file, but did not detect "\if++" without correspondng "\fi".
> Hi Lukas,
>
> I don’t know whether checking for \if...\fi pairs is even implemented.

It shoudn't even be needed in a normal document because we have modes 
and \bgroup/\egroup can be replaced with \start/\stop.

Wolfgang

___________________________________________________________________________________
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  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-11 21:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 12:00 Check for parity of pair tags on source file to be closed context
2020-01-09 12:08 ` Pablo Rodriguez
2020-01-10 12:46   ` context
2020-01-10 20:32     ` Pablo Rodriguez
2020-01-11 21:47       ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).