Review Request: Fixing bug 204068, adding ERROR-Token to parser

Eike Krumbacher eike.krumbacher at
Sat Dec 31 08:26:14 UTC 2011

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 31, 2011, 8:26 a.m.)

Review request for KDE Edu.


- removed coding style lines out of the patch
- checked, that everything compiles without warnings.


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


This addresses bug 204068.

Diffs (updated)

  kmplot/parser.h c3fb92e 
  kmplot/parser.cpp 23569aa 



(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. 


Eike Krumbacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-edu mailing list