[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-edu-devel
Subject: Re: Review Request: Fixing bug 204068, adding ERROR-Token to parser
From: "Albert Astals Cid" <tsdgeos () terra ! es>
Date: 2011-12-31 15:07:55
Message-ID: 20111231150755.7463.84555 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103182/#review9398
-----------------------------------------------------------
Do we need the ERROR token at all? I commented addToken( ERROR ); from \
Parser::initEquation and it seems it still works, can you confirm if that is right or \
explain why we need the ERROR token?
- Albert Astals Cid
On Dec. 31, 2011, 8:26 a.m., Eike Krumbacher wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103182/
> -----------------------------------------------------------
>
> (Updated Dec. 31, 2011, 8:26 a.m.)
>
>
> Review request for KDE Edu.
>
>
> Description
> -------
>
> Hello Folks!
>
> If you have a set of functions like
> f(x) = g x ²
> g(x) = 2 x
>
> * kmplot crashes without notice, because the parser reads "g" as a function and \
> reports "Wrong number of arguments" but crashes.
> * If "g" is meant to be a predefined constant the parser crashes because g is read \
> as a function with wrong argument counts.
> So there are several cases:
> 1) g(x) and f(x) exists in a file, reading the file should not crash
> 2) if g is a constant, whether in the file or "global", f(x) should read this \
> constant first 3) a function set like
> g(x) = 10 * g
> f(x) = g(x) + g
> should be read and displayed.
>
> With the given diff, we can archive (1) and (2) but not (3), which now does not \
> crash anymore but gives strange results. In the surrounding of the changes, I \
> added some whitespaces to reflect the style guide of the given code. The main part \
> is an introduction of the token "ERROR", adding this token to the stack in case of \
> an error.
> Have fun
>
> Eike
>
>
> This addresses bug 204068.
> http://bugs.kde.org/show_bug.cgi?id=204068
>
>
> Diffs
> -----
>
> kmplot/parser.h c3fb92e
> kmplot/parser.cpp 23569aa
>
> Diff: http://git.reviewboard.kde.org/r/103182/diff/diff
>
>
> Testing
> -------
>
> (1), (2) and (3) was tested. The original file from the bug report associated with \
> this review was tested. No crashes in these special cases.
>
> Thanks,
>
> Eike Krumbacher
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/103182/">http://git.reviewboard.kde.org/r/103182/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Do we need the ERROR \
token at all? I commented addToken( ERROR ); from Parser::initEquation and it seems \
it still works, can you confirm if that is right or explain why we need the ERROR \
token?</pre> <br />
<p>- Albert</p>
<br />
<p>On December 31st, 2011, 8:26 a.m., Eike Krumbacher wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for KDE Edu.</div>
<div>By Eike Krumbacher.</div>
<p style="color: grey;"><i>Updated Dec. 31, 2011, 8:26 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Hello Folks!
If you have a set of functions like
f(x) = g x ²
g(x) = 2 x
* kmplot crashes without notice, because the parser reads "g" as a function \
and reports "Wrong number of arguments" but crashes.
* If "g" is meant to be a predefined constant the parser crashes because g \
is read as a function with wrong argument counts.
So there are several cases:
1) g(x) and f(x) exists in a file, reading the file should not crash
2) if g is a constant, whether in the file or "global", f(x) should read \
this constant first 3) a function set like
g(x) = 10 * g
f(x) = g(x) + g
should be read and displayed.
With the given diff, we can archive (1) and (2) but not (3), which now does not crash \
anymore but gives strange results. In the surrounding of the changes, I added some \
whitespaces to reflect the style guide of the given code. The main part is an \
introduction of the token "ERROR", adding this token to the stack in case \
of an error.
Have fun
Eike</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">(1), (2) and (3) was tested. The original file from the bug report \
associated with this review was tested. No crashes in these special cases. </pre> \
</td> </tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=204068">204068</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kmplot/parser.h <span style="color: grey">(c3fb92e)</span></li>
<li>kmplot/parser.cpp <span style="color: grey">(23569aa)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/103182/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic