#4 Comment syntax not general enough


I have used nuweb for years and contributed to some
changes a long time ago. I am glad to see that someone
took over maintenance of nuweb.

A long long time ago I had sent Preston a patch to
implement the comment syntax @%.

The idea was to be able to completely comment
anything, including a complete scrap.

In the description of your current version, the comment
syntax is only allowed within the body of a scrap. To me
this is wrong as there is still no way to fully comment
out a full scrap, say for keeping a tentative attempt or
something like in:

@d stuff @{

@%@d stuff @{

Simply using % in fornt wont work because nuweb will
expand some command onto several latex line, with
only the first one commented out.

So @% should be allowed anywhere, not only within a
scrap body.


  • Dominique de Waleffe

    • summary: Comment syntax not genberal enough --> Comment syntax not general enough
  • Paul Huygen

    Paul Huygen - 2005-01-29

    Logged In: YES

    Another problem is, that @% no longer ignores the following
    newline charater like the "%" character does in TeX files.

    When I look at the source code, it seems to me, that "@%"
    could be easily handled at the lowest input level, in
    function "source_get()" (file input.c).

    For instance, in scrap @<Handle an ``at'' character@>, add
    in the switch statement the case:

    case '%': @< eat at-percent comment @>

    and add a scrap @<eat at-percent comment@>:

    Ignore `\verb|@@|\verb|%| characters. Read everything
    including the next newline character. increment number of
    lines read.

    @d eat at-percent comment @{@%
    while (c != '\n'){
    c = getc(source_file);
    c = getc(source_file);
    source_last = c;
    source_peek = getc(source_file);
    @| @}

    (excuses for the poor C. I am not a C programmer)

    The "@%" handling at higher levels can then be removed.

    Paul Huygen


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks