Abdelrazak Younes writes:
> No, you can also use vector::reserve in order to make sure that the
> memory is never reallocated.
Only if you know in advance how many tokens are going to be read, which
can be approximated by file size, but is IMO less clean than returning
a copy as I did. I did some
>> It happens always, and only in a table directly after '\\'. It also
>> happens for example \textit{..} instead of \verb". It looks perfectly
>> reproducable.
>>
>> So, the vector only 'reallocates' the tokens when a second token is
>> added.
>>
>> Still, I don't understand this.
>
>When the
"Vincent van Ravesteijn - TNW" writes:
> I couldn't reproduce this with a minimal example.
>
> FYI, I found out that the t.cs() becomes 'crap' after text.cpp:1544. At
> this line, there is a call to p.next_token() which will call
> tokens_.push_back() somewhere and after this, t.cs() is bogus and
> Actually, the problem (I understood it by reading your previous
> message) is that the tokens_ variable is a vector, and
> therefore it can from time to time be reallocated when we do a
> push_back(). In this case, the references become stale.
I couldn't reproduce this with a minimal example
Jean-Marc Lasgouttes wrote:
Abdelrazak Younes writes:
Hum, I withdraw the "perfectly fine". This is not a const method and
pos_ is modified. This is a very bad idea and this parser is just
severely broken IMO...
No, get_token is a "read token and advance position" method, much like
<<
Abdelrazak Younes writes:
> Hum, I withdraw the "perfectly fine". This is not a const method and
> pos_ is modified. This is a very bad idea and this parser is just
> severely broken IMO...
No, get_token is a "read token and advance position" method, much like
<< for a stream. This is actually a
>Hum, I withdraw the "perfectly fine". This is not a const method and
>pos_ is modified. This is a very bad idea and this parser is just
>severely broken IMO...
>
>So what I would do is this:
>
>- Token const & Parser::get_token()
>+ Token const & Parser::get_token() const
>{
> static const Toke
Abdelrazak Younes wrote:
Jean-Marc Lasgouttes wrote:
lasgout...@lyx.org writes:
Author: lasgouttes
Date: Thu May 7 12:09:03 2009
New Revision: 29557
URL: http://www.lyx.org/trac/changeset/29557
Log:
(partial?) fix to bug 5935
I am not sure why the fix is really needed, but it works.
Jean-Marc Lasgouttes wrote:
lasgout...@lyx.org writes:
Author: lasgouttes
Date: Thu May 7 12:09:03 2009
New Revision: 29557
URL: http://www.lyx.org/trac/changeset/29557
Log:
(partial?) fix to bug 5935
I am not sure why the fix is really needed, but it works. Basically, the
fix is:
lasgout...@lyx.org writes:
> Author: lasgouttes
> Date: Thu May 7 12:09:03 2009
> New Revision: 29557
> URL: http://www.lyx.org/trac/changeset/29557
>
> Log:
> (partial?) fix to bug 5935
I am not sure why the fix is really needed, but it works. Basically, the
fix is:
> - Token const
10 matches
Mail list logo