Ah, this is in the new error handling code that Robert
Goedman added.

Let's kill those commented out std::cout, too.

And I really dislike the space between function names and parens.
Nitpicking, I know, but I find it makes the code hard for me to
read.

If there's a get_line() that returns an unsigned type, we shouldn't
be comparing with -1!

In fact, we should go through the entire API and get rid
of all traces of cout -- you can probably do that as part of
the command refactor, since the command should be passing
in streams to whatever wanted to print before.

- Bob


On Mar 5, 2014, at 8:15 AM, Daniel Lee <notifications@github.com> wrote:

> In src/stan/gm/grammars/program_grammar_def.hpp:
> 
> > +        //  Clean up whatever comes after the error occurred
> > +        //
> > +        std::basic_stringstream<char> error_section;
> > +        error_section << boost::make_iterator_range (_where, _end);
> > +        last_char = ' ';
> > +        std::string rest_of_section = "";
> > +        while (!error_section.eof() && !(last_char == '}')) {
> > +          last_char = (char)error_section.get();
> > +          rest_of_section += last_char;
> > +          //std::cout << rest_of_section.size() << std::endl;
> > +          if (error_section.eof() && rest_of_section.size() == 1) {
> > +            rest_of_section = "'end of file'";
> > +          }
> > +        }
> > +
> > +        if (!(get_line(_where) == -1)) {
> 
> Bob, there's a warning on this line that I don't know how to shake. get_line() looks to return a size_t, which is an unsigned type.
> 
> —
> Reply to this email directly or view it on GitHub.
>