
        how to find the line that's causing your file not to load


        sometimes it's really hard to find the error that's keeping a file
        from loading.  the error log says something helpful like:

> tail /d/Gondor/log/errors
d/Gondor/gnadnar/foo.c line 32:syntax error
d/Gondor/gnadnar/foo.c line 32:Newline in string
d/Gondor/gnadnar/foo.c line 39:Function create_foo declared but never defined

        but however long you stare at the code on and around line 32, you
        just don't see it.

        time for the Big Hammer ...

        first, try to decide in which large section of code the problem
        likely is.  for example, it's somewhere in your 100+ lines of item
        descriptions, but you can't narrow it down past that.

        then at the beginning of the likely section --- e.g., before your
        first call to add_item() -- insert this line:  

#if 0   /* debugging */

        that should be at the very beginning of the line with no leading
        spaces or tabs.  at the end of the likely section, append this line:

#endif /* debugging */

        again, with no leading spaces or tabs.

        this will cause all the code between the #if 0 and the #endif
        to be completely ignored.

        now, update and load the file.  if it loads, then you've guessed
        correctly re what section has the problem.  if it doesn't load,
        move the #if 0 up, or the #endif down, until the file does load.

        once the file loads, edit it and move the #if 0 down one
        statement (whole statement, ending with ; -- not one line).
        update and load the file again.  repeat until the file
        doesn't load.  at this point, the statement immediately
        before the #if 0 is the one that's causing the problem.

        N.B. it is important to move the #if 0 by whole statements,
        not line by line.  for example, you could move from this:


#if 0   /* debugging */
    add_item("map",
        "It is just part of the clutter of a wizard's work area.\n");
    add_item("table",
        ...
#endif /* debugging */

        to this:

    add_item("map",
        "It is just part of the clutter of a wizard's work area.\n");
#if 0   /* debugging */
    add_item("table",
        ...
#endif /* debugging */

        NOT to this:

    add_item("map",
#if 0   /* debugging */  /* WRONG */
        "It is just part of the clutter of a wizard's work area.\n");
    add_item("table",
        ...
#endif /* debugging */

        that last one dumps the #if 0 in the middle of a call to
        add_item() -- this will not work.
