Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4 Comment syntax not general enough

open
nobody
None
5
2003-10-03
2002-10-30
No

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 @{
foo
@}

@%@d stuff @{
@%foobar
@%@}

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.

Discussion

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

    Logged In: YES
    user_id=211687

    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 @>
    break;

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

    <quote>
    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);
    };
    source_line++;
    c = getc(source_file);
    source_last = c;
    source_peek = getc(source_file);
    @| @}
    </quote>

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

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

    Paul Huygen