Bug 115555 - the 'else' keyword is not being recognized
Summary: the 'else' keyword is not being recognized
Status: RESOLVED FIXED
Alias: None
Product: kturtle
Classification: Applications
Component: general (show other bugs)
Version: 0.6
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Cies Breijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 19:40 UTC by Jarav
Modified: 2007-06-16 20:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
trace file (8.30 KB, text/plain)
2005-12-24 00:18 UTC, Marc Wolf
Details
fixes the else issue so the doc examples work (471 bytes, patch)
2007-01-16 13:17 UTC, Anne-Marie Mahfouf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jarav 2005-11-02 19:40:31 UTC
Version:           0.6 (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.5-20050130 
OS:                Linux

The 'else' keyword is not being recognized. When I enter the example given in the documentation:

a = 1
b = 5
if not ((a < 10) and (b == 5)) [
  print "hello"
]
 else [
  print "not hello ;-)"
]


 the Error Dialog box shows the message "cannot understand 'else'"
Comment 1 Marc Wolf 2005-12-23 18:34:29 UTC
Reproducable. Important statement to make working programs.
Comment 2 Marc Wolf 2005-12-24 00:18:42 UTC
Created attachment 14029 [details]
trace file 

Trace file using following example:

reset
a=5
if a==4 [
print "ok"
]
else [
print "not ok"
]
Comment 3 Vidar Lokken 2006-05-21 22:05:10 UTC
Confirmed on kturtle 0.6 on SuSE 10. I've tried copying code in verbatim from the manual, so this is IMHO a serious issue, since it limits the logo implementation. Should be fixed in next version.
Comment 4 Cies Breijs 2007-01-06 16:57:10 UTC
*** Bug has been marked as fixed ***.
Comment 5 Anne-Marie Mahfouf 2007-01-16 13:12:31 UTC
Bbefore the fix only
]  else [
worked.
Now 
]  
else [
works but not
]  
else 
[
as in the manual examples.
I reopen the bug report so that the examples in the user manual can be compiled. I'll add a patch, to be committed whenever possible as 3.5.6 tagging has just been done.
Comment 6 Anne-Marie Mahfouf 2007-01-16 13:17:08 UTC
Created attachment 19301 [details]
fixes the else issue so the doc examples work
Comment 7 Anne-Marie Mahfouf 2007-06-16 20:51:15 UTC
SVN commit 676365 by annma:

fix "else" bug
BUG=115555


 M  +1 -1      parser.cpp  


--- branches/KDE/3.5/kdeedu/kturtle/src/parser.cpp #676364:676365
@@ -932,7 +932,7 @@
 	if (currentToken.type == tokElse) // else part
 	{
 		matchToken(tokElse);
-		
+		while (currentToken.type == tokEOL) getToken();
 		if (currentToken.type == tokDo) getToken(); // next word
 
 		if(currentToken.type == tokBegin) node->appendChild( Block() ); // else is followed by block