[Kst] extragear/graphics/kst

Eli Fidler eli at staikos.net
Tue Apr 24 21:05:54 CEST 2007


SVN commit 657682 by fidler:

fix for bug 144464


 M  +1 -1      src/libkstmath/escan.l  
 M  +9 -2      tests/testeqparser.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/escan.l #657681:657682
@@ -13,7 +13,7 @@
 
 %}
 
-Number	(0|[1-9][0-9]*)([\.][0-9]+)?([eE][\+\-][0-9]+)?
+Number	[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? 
 Id	[A-Za-z]+
 
 %%
--- trunk/extragear/graphics/kst/tests/testeqparser.cpp #657681:657682
@@ -154,9 +154,17 @@
 
   KApplication app(argc, argv, "testeqparser", false, false);
 
-  // Base cases
+  // Numbers
   test("0", 1.0, 0.0);
   test("1.0", 2.0, 1.0);
+  test(".2", 0.0, .2);
+  test("1e1", 0.0, 1e1);
+  test("1e+1", 0.0, 1e+1);
+  test("1e-1", 0.0, 1e-1);
+  test("1E1", 0.0, 1E1);
+  test("1E+1", 0.0, 1E+1);
+  test("1E-1", 0.0, 1E-1);
+  test("0.2e1", 0.0, 0.2e1);
 
   // Basics
   test("x", -1.0, -1.0);
@@ -479,7 +487,6 @@
   testParseFail("2<=<=2");
   testParseFail("2<==2");
   testParseFail(".");
-  testParseFail(".2");
   testParseFail("2.");
   testParseFail(",");
   testParseFail(",2");


More information about the Kst mailing list